Skip to content

Commit bcc1216

Browse files
feat(aws-sns-sqs): added sqsSubscriptionProps (#700)
* added sqsSubscriptionProps * add encryption key to dlq Co-authored-by: biffgaut <[email protected]>
1 parent d6c315c commit bcc1216

File tree

5 files changed

+712
-2
lines changed

5 files changed

+712
-2
lines changed

source/patterns/@aws-solutions-constructs/aws-sns-sqs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ constructStack.getEncryptionKey().addToResourcePolicy(policyStatement);
107107
|enableEncryptionWithCustomerManagedKey?|`boolean`|Use a KMS Key, either managed by this CDK app, or imported. If importing an encryption key, it must be specified in the encryptionKey property for this construct.|
108108
|encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kms.Key.html)|An optional, imported encryption key to encrypt the SQS queue, and SNS Topic.|
109109
|encryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kms.KeyProps.html)|An optional, user provided properties to override the default properties for the KMS encryption key.|
110+
|sqsSubscriptionProps?|[`subscriptions.SqsSubscriptionProps`](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-sns-subscriptions.SqsSubscriptionProps.html)|Optional user-provided props to override the default props for sqsSubscriptionProps.|
110111

111112
## Pattern Properties
112113

source/patterns/@aws-solutions-constructs/aws-sns-sqs/lib/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ export interface SnsToSqsProps {
8787
* @default - Default props are used.
8888
*/
8989
readonly encryptionKeyProps?: kms.KeyProps
90+
/**
91+
* Optional user-provided props to override the default props for sqsSubscriptionProps.
92+
*
93+
* @default - Default props are used.
94+
*/
95+
readonly sqsSubscriptionProps?: subscriptions.SqsSubscriptionProps
9096
}
9197

9298
/**
@@ -152,7 +158,7 @@ export class SnsToSqs extends Construct {
152158
});
153159

154160
// Setup the SQS queue subscription to the SNS topic
155-
this.snsTopic.addSubscription(new subscriptions.SqsSubscription(this.sqsQueue));
161+
this.snsTopic.addSubscription(new subscriptions.SqsSubscription(this.sqsQueue, props.sqsSubscriptionProps));
156162

157163
// Grant SNS service access to the SQS queue encryption key
158164
if (this.sqsQueue.encryptionMasterKey) {

0 commit comments

Comments
 (0)