terraconstructs 0.1.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/.jsii +1297 -629
  2. package/lib/asset-staging.js +1 -1
  3. package/lib/aws/arn.js +4 -3
  4. package/lib/aws/aws-asset-manager.js +1 -1
  5. package/lib/aws/aws-construct.js +1 -1
  6. package/lib/aws/aws-stack.js +1 -1
  7. package/lib/aws/aws-tags.js +2 -2
  8. package/lib/aws/cloudwatch/actions/appscaling.js +1 -1
  9. package/lib/aws/cloudwatch/actions/ec2.js +1 -1
  10. package/lib/aws/cloudwatch/actions/lambda.js +1 -1
  11. package/lib/aws/cloudwatch/actions/sns.js +1 -1
  12. package/lib/aws/cloudwatch/actions/ssm.js +2 -2
  13. package/lib/aws/cloudwatch/alarm-base.js +1 -1
  14. package/lib/aws/cloudwatch/alarm-rule.js +1 -1
  15. package/lib/aws/cloudwatch/alarm-status-widget.js +1 -1
  16. package/lib/aws/cloudwatch/alarm.js +1 -1
  17. package/lib/aws/cloudwatch/composite-alarm.js +1 -1
  18. package/lib/aws/cloudwatch/dashboard.js +1 -1
  19. package/lib/aws/cloudwatch/data-protection-policy.js +3 -3
  20. package/lib/aws/cloudwatch/graph.js +8 -8
  21. package/lib/aws/cloudwatch/layout.js +3 -3
  22. package/lib/aws/cloudwatch/log-destinations/kinesis.js +1 -1
  23. package/lib/aws/cloudwatch/log-destinations/lambda.js +1 -1
  24. package/lib/aws/cloudwatch/log-group.js +1 -1
  25. package/lib/aws/cloudwatch/log-query.js +1 -1
  26. package/lib/aws/cloudwatch/log-stream.js +1 -1
  27. package/lib/aws/cloudwatch/metric-filter.js +1 -1
  28. package/lib/aws/cloudwatch/metric.js +2 -2
  29. package/lib/aws/cloudwatch/pattern.js +3 -3
  30. package/lib/aws/cloudwatch/policy.js +1 -1
  31. package/lib/aws/cloudwatch/query-definition.js +2 -2
  32. package/lib/aws/cloudwatch/stats.js +1 -1
  33. package/lib/aws/cloudwatch/subscription-filter.js +1 -1
  34. package/lib/aws/cloudwatch/text.js +1 -1
  35. package/lib/aws/cloudwatch/variable.js +3 -3
  36. package/lib/aws/cloudwatch/widget.js +1 -1
  37. package/lib/aws/compute/access-log.js +4 -4
  38. package/lib/aws/compute/activity.js +1 -1
  39. package/lib/aws/compute/alb/application-listener-action.js +1 -1
  40. package/lib/aws/compute/alb/application-listener-certificate.js +1 -1
  41. package/lib/aws/compute/alb/application-listener-rule.js +1 -1
  42. package/lib/aws/compute/alb/application-listener.js +1 -1
  43. package/lib/aws/compute/alb/application-load-balancer.js +1 -1
  44. package/lib/aws/compute/alb/application-target-group.js +1 -1
  45. package/lib/aws/compute/alb/conditions.js +1 -1
  46. package/lib/aws/compute/alb/trust-store-revocation.js +1 -1
  47. package/lib/aws/compute/alb/trust-store.js +1 -1
  48. package/lib/aws/compute/api-definition.js +3 -3
  49. package/lib/aws/compute/api-key.js +2 -2
  50. package/lib/aws/compute/architecture.js +1 -1
  51. package/lib/aws/compute/aspects/require-imdsv2-aspect.js +2 -2
  52. package/lib/aws/compute/authorizer.js +1 -1
  53. package/lib/aws/compute/authorizers/identity-source.js +1 -1
  54. package/lib/aws/compute/authorizers/lambda.js +2 -2
  55. package/lib/aws/compute/base-path-mapping.js +1 -1
  56. package/lib/aws/compute/base-scalable-attribute.js +1 -1
  57. package/lib/aws/compute/bastion-host.js +1 -1
  58. package/lib/aws/compute/chain.js +1 -1
  59. package/lib/aws/compute/client-vpn-authorization-rule.js +1 -1
  60. package/lib/aws/compute/client-vpn-endpoint.js +2 -2
  61. package/lib/aws/compute/client-vpn-route.js +2 -2
  62. package/lib/aws/compute/code.js +8 -8
  63. package/lib/aws/compute/condition.js +1 -1
  64. package/lib/aws/compute/connections.js +1 -1
  65. package/lib/aws/compute/cors.js +1 -1
  66. package/lib/aws/compute/deployment.js +1 -1
  67. package/lib/aws/compute/domain-name.js +1 -1
  68. package/lib/aws/compute/event-invoke-config.js +1 -1
  69. package/lib/aws/compute/event-source-filter.js +2 -2
  70. package/lib/aws/compute/event-source-mapping.d.ts +10 -0
  71. package/lib/aws/compute/event-source-mapping.js +20 -23
  72. package/lib/aws/compute/event-sources/s3-onfailure-destination.js +1 -1
  73. package/lib/aws/compute/event-sources/s3.js +1 -1
  74. package/lib/aws/compute/event-sources/sqs-dlq.js +1 -1
  75. package/lib/aws/compute/event-sources/sqs.d.ts +10 -0
  76. package/lib/aws/compute/event-sources/sqs.js +3 -3
  77. package/lib/aws/compute/fields.js +4 -4
  78. package/lib/aws/compute/function-alias.js +1 -1
  79. package/lib/aws/compute/function-base.js +2 -2
  80. package/lib/aws/compute/function-destinations/event-bridge.js +1 -1
  81. package/lib/aws/compute/function-destinations/function.js +1 -1
  82. package/lib/aws/compute/function-destinations/sqs.js +1 -1
  83. package/lib/aws/compute/function-nodejs/function.js +1 -1
  84. package/lib/aws/compute/function-url.js +1 -1
  85. package/lib/aws/compute/function.js +3 -3
  86. package/lib/aws/compute/gateway-response.js +2 -2
  87. package/lib/aws/compute/handler.js +1 -1
  88. package/lib/aws/compute/instance-types.js +1 -1
  89. package/lib/aws/compute/instance.js +1 -1
  90. package/lib/aws/compute/integration.js +1 -1
  91. package/lib/aws/compute/integrations/aws.js +1 -1
  92. package/lib/aws/compute/integrations/http.js +1 -1
  93. package/lib/aws/compute/integrations/lambda.js +1 -1
  94. package/lib/aws/compute/integrations/mock.js +1 -1
  95. package/lib/aws/compute/integrations/stepfunctions.js +1 -1
  96. package/lib/aws/compute/ip-addresses.js +2 -2
  97. package/lib/aws/compute/ipam.js +1 -1
  98. package/lib/aws/compute/key-pair.js +1 -1
  99. package/lib/aws/compute/lambda-api.js +1 -1
  100. package/lib/aws/compute/launch-template.js +2 -2
  101. package/lib/aws/compute/lb-shared/base-listener.js +1 -1
  102. package/lib/aws/compute/lb-shared/base-load-balancer.js +2 -2
  103. package/lib/aws/compute/lb-shared/base-target-group.js +1 -1
  104. package/lib/aws/compute/lb-shared/listener-certificate.js +1 -1
  105. package/lib/aws/compute/lb-shared/load-balancer-targets.js +2 -2
  106. package/lib/aws/compute/lb-targets/alb-target.js +3 -3
  107. package/lib/aws/compute/lb-targets/instance-target.js +2 -2
  108. package/lib/aws/compute/lb-targets/ip-target.js +1 -1
  109. package/lib/aws/compute/lb-targets/lambda-target.js +1 -1
  110. package/lib/aws/compute/load-balancer.js +3 -3
  111. package/lib/aws/compute/machine-image/amazon-linux-2022.js +2 -2
  112. package/lib/aws/compute/machine-image/amazon-linux-2023.js +2 -2
  113. package/lib/aws/compute/machine-image/amazon-linux2.js +2 -2
  114. package/lib/aws/compute/machine-image/common.js +1 -1
  115. package/lib/aws/compute/machine-image/machine-image.js +8 -8
  116. package/lib/aws/compute/method.js +1 -1
  117. package/lib/aws/compute/model.js +3 -3
  118. package/lib/aws/compute/nat.js +5 -5
  119. package/lib/aws/compute/network-acl-types.js +2 -2
  120. package/lib/aws/compute/network-acl.js +3 -3
  121. package/lib/aws/compute/nlb/network-listener-action.js +1 -1
  122. package/lib/aws/compute/nlb/network-listener.js +1 -1
  123. package/lib/aws/compute/nlb/network-load-balancer.js +1 -1
  124. package/lib/aws/compute/nlb/network-target-group.js +1 -1
  125. package/lib/aws/compute/peer.js +1 -1
  126. package/lib/aws/compute/placement-group.js +1 -1
  127. package/lib/aws/compute/port.js +1 -1
  128. package/lib/aws/compute/prefix-list.js +1 -1
  129. package/lib/aws/compute/requestvalidator.js +1 -1
  130. package/lib/aws/compute/resource.js +3 -3
  131. package/lib/aws/compute/restapi.js +3 -3
  132. package/lib/aws/compute/route.js +8 -8
  133. package/lib/aws/compute/runtime.js +1 -1
  134. package/lib/aws/compute/scalable-target.js +1 -1
  135. package/lib/aws/compute/schedule.js +1 -1
  136. package/lib/aws/compute/security-group.js +1 -1
  137. package/lib/aws/compute/stage.js +2 -2
  138. package/lib/aws/compute/state-graph.js +1 -1
  139. package/lib/aws/compute/state-machine-fragment.js +1 -1
  140. package/lib/aws/compute/state-machine.js +4 -4
  141. package/lib/aws/compute/states/choice.js +1 -1
  142. package/lib/aws/compute/states/custom-state.js +1 -1
  143. package/lib/aws/compute/states/distributed-map/item-batcher.js +1 -1
  144. package/lib/aws/compute/states/distributed-map/item-reader.js +5 -5
  145. package/lib/aws/compute/states/distributed-map/result-writer.js +1 -1
  146. package/lib/aws/compute/states/distributed-map.js +1 -1
  147. package/lib/aws/compute/states/fail.js +1 -1
  148. package/lib/aws/compute/states/map-base.js +1 -1
  149. package/lib/aws/compute/states/map.js +1 -1
  150. package/lib/aws/compute/states/parallel.js +1 -1
  151. package/lib/aws/compute/states/pass.js +2 -2
  152. package/lib/aws/compute/states/state.js +1 -1
  153. package/lib/aws/compute/states/succeed.js +1 -1
  154. package/lib/aws/compute/states/task-base.js +2 -2
  155. package/lib/aws/compute/states/task.js +1 -1
  156. package/lib/aws/compute/states/wait.js +2 -2
  157. package/lib/aws/compute/step-scaling-action.js +1 -1
  158. package/lib/aws/compute/step-scaling-policy.js +1 -1
  159. package/lib/aws/compute/stepfunctions-api.js +1 -1
  160. package/lib/aws/compute/subnet-v2.js +2 -2
  161. package/lib/aws/compute/subnet.js +1 -1
  162. package/lib/aws/compute/target-tracking-scaling-policy.js +1 -1
  163. package/lib/aws/compute/task-credentials.js +1 -1
  164. package/lib/aws/compute/task-input.js +1 -1
  165. package/lib/aws/compute/tasks/aws-sdk/call-aws-service.js +1 -1
  166. package/lib/aws/compute/tasks/eventbridge/put-events.js +1 -1
  167. package/lib/aws/compute/tasks/http/invoke.js +1 -1
  168. package/lib/aws/compute/tasks/lambda/invoke.js +1 -1
  169. package/lib/aws/compute/tasks/sqs/send-message.js +10 -13
  170. package/lib/aws/compute/tasks/stepfunctions/invoke-activity.js +1 -1
  171. package/lib/aws/compute/tasks/stepfunctions/start-execution.js +1 -1
  172. package/lib/aws/compute/types.js +1 -1
  173. package/lib/aws/compute/usage-plan.js +1 -1
  174. package/lib/aws/compute/user-data.js +3 -3
  175. package/lib/aws/compute/volume.js +2 -2
  176. package/lib/aws/compute/vpc-endpoint-service.js +1 -1
  177. package/lib/aws/compute/vpc-endpoint.js +6 -6
  178. package/lib/aws/compute/vpc-flow-logs.js +4 -4
  179. package/lib/aws/compute/vpc-link.js +1 -1
  180. package/lib/aws/compute/vpc-v2-base.js +1 -1
  181. package/lib/aws/compute/vpc-v2.js +2 -2
  182. package/lib/aws/compute/vpc.js +4 -4
  183. package/lib/aws/compute/vpn.js +3 -3
  184. package/lib/aws/edge/certificate.js +1 -1
  185. package/lib/aws/edge/distribution.js +3 -3
  186. package/lib/aws/edge/dns-alias-record-targets.js +6 -6
  187. package/lib/aws/edge/dns-record.js +13 -13
  188. package/lib/aws/edge/dns-zone.js +1 -1
  189. package/lib/aws/edge/function.js +2 -2
  190. package/lib/aws/edge/key-value-store.js +4 -4
  191. package/lib/aws/edge/origin.js +3 -3
  192. package/lib/aws/edge/response-headers-policy.js +1 -1
  193. package/lib/aws/encryption/alias.js +1 -1
  194. package/lib/aws/encryption/key.js +1 -1
  195. package/lib/aws/encryption/via-service-principal.js +1 -1
  196. package/lib/aws/environment-aware.d.ts +41 -0
  197. package/lib/aws/environment-aware.js +3 -0
  198. package/lib/aws/iam/grant.d.ts +34 -0
  199. package/lib/aws/iam/grant.js +27 -6
  200. package/lib/aws/iam/group.js +1 -1
  201. package/lib/aws/iam/instance-profile.js +1 -1
  202. package/lib/aws/iam/managed-policy.js +1 -1
  203. package/lib/aws/iam/oidc-provider.js +1 -1
  204. package/lib/aws/iam/policy-document.js +1 -1
  205. package/lib/aws/iam/policy-statement.js +1 -1
  206. package/lib/aws/iam/policy.js +1 -1
  207. package/lib/aws/iam/principals.js +20 -20
  208. package/lib/aws/iam/role.js +1 -1
  209. package/lib/aws/iam/saml-provider.js +2 -2
  210. package/lib/aws/iam/unknown-principal.js +1 -1
  211. package/lib/aws/iam/user.js +1 -1
  212. package/lib/aws/index.d.ts +1 -0
  213. package/lib/aws/index.js +2 -1
  214. package/lib/aws/network/simple-ipv4-vpc.js +1 -1
  215. package/lib/aws/network/subnet-group.js +3 -3
  216. package/lib/aws/network/subnet.js +4 -4
  217. package/lib/aws/notify/archive.js +1 -1
  218. package/lib/aws/notify/connection.js +3 -3
  219. package/lib/aws/notify/event-bus.d.ts +1 -1
  220. package/lib/aws/notify/event-bus.js +4 -4
  221. package/lib/aws/notify/event-pattern.js +1 -1
  222. package/lib/aws/notify/index.d.ts +3 -1
  223. package/lib/aws/notify/index.js +5 -5
  224. package/lib/aws/notify/input.js +2 -2
  225. package/lib/aws/notify/kinesis-stream.js +1 -1
  226. package/lib/aws/notify/notification-rule.js +1 -1
  227. package/lib/aws/notify/policy.js +1 -1
  228. package/lib/aws/notify/queue-base.d.ts +241 -0
  229. package/lib/aws/notify/queue-base.js +161 -0
  230. package/lib/aws/notify/queue-policy.js +1 -1
  231. package/lib/aws/notify/queue.d.ts +157 -190
  232. package/lib/aws/notify/queue.js +239 -186
  233. package/lib/aws/notify/resource-policy.js +1 -1
  234. package/lib/aws/notify/rule.js +1 -1
  235. package/lib/aws/notify/schedule.js +1 -1
  236. package/lib/aws/notify/sqs-augmentations.generated.d.ts +3 -3
  237. package/lib/aws/notify/sqs-augmentations.generated.js +23 -26
  238. package/lib/aws/notify/sqs-grants.generated.d.ts +72 -0
  239. package/lib/aws/notify/sqs-grants.generated.js +139 -0
  240. package/lib/aws/notify/subscription-filter.js +1 -1
  241. package/lib/aws/notify/subscription.js +4 -4
  242. package/lib/aws/notify/subscriptions/email.js +1 -1
  243. package/lib/aws/notify/subscriptions/lambda.js +1 -1
  244. package/lib/aws/notify/subscriptions/sms.js +1 -1
  245. package/lib/aws/notify/subscriptions/sqs.js +30 -27
  246. package/lib/aws/notify/subscriptions/subscription.d.ts +1 -1
  247. package/lib/aws/notify/subscriptions/subscription.js +1 -1
  248. package/lib/aws/notify/subscriptions/url.js +1 -1
  249. package/lib/aws/notify/targets/event-bus.d.ts +1 -1
  250. package/lib/aws/notify/targets/event-bus.js +2 -2
  251. package/lib/aws/notify/targets/function.js +1 -1
  252. package/lib/aws/notify/targets/log-group.js +2 -2
  253. package/lib/aws/notify/targets/sqs.js +12 -14
  254. package/lib/aws/notify/targets/state-machine.js +1 -1
  255. package/lib/aws/notify/topic-base.js +1 -1
  256. package/lib/aws/notify/topic.js +1 -1
  257. package/lib/aws/storage/assets/image-asset.js +3 -3
  258. package/lib/aws/storage/assets/s3.js +1 -1
  259. package/lib/aws/storage/auth-token.js +2 -2
  260. package/lib/aws/storage/billing.js +1 -1
  261. package/lib/aws/storage/bucket-notifications.js +1 -1
  262. package/lib/aws/storage/bucket-policy.js +1 -1
  263. package/lib/aws/storage/bucket-source.js +1 -1
  264. package/lib/aws/storage/bucket.js +2 -2
  265. package/lib/aws/storage/capacity.js +1 -1
  266. package/lib/aws/storage/ecr-repository.js +3 -3
  267. package/lib/aws/storage/encryption.js +1 -1
  268. package/lib/aws/storage/notification-targets/function.js +1 -1
  269. package/lib/aws/storage/notification-targets/queue.js +17 -21
  270. package/lib/aws/storage/origin-access-identity.js +1 -1
  271. package/lib/aws/storage/parameter.js +2 -2
  272. package/lib/aws/storage/table.js +3 -3
  273. package/lib/bundling.js +3 -3
  274. package/lib/construct-base.js +2 -2
  275. package/lib/duration.js +1 -1
  276. package/lib/errors.js +1 -1
  277. package/lib/expiration.js +1 -1
  278. package/lib/fs/ignore.js +4 -4
  279. package/lib/fs/index.js +1 -1
  280. package/lib/helpers-internal/index.d.ts +1 -0
  281. package/lib/helpers-internal/index.js +16 -1
  282. package/lib/helpers-internal/validate-all-props.d.ts +29 -0
  283. package/lib/helpers-internal/validate-all-props.js +23 -0
  284. package/lib/size.js +1 -1
  285. package/lib/stack-base.js +1 -1
  286. package/lib/terra-func.js +1 -1
  287. package/lib/time-zone.js +1 -1
  288. package/package.json +1 -1
  289. package/lib/aws/notify/queue-config.generated.d.ts +0 -98
  290. package/lib/aws/notify/queue-config.generated.js +0 -3
@@ -1,9 +1,13 @@
1
1
  import { sqsQueue } from "@cdktf/provider-aws";
2
2
  import { Construct } from "constructs";
3
- import { SqsQueueConfig } from ".";
4
- import { AwsConstructBase, AwsConstructProps } from "../aws-construct";
5
- import * as iam from "../iam";
6
- export interface QueueProps extends AwsConstructProps, SqsQueueConfig {
3
+ import { Duration } from "../../duration";
4
+ import { IQueue, QueueBase, QueueEncryption } from "./queue-base";
5
+ import { AwsConstructProps } from "../aws-construct";
6
+ import * as kms from "../encryption";
7
+ /**
8
+ * Properties for creating a new Queue
9
+ */
10
+ export interface QueueProps extends AwsConstructProps {
7
11
  /**
8
12
  * Queue Name prefix
9
13
  *
@@ -16,7 +20,58 @@ export interface QueueProps extends AwsConstructProps, SqsQueueConfig {
16
20
  * For a FIFO (first-in-first-out) queue, the name must end with the .fifo
17
21
  * @default - GridUUID + Stack Unique Name
18
22
  */
19
- readonly namePrefix?: string;
23
+ readonly queueName?: string;
24
+ /**
25
+ * The number of seconds that Amazon SQS retains a message.
26
+ *
27
+ * You can specify an integer value from 60 seconds (1 minute) to 1209600
28
+ * seconds (14 days). The default value is 345600 seconds (4 days).
29
+ *
30
+ * @default Duration.days(4)
31
+ */
32
+ readonly retentionPeriod?: Duration;
33
+ /**
34
+ * The time in seconds that the delivery of all messages in the queue is delayed.
35
+ *
36
+ * You can specify an integer value of 0 to 900 (15 minutes). The default
37
+ * value is 0.
38
+ *
39
+ * @default 0
40
+ */
41
+ readonly deliveryDelay?: Duration;
42
+ /**
43
+ * The limit of how many bytes that a message can contain before Amazon SQS rejects it.
44
+ *
45
+ * You can specify an integer value from 1024 bytes (1 KiB) to 1048576 bytes
46
+ * (1 MiB). The default value is 1048576 (1 MiB).
47
+ *
48
+ * @default 1MiB
49
+ */
50
+ readonly maxMessageSizeBytes?: number;
51
+ /**
52
+ * Default wait time for ReceiveMessage calls.
53
+ *
54
+ * Does not wait if set to 0, otherwise waits this amount of seconds
55
+ * by default for messages to arrive.
56
+ *
57
+ * For more information, see Amazon SQS Long Poll.
58
+ *
59
+ * @default 0
60
+ */
61
+ readonly receiveMessageWaitTime?: Duration;
62
+ /**
63
+ * Timeout of processing a single message.
64
+ *
65
+ * After dequeuing, the processor has this much time to handle the message
66
+ * and delete it from the queue before it becomes visible again for dequeueing
67
+ * by another processor.
68
+ *
69
+ * Values must be from 0 to 43200 seconds (12 hours). If you don't specify
70
+ * a value, AWS CloudFormation uses the default value of 30 seconds.
71
+ *
72
+ * @default Duration.seconds(30)
73
+ */
74
+ readonly visibilityTimeout?: Duration;
20
75
  /**
21
76
  * Send messages to this queue if they were unsuccessfully dequeued a number of times.
22
77
  *
@@ -28,18 +83,40 @@ export interface QueueProps extends AwsConstructProps, SqsQueueConfig {
28
83
  */
29
84
  readonly deadLetterQueue?: DeadLetterQueue;
30
85
  /**
31
- * The string that includes the parameters for the permissions for the dead-letter queue
32
- * redrive permission and which source queues can specify dead-letter queues.
86
+ * Whether the contents of the queue are encrypted, and by what type of key.
33
87
  *
34
- * @default - All source queues can designate this queue as their dead-letter queue.
88
+ * Be aware that encryption is not available in all regions, please see the docs
89
+ * for current availability details.
35
90
  *
36
- * {@link https://registry.terraform.io/providers/hashicorp/aws/5.68.0/docs/resources/sqs_queue#redrive_allow_policy SqsQueue#redrive_allow_policy}
91
+ * @default SQS_MANAGED (SSE-SQS) for newly created queues
37
92
  */
38
- readonly redriveAllowPolicy?: RedriveAllowPolicy;
93
+ readonly encryption?: QueueEncryption;
94
+ /**
95
+ * External KMS key to use for queue encryption.
96
+ *
97
+ * Individual messages will be encrypted using data keys. The data keys in
98
+ * turn will be encrypted using this key, and reused for a maximum of
99
+ * `dataKeyReuseSecs` seconds.
100
+ *
101
+ * If the 'encryptionMasterKey' property is set, 'encryption' type will be
102
+ * implicitly set to "KMS".
103
+ *
104
+ * @default If encryption is set to KMS and not specified, a key will be created.
105
+ */
106
+ readonly encryptionMasterKey?: kms.IKey;
107
+ /**
108
+ * The length of time that Amazon SQS reuses a data key before calling KMS again.
109
+ *
110
+ * The value must be an integer between 60 (1 minute) and 86,400 (24
111
+ * hours). The default is 300 (5 minutes).
112
+ *
113
+ * @default Duration.minutes(5)
114
+ */
115
+ readonly dataKeyReuse?: Duration;
39
116
  /**
40
117
  * Whether this a first-in-first-out (FIFO) queue.
41
118
  *
42
- * @default false, unless nameSuffix ends in '.fifo' or 'contentBasedDeduplication' is true.
119
+ * @default false, unless queueName ends in '.fifo' or 'contentBasedDeduplication' is true.
43
120
  */
44
121
  readonly fifo?: boolean;
45
122
  /**
@@ -75,201 +152,89 @@ export interface QueueProps extends AwsConstructProps, SqsQueueConfig {
75
152
  * @default FifoThroughputLimit.PER_QUEUE
76
153
  */
77
154
  readonly fifoThroughputLimit?: FifoThroughputLimit;
78
- }
79
- /**
80
- * Outputs which may be registered for output via the Grid.
81
- */
82
- export interface QueueOutputs {
83
155
  /**
84
- * Queue name
156
+ * Policy to apply when the queue is removed from the stack
157
+ *
158
+ * Even though queues are technically stateful, their contents are transient and it
159
+ * is common to add and remove Queues while rearchitecting your application. The
160
+ * default is therefore `DESTROY`. Change it to `RETAIN` if the messages are so
161
+ * valuable that accidentally losing them would be unacceptable.
162
+ *
163
+ * @default RemovalPolicy.DESTROY
85
164
  */
86
- readonly name: string;
87
165
  /**
88
- * Queue arn
166
+ * Enforce encryption of data in transit.
167
+ * @see https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-security-best-practices.html#enforce-encryption-data-in-transit
168
+ *
169
+ * @default false
89
170
  */
90
- readonly arn: string;
171
+ readonly enforceSSL?: boolean;
91
172
  /**
92
- * Queue url
173
+ * The string that includes the parameters for the permissions for the dead-letter queue
174
+ * redrive permission and which source queues can specify dead-letter queues.
175
+ *
176
+ * @default - All source queues can designate this queue as their dead-letter queue.
177
+ *
178
+ * {@link https://registry.terraform.io/providers/hashicorp/aws/5.68.0/docs/resources/sqs_queue#redrive_allow_policy SqsQueue#redrive_allow_policy}
93
179
  */
94
- readonly url: string;
180
+ readonly redriveAllowPolicy?: RedriveAllowPolicy;
95
181
  }
96
182
  /**
97
- * Imported or created Queue attributes
183
+ * A new Amazon SQS queue
98
184
  */
99
- export interface IQueue extends iam.IAwsConstructWithPolicy {
100
- /** Strongly typed outputs */
101
- readonly queueOutputs: QueueOutputs;
102
- /**
103
- * The ARN of this queue
104
- * @attribute
105
- */
106
- readonly queueArn: string;
107
- /**
108
- * The URL of this queue
109
- * @attribute
110
- */
111
- readonly queueUrl: string;
112
- /**
113
- * The name of this queue
114
- * @attribute
115
- */
116
- readonly queueName: string;
185
+ export declare class Queue extends QueueBase {
117
186
  /**
118
- * If this queue is configured with a dead-letter queue, this is the dead-letter queue settings.
187
+ * Uniquely identifies this class.
119
188
  */
120
- readonly deadLetterQueue?: DeadLetterQueue;
189
+ static readonly PROPERTY_INJECTION_ID: string;
121
190
  /**
122
- * Whether this queue is an Amazon SQS FIFO queue. If false, this is a standard queue.
191
+ * Import an existing SQS queue provided an ARN
192
+ *
193
+ * @param scope The parent creating construct
194
+ * @param id The construct's name
195
+ * @param queueArn queue ARN (i.e. arn:aws:sqs:us-east-2:444455556666:queue1)
123
196
  */
124
- readonly fifo: boolean;
197
+ static fromQueueArn(scope: Construct, id: string, queueArn: string): IQueue;
198
+ readonly resource: sqsQueue.SqsQueue;
125
199
  /**
126
- * Grant permissions to consume messages from a queue
127
- *
128
- * This will grant the following permissions:
129
- *
130
- * - sqs:ChangeMessageVisibility
131
- * - sqs:DeleteMessage
132
- * - sqs:ReceiveMessage
133
- * - sqs:GetQueueAttributes
134
- * - sqs:GetQueueUrl
135
- *
136
- * @param grantee Principal to grant consume rights to
200
+ * The ARN of this queue
137
201
  */
138
- grantConsumeMessages(grantee: iam.IGrantable): iam.Grant;
202
+ readonly queueArn: string;
139
203
  /**
140
- * Grant access to send messages to a queue to the given identity.
141
- *
142
- * This will grant the following permissions:
143
- *
144
- * - sqs:SendMessage
145
- * - sqs:GetQueueAttributes
146
- * - sqs:GetQueueUrl
147
- *
148
- * @param grantee Principal to grant send rights to
204
+ * The name of this queue
149
205
  */
150
- grantSendMessages(grantee: iam.IGrantable): iam.Grant;
206
+ readonly queueName: string;
151
207
  /**
152
- * Grant an IAM principal permissions to purge all messages from the queue.
153
- *
154
- * This will grant the following permissions:
155
- *
156
- * - sqs:PurgeQueue
157
- * - sqs:GetQueueAttributes
158
- * - sqs:GetQueueUrl
159
- *
160
- * @param grantee Principal to grant send rights to
208
+ * The URL of this queue
161
209
  */
162
- grantPurge(grantee: iam.IGrantable): iam.Grant;
210
+ readonly queueUrl: string;
163
211
  /**
164
- * Grant the actions defined in queueActions to the identity Principal given
165
- * on this SQS queue resource.
166
- *
167
- * @param grantee Principal to grant right to
168
- * @param queueActions The actions to grant
212
+ * If this queue is encrypted, this is the KMS key.
169
213
  */
170
- grant(grantee: iam.IGrantable, ...queueActions: string[]): iam.Grant;
171
- }
172
- /**
173
- * The `Queue` beacon provides an [AWS SQS Queue](https://aws.amazon.com/sqs/).
174
- *
175
- * ```ts
176
- * new notify.Queue(stack, "Queue", {
177
- * namePrefix: "queue.fifo",
178
- * messageRetentionSeconds: Duration.days(14).toSeconds(),
179
- * visibilityTimeoutSeconds: Duration.minutes(15).toSeconds(),
180
- * });
181
- * ```
182
- *
183
- * @resource aws_sqs_queue
184
- * @beacon-class notify.IQueue
185
- */
186
- export declare class Queue extends AwsConstructBase implements IQueue {
187
- readonly resource: sqsQueue.SqsQueue;
188
- private readonly _outputs;
189
- get queueOutputs(): QueueOutputs;
190
- get outputs(): Record<string, any>;
191
- private policy?;
192
- get queueArn(): string;
193
- get queueUrl(): string;
194
- get queueName(): string;
195
- readonly deadLetterQueue?: DeadLetterQueue;
214
+ readonly encryptionMasterKey?: kms.IKey;
196
215
  /**
197
216
  * Whether this queue is an Amazon SQS FIFO queue. If false, this is a standard queue.
198
217
  */
199
218
  readonly fifo: boolean;
200
- constructor(scope: Construct, name: string, props?: QueueProps);
201
- /**
202
- * Adds a statement to the IAM resource policy associated with this queue.
203
- *
204
- * If this queue was created in this stack (`new Queue`), a queue policy
205
- * will be automatically created upon the first call to `addToPolicy`.
206
- */
207
- addToResourcePolicy(statement: iam.PolicyStatement): iam.AddToResourcePolicyResult;
208
- /**
209
- * Grant permissions to consume messages from a queue
210
- *
211
- * This will grant the following permissions:
212
- *
213
- * - sqs:ChangeMessageVisibility
214
- * - sqs:DeleteMessage
215
- * - sqs:ReceiveMessage
216
- * - sqs:GetQueueAttributes
217
- * - sqs:GetQueueUrl
218
- *
219
- * If encryption is used, permission to use the key to decrypt the contents of the queue will also be granted to the same principal.
220
- *
221
- * This will grant the following KMS permissions:
222
- *
223
- * - kms:Decrypt
224
- *
225
- * @param grantee Principal to grant consume rights to
226
- */
227
- grantConsumeMessages(grantee: iam.IGrantable): iam.Grant;
228
219
  /**
229
- * Grant access to send messages to a queue to the given identity.
230
- *
231
- * This will grant the following permissions:
232
- *
233
- * - sqs:SendMessage
234
- * - sqs:GetQueueAttributes
235
- * - sqs:GetQueueUrl
236
- *
237
- * If encryption is used, permission to use the key to encrypt/decrypt the contents of the queue will also be granted to the same principal.
238
- *
239
- * This will grant the following KMS permissions:
240
- *
241
- * - kms:Decrypt
242
- * - kms:Encrypt
243
- * - kms:ReEncrypt*
244
- * - kms:GenerateDataKey*
245
- *
246
- * @param grantee Principal to grant send rights to
220
+ * Whether the contents of the queue are encrypted, and by what type of key.
247
221
  */
248
- grantSendMessages(grantee: iam.IGrantable): iam.Grant;
222
+ readonly encryptionType?: QueueEncryption;
249
223
  /**
250
- * Grant an IAM principal permissions to purge all messages from the queue.
251
- *
252
- * This will grant the following permissions:
253
- *
254
- * - sqs:PurgeQueue
255
- * - sqs:GetQueueAttributes
256
- * - sqs:GetQueueUrl
257
- *
258
- * @param grantee Principal to grant send rights to
259
- */
260
- grantPurge(grantee: iam.IGrantable): iam.Grant;
261
- /**
262
- * Grant the actions defined in queueActions to the identity Principal given
263
- * on this SQS queue resource.
264
- *
265
- * @param grantee Principal to grant right to
266
- * @param actions The actions to grant
224
+ * If this queue is configured with a dead-letter queue, this is the dead-letter queue settings.
267
225
  */
268
- grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
226
+ readonly deadLetterQueue?: DeadLetterQueue;
227
+ protected readonly autoCreatePolicy = true;
228
+ private readonly physicalName;
229
+ constructor(scope: Construct, id: string, props?: QueueProps);
269
230
  /**
270
231
  * Look at the props, see if the FIFO props agree, and return the correct subset of props
271
232
  */
272
233
  private determineFifoProps;
234
+ /**
235
+ * Adds an iam statement to enforce encryption of data in transit.
236
+ */
237
+ private enforceSSLStatement;
273
238
  }
274
239
  /**
275
240
  * Dead letter queue settings
@@ -310,23 +275,6 @@ export interface RedriveAllowPolicy {
310
275
  */
311
276
  readonly sourceQueues?: IQueue[];
312
277
  }
313
- /**
314
- * The permission type that defines which source queues can specify the current queue as the dead-letter queue
315
- */
316
- export declare enum RedrivePermission {
317
- /**
318
- * Any source queues in this AWS account in the same Region can specify this queue as the dead-letter queue
319
- */
320
- ALLOW_ALL = "allowAll",
321
- /**
322
- * No source queues can specify this queue as the dead-letter queue
323
- */
324
- DENY_ALL = "denyAll",
325
- /**
326
- * Only queues specified by the `sourceQueueArns` parameter can specify this queue as the dead-letter queue
327
- */
328
- BY_QUEUE = "byQueue"
329
- }
330
278
  /**
331
279
  * What kind of deduplication scope to apply
332
280
  */
@@ -353,3 +301,22 @@ export declare enum FifoThroughputLimit {
353
301
  */
354
302
  PER_MESSAGE_GROUP_ID = "perMessageGroupId"
355
303
  }
304
+ /**
305
+ * The permission type that defines which source queues can specify the current queue as the dead-letter queue
306
+ */
307
+ export declare enum RedrivePermission {
308
+ /**
309
+ * Any source queues in this AWS account in the same Region can specify this queue as the dead-letter queue
310
+ */
311
+ ALLOW_ALL = "allowAll",
312
+ /**
313
+ * No source queues can specify this queue as the dead-letter queue
314
+ */
315
+ DENY_ALL = "denyAll",
316
+ /**
317
+ * Only queues specified by the `sourceQueueArns` parameter can specify this queue as the dead-letter queue
318
+ */
319
+ BY_QUEUE = "byQueue"
320
+ }
321
+ export declare function validateQueueProps(scope: Construct, props: QueueProps): void;
322
+ export declare function validateRedriveAllowPolicy(scope: Construct, policy: RedriveAllowPolicy): void;