Package: aws-solutions-constructs.aws-sns-sqs
aws-sns-sqs module---All classes are under active development and subject to non-backward compatible changes or removal in any
future version. These are not subject to theSemantic Versioningmodel.
This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/LanguagePackagePythonaws_solutions_constructs.aws_sns_sqsTypescript@aws-solutions-constructs/aws-sns-sqsJavasoftware.amazon.awsconstructs.services.snssqsOverviewThis AWS Solutions Construct implements an Amazon SNS topic connected to an Amazon SQS queue.Here is a minimal deployable pattern definition:Typescriptimport{Construct}from'constructs';import{Stack,StackProps}from'aws-cdk-lib';import{SnsToSqs,SnsToSqsProps}from"@aws-solutions-constructs/aws-sns-sqs";import*asiamfrom'aws-cdk-lib/aws-iam';constsnsToSqsStack=newSnsToSqs(this,'SnsToSqsPattern',{});//GrantyourselfpermissionstousetheCustomerManagedKMSKeyconstpolicyStatement=newiam.PolicyStatement({actions:["kms:Encrypt","kms:Decrypt"],effect:iam.Effect.ALLOW,principals:[newiam.AccountRootPrincipal()],resources:["*"]});snsToSqsStack.encryptionKey?.addToResourcePolicy(policyStatement);Pythonfromaws_solutions_constructs.aws_sns_sqsimportSnsToSqsfromaws_cdkimport(aws_iamasiam,Stack)fromconstructsimportConstructconstruct_stack=SnsToSqs(self,'SnsToSqsPattern')policy_statement=iam.PolicyStatement(actions=["kms:Encrypt","kms:Decrypt"],effect=iam.Effect.ALLOW,principals=[iam.AccountRootPrincipal()],resources=["*"])construct_stack.encryption_key.add_to_resource_policy(policy_statement)Javaimportsoftware.constructs.Construct;importjava.util.List;importsoftware.amazon.awscdk.Stack;importsoftware.amazon.awscdk.StackProps;importsoftware.amazon.awscdk.services.iam.*;importsoftware.amazon.awsconstructs.services.snssqs.*;finalSnsToSqsconstructStack=newSnsToSqs(this,"SnsToSqsPattern",newSnsToSqsProps.Builder().build());// Grant yourself permissions to use the Customer Managed KMS KeyfinalPolicyStatementpolicyStatement=PolicyStatement.Builder.create().actions(List.of("kms:Encrypt","kms:Decrypt")).effect(Effect.ALLOW).principals(List.of(newAccountRootPrincipal())).resources(List.of("*")).build();constructStack.getEncryptionKey().addToResourcePolicy(policyStatement);Pattern Construct PropsNameTypeDescriptionexistingTopicObj?sns.TopicAn optional, existing SNS topic to be used instead of the default topic. Providing both this andtopicPropswill cause an error.topicProps?sns.TopicPropsOptional user provided properties to override the default properties for the SNS topic.existingQueueObj?sqs.QueueAn optional, existing SQS queue to be used instead of the default queue. Providing both this andqueuePropswill cause an error.queueProps?sqs.QueuePropsOptional user provided properties to override the default properties for the SQS queue.deployDeadLetterQueue?booleanWhether to create a secondary queue to be used as a dead letter queue. Defaults to true.deadLetterQueueProps?sqs.QueuePropsOptional user-provided props to override the default props for the dead letter SQS queue.maxReceiveCount?numberThe number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to 15.enableEncryptionWithCustomerManagedKey?booleanIf no key is provided, this flag determines whether the queue is encrypted with a new CMK or an AWS managed key. This flag is ignored if any of the following are defined: topicProps.masterKey, queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps.encryptionKey?kms.KeyAn optional, imported encryption key to encrypt the SQS Queue and SNS Topic with.encryptionKeyProps?kms.KeyPropsOptional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with.sqsSubscriptionProps?subscriptions.SqsSubscriptionPropsOptional user-provided props to override the default props for sqsSubscriptionProps.Pattern PropertiesNameTypeDescriptionsnsTopicsns.TopicReturns an instance of the SNS topic created by the pattern.encryptionKeykms.KeyReturns an instance of kms.Key used for the SQS queue, and SNS Topic.sqsQueuesqs.QueueReturns an instance of the SQS queue created by the pattern.deadLetterQueue?sqs.QueueReturns an instance of the dead-letter SQS queue created by the pattern.Default settingsOut of the box implementation of the Construct without any override will set the following defaults:Amazon SNS TopicConfigure least privilege access permissions for SNS TopicEnable server-side encryption for SNS Topic using Customer managed KMS KeyEnforce encryption of data in transitAmazon SQS QueueConfigure least privilege access permissions for SQS QueueDeploy SQS dead-letter queue for the source SQS QueueEnable server-side encryption for SQS Queue using Customer managed KMS KeyEnforce encryption of data in transitArchitecture© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.