1 | ;
|
2 | var _a;
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | exports.Queue = exports.FifoThroughputLimit = exports.DeduplicationScope = exports.QueueEncryption = void 0;
|
5 | const jsiiDeprecationWarnings = require("../.warnings.jsii.js");
|
6 | const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
7 | const kms = require("@aws-cdk/aws-kms");
|
8 | const core_1 = require("@aws-cdk/core");
|
9 | const queue_base_1 = require("./queue-base");
|
10 | const sqs_generated_1 = require("./sqs.generated");
|
11 | const validate_props_1 = require("./validate-props");
|
12 | /**
|
13 | * What kind of encryption to apply to this queue
|
14 | */
|
15 | var QueueEncryption;
|
16 | (function (QueueEncryption) {
|
17 | /**
|
18 | * Messages in the queue are not encrypted
|
19 | */
|
20 | QueueEncryption["UNENCRYPTED"] = "NONE";
|
21 | /**
|
22 | * Server-side KMS encryption with a master key managed by SQS.
|
23 | */
|
24 | QueueEncryption["KMS_MANAGED"] = "MANAGED";
|
25 | /**
|
26 | * Server-side encryption with a KMS key managed by the user.
|
27 | *
|
28 | * If `encryptionKey` is specified, this key will be used, otherwise, one will be defined.
|
29 | */
|
30 | QueueEncryption["KMS"] = "KMS";
|
31 | })(QueueEncryption = exports.QueueEncryption || (exports.QueueEncryption = {}));
|
32 | /**
|
33 | * What kind of deduplication scope to apply
|
34 | */
|
35 | var DeduplicationScope;
|
36 | (function (DeduplicationScope) {
|
37 | /**
|
38 | * Deduplication occurs at the message group level
|
39 | */
|
40 | DeduplicationScope["MESSAGE_GROUP"] = "messageGroup";
|
41 | /**
|
42 | * Deduplication occurs at the message queue level
|
43 | */
|
44 | DeduplicationScope["QUEUE"] = "queue";
|
45 | })(DeduplicationScope = exports.DeduplicationScope || (exports.DeduplicationScope = {}));
|
46 | /**
|
47 | * Whether the FIFO queue throughput quota applies to the entire queue or per message group
|
48 | */
|
49 | var FifoThroughputLimit;
|
50 | (function (FifoThroughputLimit) {
|
51 | /**
|
52 | * Throughput quota applies per queue
|
53 | */
|
54 | FifoThroughputLimit["PER_QUEUE"] = "perQueue";
|
55 | /**
|
56 | * Throughput quota applies per message group id
|
57 | */
|
58 | FifoThroughputLimit["PER_MESSAGE_GROUP_ID"] = "perMessageGroupId";
|
59 | })(FifoThroughputLimit = exports.FifoThroughputLimit || (exports.FifoThroughputLimit = {}));
|
60 | /**
|
61 | * A new Amazon SQS queue
|
62 | */
|
63 | class Queue extends queue_base_1.QueueBase {
|
64 | constructor(scope, id, props = {}) {
|
65 | super(scope, id, {
|
66 | physicalName: props.queueName,
|
67 | });
|
68 | this.autoCreatePolicy = true;
|
69 | try {
|
70 | jsiiDeprecationWarnings._aws_cdk_aws_sqs_QueueProps(props);
|
71 | }
|
72 | catch (error) {
|
73 | if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
|
74 | Error.captureStackTrace(error, Queue);
|
75 | }
|
76 | throw error;
|
77 | }
|
78 | validate_props_1.validateProps(props);
|
79 | const redrivePolicy = props.deadLetterQueue
|
80 | ? {
|
81 | deadLetterTargetArn: props.deadLetterQueue.queue.queueArn,
|
82 | maxReceiveCount: props.deadLetterQueue.maxReceiveCount,
|
83 | }
|
84 | : undefined;
|
85 | const { encryptionMasterKey, encryptionProps } = _determineEncryptionProps.call(this);
|
86 | const fifoProps = this.determineFifoProps(props);
|
87 | this.fifo = fifoProps.fifoQueue || false;
|
88 | const queue = new sqs_generated_1.CfnQueue(this, 'Resource', {
|
89 | queueName: this.physicalName,
|
90 | ...fifoProps,
|
91 | ...encryptionProps,
|
92 | redrivePolicy,
|
93 | delaySeconds: props.deliveryDelay && props.deliveryDelay.toSeconds(),
|
94 | maximumMessageSize: props.maxMessageSizeBytes,
|
95 | messageRetentionPeriod: props.retentionPeriod && props.retentionPeriod.toSeconds(),
|
96 | receiveMessageWaitTimeSeconds: props.receiveMessageWaitTime && props.receiveMessageWaitTime.toSeconds(),
|
97 | visibilityTimeout: props.visibilityTimeout && props.visibilityTimeout.toSeconds(),
|
98 | });
|
99 | queue.applyRemovalPolicy(props.removalPolicy ?? core_1.RemovalPolicy.DESTROY);
|
100 | this.queueArn = this.getResourceArnAttribute(queue.attrArn, {
|
101 | service: 'sqs',
|
102 | resource: this.physicalName,
|
103 | });
|
104 | this.queueName = this.getResourceNameAttribute(queue.attrQueueName);
|
105 | this.encryptionMasterKey = encryptionMasterKey;
|
106 | this.queueUrl = queue.ref;
|
107 | this.deadLetterQueue = props.deadLetterQueue;
|
108 | function _determineEncryptionProps() {
|
109 | let encryption = props.encryption || QueueEncryption.UNENCRYPTED;
|
110 | if (encryption !== QueueEncryption.KMS && props.encryptionMasterKey) {
|
111 | encryption = QueueEncryption.KMS; // KMS is implied by specifying an encryption key
|
112 | }
|
113 | if (encryption === QueueEncryption.UNENCRYPTED) {
|
114 | return { encryptionProps: {} };
|
115 | }
|
116 | if (encryption === QueueEncryption.KMS_MANAGED) {
|
117 | return {
|
118 | encryptionProps: {
|
119 | kmsMasterKeyId: 'alias/aws/sqs',
|
120 | kmsDataKeyReusePeriodSeconds: props.dataKeyReuse && props.dataKeyReuse.toSeconds(),
|
121 | },
|
122 | };
|
123 | }
|
124 | if (encryption === QueueEncryption.KMS) {
|
125 | const masterKey = props.encryptionMasterKey || new kms.Key(this, 'Key', {
|
126 | description: `Created by ${this.node.path}`,
|
127 | });
|
128 | return {
|
129 | encryptionMasterKey: masterKey,
|
130 | encryptionProps: {
|
131 | kmsMasterKeyId: masterKey.keyArn,
|
132 | kmsDataKeyReusePeriodSeconds: props.dataKeyReuse && props.dataKeyReuse.toSeconds(),
|
133 | },
|
134 | };
|
135 | }
|
136 | throw new Error(`Unexpected 'encryptionType': ${encryption}`);
|
137 | }
|
138 | }
|
139 | /**
|
140 | * Import an existing SQS queue provided an ARN
|
141 | *
|
142 | * @param scope The parent creating construct
|
143 | * @param id The construct's name
|
144 | * @param queueArn queue ARN (i.e. arn:aws:sqs:us-east-2:444455556666:queue1)
|
145 | */
|
146 | static fromQueueArn(scope, id, queueArn) {
|
147 | return Queue.fromQueueAttributes(scope, id, { queueArn });
|
148 | }
|
149 | /**
|
150 | * Import an existing queue
|
151 | */
|
152 | static fromQueueAttributes(scope, id, attrs) {
|
153 | try {
|
154 | jsiiDeprecationWarnings._aws_cdk_aws_sqs_QueueAttributes(attrs);
|
155 | }
|
156 | catch (error) {
|
157 | if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
|
158 | Error.captureStackTrace(error, this.fromQueueAttributes);
|
159 | }
|
160 | throw error;
|
161 | }
|
162 | const stack = core_1.Stack.of(scope);
|
163 | const parsedArn = stack.splitArn(attrs.queueArn, core_1.ArnFormat.NO_RESOURCE_NAME);
|
164 | const queueName = attrs.queueName || parsedArn.resource;
|
165 | const queueUrl = attrs.queueUrl || `https://sqs.${parsedArn.region}.${stack.urlSuffix}/${parsedArn.account}/${queueName}`;
|
166 | class Import extends queue_base_1.QueueBase {
|
167 | constructor() {
|
168 | super(...arguments);
|
169 | this.queueArn = attrs.queueArn; // arn:aws:sqs:us-east-1:123456789012:queue1
|
170 | this.queueUrl = queueUrl;
|
171 | this.queueName = queueName;
|
172 | this.encryptionMasterKey = attrs.keyArn
|
173 | ? kms.Key.fromKeyArn(this, 'Key', attrs.keyArn)
|
174 | : undefined;
|
175 | this.fifo = this.determineFifo();
|
176 | this.autoCreatePolicy = false;
|
177 | }
|
178 | /**
|
179 | * Determine fifo flag based on queueName and fifo attribute
|
180 | */
|
181 | determineFifo() {
|
182 | if (core_1.Token.isUnresolved(this.queueArn)) {
|
183 | return attrs.fifo || false;
|
184 | }
|
185 | else {
|
186 | if (typeof attrs.fifo !== 'undefined') {
|
187 | if (attrs.fifo && !queueName.endsWith('.fifo')) {
|
188 | throw new Error("FIFO queue names must end in '.fifo'");
|
189 | }
|
190 | if (!attrs.fifo && queueName.endsWith('.fifo')) {
|
191 | throw new Error("Non-FIFO queue name may not end in '.fifo'");
|
192 | }
|
193 | }
|
194 | return queueName.endsWith('.fifo') ? true : false;
|
195 | }
|
196 | }
|
197 | }
|
198 | return new Import(scope, id);
|
199 | }
|
200 | /**
|
201 | * Look at the props, see if the FIFO props agree, and return the correct subset of props
|
202 | */
|
203 | determineFifoProps(props) {
|
204 | // Check if any of the signals that we have say that this is a FIFO queue.
|
205 | let fifoQueue = props.fifo;
|
206 | const queueName = props.queueName;
|
207 | if (typeof fifoQueue === 'undefined' && queueName && !core_1.Token.isUnresolved(queueName) && queueName.endsWith('.fifo')) {
|
208 | fifoQueue = true;
|
209 | }
|
210 | if (typeof fifoQueue === 'undefined' && props.contentBasedDeduplication) {
|
211 | fifoQueue = true;
|
212 | }
|
213 | if (typeof fifoQueue === 'undefined' && props.deduplicationScope) {
|
214 | fifoQueue = true;
|
215 | }
|
216 | if (typeof fifoQueue === 'undefined' && props.fifoThroughputLimit) {
|
217 | fifoQueue = true;
|
218 | }
|
219 | // If we have a name, see that it agrees with the FIFO setting
|
220 | if (typeof queueName === 'string') {
|
221 | if (fifoQueue && !queueName.endsWith('.fifo')) {
|
222 | throw new Error("FIFO queue names must end in '.fifo'");
|
223 | }
|
224 | if (!fifoQueue && queueName.endsWith('.fifo')) {
|
225 | throw new Error("Non-FIFO queue name may not end in '.fifo'");
|
226 | }
|
227 | }
|
228 | if (props.contentBasedDeduplication && !fifoQueue) {
|
229 | throw new Error('Content-based deduplication can only be defined for FIFO queues');
|
230 | }
|
231 | if (props.deduplicationScope && !fifoQueue) {
|
232 | throw new Error('Deduplication scope can only be defined for FIFO queues');
|
233 | }
|
234 | if (props.fifoThroughputLimit && !fifoQueue) {
|
235 | throw new Error('FIFO throughput limit can only be defined for FIFO queues');
|
236 | }
|
237 | return {
|
238 | contentBasedDeduplication: props.contentBasedDeduplication,
|
239 | deduplicationScope: props.deduplicationScope,
|
240 | fifoThroughputLimit: props.fifoThroughputLimit,
|
241 | fifoQueue,
|
242 | };
|
243 | }
|
244 | }
|
245 | exports.Queue = Queue;
|
246 | _a = JSII_RTTI_SYMBOL_1;
|
247 | Queue[_a] = { fqn: "@aws-cdk/aws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