software.amazon.awscdk.services.s3.notifications.SnsDestination Maven / Gradle / Ivy
Show all versions of s3-notifications Show documentation
package software.amazon.awscdk.services.s3.notifications;
/**
* Use an SNS topic as a bucket notification destination.
*
* Example:
*
*
* Bucket bucket = new Bucket(this, "MyBucket");
* Topic topic = new Topic(this, "MyTopic");
* bucket.addEventNotification(EventType.OBJECT_CREATED, new SnsDestination(topic));
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.74.0 (build 6d08790)", date = "2023-03-14T16:25:30.155Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.s3.notifications.$Module.class, fqn = "@aws-cdk/aws-s3-notifications.SnsDestination")
public class SnsDestination extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.s3.IBucketNotificationDestination {
protected SnsDestination(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected SnsDestination(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param topic This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public SnsDestination(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sns.ITopic topic) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(topic, "topic is required") });
}
/**
* 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.
*
* @param _scope This parameter is required.
* @param bucket This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.BucketNotificationDestinationConfig bind(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Construct _scope, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket bucket) {
return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.BucketNotificationDestinationConfig.class), new Object[] { java.util.Objects.requireNonNull(_scope, "_scope is required"), java.util.Objects.requireNonNull(bucket, "bucket is required") });
}
}