This documentation is for the developer preview release of the AWS CDK. Do not use this version of the AWS CDK in production. Subsequent releases of the AWS CDK will likely include breaking changes.

@aws-cdk/aws-s3-notifications

S3 Bucket Notifications API

This module includes the API that constructs should implement in order to be able to be used as destinations for bucket notifications.

To implement the IBucketNotificationDestination, a construct should implement a method asBucketNotificationDestination(bucketArn, bucketId) which registers this resource as a destination for bucket notifications for the specified bucket and returns the ARN of the destination and it’s type.

Reference

View in Nuget

csproj:

<PackageReference Include="Amazon.CDK.AWS.S3.Notifications" Version="0.25.3" />

dotnet:

dotnet add package Amazon.CDK.AWS.S3.Notifications --version 0.25.3

packages.config:

<package id="Amazon.CDK.AWS.S3.Notifications" version="0.25.3" />

View in Maven Central

Apache Buildr:

'software.amazon.awscdk:s3-notifications:jar:0.25.3'

Apache Ivy:

<dependency groupId="software.amazon.awscdk" name="s3-notifications" rev="0.25.3"/>

Apache Maven:

<dependency>
  <groupId>software.amazon.awscdk</groupId>
  <artifactId>s3-notifications</artifactId>
  <version>0.25.3</version>
</dependency>

Gradle / Grails:

compile 'software.amazon.awscdk:s3-notifications:0.25.3'

Groovy Grape:

@Grapes(
@Grab(group='software.amazon.awscdk', module='s3-notifications', version='0.25.3')
)

View in NPM

npm:

$ npm i @aws-cdk/aws-s3-notifications@0.25.3

package.json:

{
  "@aws-cdk/aws-s3-notifications": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-s3-notifications@0.25.3

View in NPM

npm:

$ npm i @aws-cdk/aws-s3-notifications@0.25.3

package.json:

{
  "@aws-cdk/aws-s3-notifications": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-s3-notifications@0.25.3

BucketNotificationDestinationProps (interface)

class @aws-cdk/aws-s3-notifications.BucketNotificationDestinationProps

Language-specific names:

using Amazon.CDK.AWS.S3.Notifications;
import software.amazon.awscdk.services.s3.notifications.BucketNotificationDestinationProps;
// BucketNotificationDestinationProps is an interface
import { BucketNotificationDestinationProps } from '@aws-cdk/aws-s3-notifications';

Represents the properties of a notification destination.

arn

The ARN of the destination (i.e. Lambda, SNS, SQS).

Type:string
type

The notification type.

Type:BucketNotificationDestinationType
dependencies

Any additional dependencies that should be resolved before the bucket notification

can be configured (for example, the SNS Topic Policy resource).

Type:@aws-cdk/cdk.IDependable[] (optional)

BucketNotificationDestinationType (enum)

class @aws-cdk/aws-s3-notifications.BucketNotificationDestinationType

Language-specific names:

using Amazon.CDK.AWS.S3.Notifications;
import software.amazon.awscdk.services.s3.notifications.BucketNotificationDestinationType;
const { BucketNotificationDestinationType } = require('@aws-cdk/aws-s3-notifications');
import { BucketNotificationDestinationType } from '@aws-cdk/aws-s3-notifications';

Supported types of notification destinations.

Lambda
Queue
Topic

IBucketNotificationDestination (interface)

class @aws-cdk/aws-s3-notifications.IBucketNotificationDestination

Language-specific names:

using Amazon.CDK.AWS.S3.Notifications;
import software.amazon.awscdk.services.s3.notifications.IBucketNotificationDestination;
// IBucketNotificationDestination is an interface
import { IBucketNotificationDestination } from '@aws-cdk/aws-s3-notifications';

Implemented by constructs that can be used as bucket notification destinations.

asBucketNotificationDestination(bucketArn, bucketId) → @aws-cdk/aws-s3-notifications.BucketNotificationDestinationProps

Registers this resource to receive notifications for the specified

bucket. This method will only be called once for each destination/bucket

pair and the result will be cached, so there is no need to implement

idempotency in each destination.

Parameters:
  • bucketArn (string) – The ARN of the bucket
  • bucketId (string) – A unique ID of this bucket in the stack
Return type:

BucketNotificationDestinationProps

Abstract:

Yes