"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SqsQueue=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),iam=require("../../aws-iam"),util_1=require("./util");class SqsQueue{constructor(queue,props={}){if(this.queue=queue,this.props=props,jsiiDeprecationWarnings.aws_cdk_lib_aws_sqs_IQueue(queue),jsiiDeprecationWarnings.aws_cdk_lib_aws_events_targets_SqsQueueProps(props),props.messageGroupId!==void 0&&!queue.fifo)throw new Error("messageGroupId cannot be specified for non-FIFO queues")}bind(rule,_id){jsiiDeprecationWarnings.aws_cdk_lib_aws_events_IRule(rule);const principalOpts=this.queue.encryptionMasterKey?{}:{conditions:{ArnEquals:{"aws:SourceArn":rule.ruleArn}}};return this.queue.grantSendMessages(new iam.ServicePrincipal("events.amazonaws.com",principalOpts)),this.props.deadLetterQueue&&util_1.addToDeadLetterQueueResourcePolicy(rule,this.props.deadLetterQueue),{...util_1.bindBaseTargetConfig(this.props),arn:this.queue.queueArn,input:this.props.message,targetResource:this.queue,sqsParameters:this.props.messageGroupId?{messageGroupId:this.props.messageGroupId}:void 0}}}exports.SqsQueue=SqsQueue,_a=JSII_RTTI_SYMBOL_1,SqsQueue[_a]={fqn:"aws-cdk-lib.aws_events_targets.SqsQueue",version:"2.13.0"};
//# sourceMappingURL=sqs.js.map
