2.3.0 • Published 27 days ago

@cloudcomponents/cdk-s3-antivirus v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
27 days ago

cloudcomponents Logo

@cloudcomponents/cdk-s3-antivirus

Build Status cdkdx typescript python

Antivirus for Amazon S3

Install

TypeScript/JavaScript:

npm i @cloudcomponents/cdk-s3-antivirus

Python:

pip install cloudcomponents.cdk-s3-antivirus

How to use

import { Scanner } from '@cloudcomponents/cdk-s3-antivirus';
import { RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib';
import { SnsDestination } from 'aws-cdk-lib/aws-lambda-destinations';
import { Bucket } from 'aws-cdk-lib/aws-s3';
import { Topic } from 'aws-cdk-lib/aws-sns';
import { EmailSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';
import { Construct } from 'constructs';

export class S3AntivirusStack extends Stack {
  constructor(scope: Construct, id: string, props: StackProps) {
    super(scope, id, props);

    const bucket = new Bucket(this, 'Bucket', {
      autoDeleteObjects: true,
      removalPolicy: RemovalPolicy.DESTROY,
    });

    const topic = new Topic(this, 'Topic');
    if (process.env.DEVSECOPS_TEAM_EMAIL) {
      topic.addSubscription(new EmailSubscription(process.env.DEVSECOPS_TEAM_EMAIL));
    }

    const scanner = new Scanner(this, 'Scanner', {
      onResult: new SnsDestination(topic),
      onError: new SnsDestination(topic),
    });

    scanner.addSourceBucket(bucket);
  }
}

API Reference

See API.md.

Example

See more complete examples.

License

MIT

2.3.0

27 days ago

2.2.0

2 months ago

2.1.0

2 years ago

2.0.0

2 years ago

1.13.0

2 years ago

1.12.0

2 years ago

1.11.0

2 years ago

1.9.0

2 years ago

1.10.0

2 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago