```python import { RuleTargetInput } from 'aws-cdk-lib/aws-events'; import { SnsTopic } from 'aws-cdk-lib/aws-events-targets'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { Topic } from 'aws-cdk-lib/aws-sns'; import { Stack, StackProps } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ServerlessClamscan } from 'cdk-serverless-clamscan'; export class CdkTestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const bucket_1 = new Bucket(this, 'rBucket1'); const bucket_2 = new Bucket(this, 'rBucket2'); const bucketList = [bucket_1, bucket_2]; const sc = new ServerlessClamscan(this, 'rClamscan', { buckets: bucketList, }); const bucket_3 = new Bucket(this, 'rBucket3'); sc.addSourceBucket(bucket_3); const infectedTopic = new Topic(this, 'rInfectedTopic'); sc.infectedRule?.addTarget( new SnsTopic(infectedTopic, { message: RuleTargetInput.fromEventPath( '$.detail.responsePayload.message', ), }), ); } } ```
```python from aws_cdk import ( Stack, aws_events as events, aws_events_targets as events_targets, aws_s3 as s3, aws_sns as sns ) from cdk_serverless_clamscan import ServerlessClamscan from constructs import Construct class CdkTestStack(Stack): def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) bucket_1 = s3.Bucket(self, "rBucket1") bucket_2 = s3.Bucket(self, "rBucket2") bucketList = [ bucket_1, bucket_2 ] sc = ServerlessClamscan(self, "rClamScan", buckets=bucketList, ) bucket_3 = s3.Bucket(self, "rBucket3") sc.add_source_bucket(bucket_3) infected_topic = sns.Topic(self, "rInfectedTopic") if sc.infected_rule != None: sc.infected_rule.add_target( events_targets.SnsTopic( infected_topic, message=events.RuleTargetInput.from_event_path('$.detail.responsePayload.message'), ) ) ```
```python import { SqsDestination, EventBridgeDestination, } from 'aws-cdk-lib/aws-lambda-destinations'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { Queue } from 'aws-cdk-lib/aws-sqs'; import { Stack, StackProps } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ServerlessClamscan } from 'cdk-serverless-clamscan'; export class CdkTestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const bucket_1 = new Bucket(this, 'rBucket1'); const bucket_2 = new Bucket(this, 'rBucket2'); const bucketList = [bucket_1, bucket_2]; const queue = new Queue(this, 'rQueue'); const sc = new ServerlessClamscan(this, 'default', { buckets: bucketList, onResult: new EventBridgeDestination(), onError: new SqsDestination(queue), }); const bucket_3 = new Bucket(this, 'rBucket3'); sc.addSourceBucket(bucket_3); } } ```
```python from aws_cdk import ( Stack, aws_lambda_destinations as lambda_destinations, aws_s3 as s3, aws_sqs as sqs ) from cdk_serverless_clamscan import ServerlessClamscan from constructs import Construct class CdkTestStack(Stack): def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) bucket_1 = s3.Bucket(self, "rBucket1") bucket_2 = s3.Bucket(self, "rBucket2") bucketList = [ bucket_1, bucket_2 ] queue = sqs.Queue(self, "rQueue") sc = ServerlessClamscan(self, "rClamScan", buckets=bucketList, on_result=lambda_destinations.EventBridgeDestination(), on_error=lambda_destinations.SqsDestination(queue), ) bucket_3 = s3.Bucket(self, "rBucket3") sc.add_source_bucket(bucket_3) ```
```python import { RuleTargetInput } from 'aws-cdk-lib/aws-events'; import { SnsTopic } from 'aws-cdk-lib/aws-events-targets'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { Topic } from 'aws-cdk-lib/aws-sns'; import { Stack, StackProps } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ServerlessClamscan } from 'cdk-serverless-clamscan'; export class CdkTestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const bucket_1 = new Bucket(this, 'rBucket1'); const bucket_2 = new Bucket(this, 'rBucket2'); const bucketList = [bucket_1, bucket_2]; const sc = new ServerlessClamscan(this, 'rClamscan', { buckets: bucketList, }); const bucket_3 = new Bucket(this, 'rBucket3'); sc.addSourceBucket(bucket_3); const infectedTopic = new Topic(this, 'rInfectedTopic'); sc.infectedRule?.addTarget( new SnsTopic(infectedTopic, { message: RuleTargetInput.fromEventPath( '$.detail.responsePayload.message', ), }), ); } } ```
```python from aws_cdk import ( Stack, aws_events as events, aws_events_targets as events_targets, aws_s3 as s3, aws_sns as sns ) from cdk_serverless_clamscan import ServerlessClamscan from constructs import Construct class CdkTestStack(Stack): def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) bucket_1 = s3.Bucket(self, "rBucket1") bucket_2 = s3.Bucket(self, "rBucket2") bucketList = [ bucket_1, bucket_2 ] sc = ServerlessClamscan(self, "rClamScan", buckets=bucketList, ) bucket_3 = s3.Bucket(self, "rBucket3") sc.add_source_bucket(bucket_3) infected_topic = sns.Topic(self, "rInfectedTopic") if sc.infected_rule != None: sc.infected_rule.add_target( events_targets.SnsTopic( infected_topic, message=events.RuleTargetInput.from_event_path('$.detail.responsePayload.message'), ) ) ```
```python import { SqsDestination, EventBridgeDestination, } from 'aws-cdk-lib/aws-lambda-destinations'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { Queue } from 'aws-cdk-lib/aws-sqs'; import { Stack, StackProps } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ServerlessClamscan } from 'cdk-serverless-clamscan'; export class CdkTestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const bucket_1 = new Bucket(this, 'rBucket1'); const bucket_2 = new Bucket(this, 'rBucket2'); const bucketList = [bucket_1, bucket_2]; const queue = new Queue(this, 'rQueue'); const sc = new ServerlessClamscan(this, 'default', { buckets: bucketList, onResult: new EventBridgeDestination(), onError: new SqsDestination(queue), }); const bucket_3 = new Bucket(this, 'rBucket3'); sc.addSourceBucket(bucket_3); } } ```
```python from aws_cdk import ( Stack, aws_lambda_destinations as lambda_destinations, aws_s3 as s3, aws_sqs as sqs ) from cdk_serverless_clamscan import ServerlessClamscan from constructs import Construct class CdkTestStack(Stack): def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) bucket_1 = s3.Bucket(self, "rBucket1") bucket_2 = s3.Bucket(self, "rBucket2") bucketList = [ bucket_1, bucket_2 ] queue = sqs.Queue(self, "rQueue") sc = ServerlessClamscan(self, "rClamScan", buckets=bucketList, on_result=lambda_destinations.EventBridgeDestination(), on_error=lambda_destinations.SqsDestination(queue), ) bucket_3 = s3.Bucket(self, "rBucket3") sc.add_source_bucket(bucket_3) ```
```python import { RuleTargetInput } from 'aws-cdk-lib/aws-events'; import { SnsTopic } from 'aws-cdk-lib/aws-events-targets'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { Topic } from 'aws-cdk-lib/aws-sns'; import { Stack, StackProps } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ServerlessClamscan } from 'cdk-serverless-clamscan'; export class CdkTestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const bucket_1 = new Bucket(this, 'rBucket1'); const bucket_2 = new Bucket(this, 'rBucket2'); const bucketList = [bucket_1, bucket_2]; const sc = new ServerlessClamscan(this, 'rClamscan', { buckets: bucketList, }); const bucket_3 = new Bucket(this, 'rBucket3'); sc.addSourceBucket(bucket_3); const infectedTopic = new Topic(this, 'rInfectedTopic'); sc.infectedRule?.addTarget( new SnsTopic(infectedTopic, { message: RuleTargetInput.fromEventPath( '$.detail.responsePayload.message', ), }), ); } } ```
```python from aws_cdk import ( Stack, aws_events as events, aws_events_targets as events_targets, aws_s3 as s3, aws_sns as sns ) from cdk_serverless_clamscan import ServerlessClamscan from constructs import Construct class CdkTestStack(Stack): def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) bucket_1 = s3.Bucket(self, "rBucket1") bucket_2 = s3.Bucket(self, "rBucket2") bucketList = [ bucket_1, bucket_2 ] sc = ServerlessClamscan(self, "rClamScan", buckets=bucketList, ) bucket_3 = s3.Bucket(self, "rBucket3") sc.add_source_bucket(bucket_3) infected_topic = sns.Topic(self, "rInfectedTopic") if sc.infected_rule != None: sc.infected_rule.add_target( events_targets.SnsTopic( infected_topic, message=events.RuleTargetInput.from_event_path('$.detail.responsePayload.message'), ) ) ```
```python import { SqsDestination, EventBridgeDestination, } from 'aws-cdk-lib/aws-lambda-destinations'; import { Bucket } from 'aws-cdk-lib/aws-s3'; import { Queue } from 'aws-cdk-lib/aws-sqs'; import { Stack, StackProps } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ServerlessClamscan } from 'cdk-serverless-clamscan'; export class CdkTestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const bucket_1 = new Bucket(this, 'rBucket1'); const bucket_2 = new Bucket(this, 'rBucket2'); const bucketList = [bucket_1, bucket_2]; const queue = new Queue(this, 'rQueue'); const sc = new ServerlessClamscan(this, 'default', { buckets: bucketList, onResult: new EventBridgeDestination(), onError: new SqsDestination(queue), }); const bucket_3 = new Bucket(this, 'rBucket3'); sc.addSourceBucket(bucket_3); } } ```
```python from aws_cdk import ( Stack, aws_lambda_destinations as lambda_destinations, aws_s3 as s3, aws_sqs as sqs ) from cdk_serverless_clamscan import ServerlessClamscan from constructs import Construct class CdkTestStack(Stack): def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) bucket_1 = s3.Bucket(self, "rBucket1") bucket_2 = s3.Bucket(self, "rBucket2") bucketList = [ bucket_1, bucket_2 ] queue = sqs.Queue(self, "rQueue") sc = ServerlessClamscan(self, "rClamScan", buckets=bucketList, on_result=lambda_destinations.EventBridgeDestination(), on_error=lambda_destinations.SqsDestination(queue), ) bucket_3 = s3.Bucket(self, "rBucket3") sc.add_source_bucket(bucket_3) ```