"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SqsDestination=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),iam=require("../../aws-iam"),s3=require("../../aws-s3");class SqsDestination{constructor(queue){this.queue=queue,jsiiDeprecationWarnings.aws_cdk_lib_aws_sqs_IQueue(queue)}bind(_scope,bucket){return jsiiDeprecationWarnings.aws_cdk_lib_aws_s3_IBucket(bucket),this.queue.grantSendMessages(new iam.ServicePrincipal("s3.amazonaws.com",{conditions:{ArnLike:{"aws:SourceArn":bucket.bucketArn}}})),this.queue.encryptionMasterKey&&this.queue.encryptionMasterKey.addToResourcePolicy(new iam.PolicyStatement({principals:[new iam.ServicePrincipal("s3.amazonaws.com")],actions:["kms:GenerateDataKey*","kms:Decrypt"],resources:["*"]}),!1),{arn:this.queue.queueArn,type:s3.BucketNotificationDestinationType.QUEUE,dependencies:[this.queue]}}}exports.SqsDestination=SqsDestination,_a=JSII_RTTI_SYMBOL_1,SqsDestination[_a]={fqn:"aws-cdk-lib.aws_s3_notifications.SqsDestination",version:"2.13.0"};
//# sourceMappingURL=sqs.js.map
