aws-solutions-constructs.aws-eventbridge-sqs 2.85.1__tar.gz → 2.85.3__tar.gz

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 (20) hide show
  1. aws_solutions_constructs_aws_eventbridge_sqs-2.85.3/PKG-INFO +28 -0
  2. aws_solutions_constructs_aws_eventbridge_sqs-2.85.3/README.md +1 -0
  3. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/setup.py +3 -3
  4. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/src/aws_solutions_constructs/aws_eventbridge_sqs/__init__.py +1 -169
  5. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/src/aws_solutions_constructs/aws_eventbridge_sqs/_jsii/__init__.py +2 -2
  6. aws_solutions_constructs_aws_eventbridge_sqs-2.85.3/src/aws_solutions_constructs/aws_eventbridge_sqs/_jsii/aws-eventbridge-sqs@2.85.3.jsii.tgz +0 -0
  7. aws_solutions_constructs_aws_eventbridge_sqs-2.85.3/src/aws_solutions_constructs.aws_eventbridge_sqs.egg-info/PKG-INFO +28 -0
  8. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/src/aws_solutions_constructs.aws_eventbridge_sqs.egg-info/SOURCES.txt +1 -1
  9. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/src/aws_solutions_constructs.aws_eventbridge_sqs.egg-info/requires.txt +1 -1
  10. aws_solutions_constructs_aws_eventbridge_sqs-2.85.1/PKG-INFO +0 -196
  11. aws_solutions_constructs_aws_eventbridge_sqs-2.85.1/README.md +0 -169
  12. aws_solutions_constructs_aws_eventbridge_sqs-2.85.1/src/aws_solutions_constructs/aws_eventbridge_sqs/_jsii/aws-eventbridge-sqs@2.85.1.jsii.tgz +0 -0
  13. aws_solutions_constructs_aws_eventbridge_sqs-2.85.1/src/aws_solutions_constructs.aws_eventbridge_sqs.egg-info/PKG-INFO +0 -196
  14. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/LICENSE +0 -0
  15. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/MANIFEST.in +0 -0
  16. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/pyproject.toml +0 -0
  17. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/setup.cfg +0 -0
  18. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/src/aws_solutions_constructs/aws_eventbridge_sqs/py.typed +0 -0
  19. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/src/aws_solutions_constructs.aws_eventbridge_sqs.egg-info/dependency_links.txt +0 -0
  20. {aws_solutions_constructs_aws_eventbridge_sqs-2.85.1 → aws_solutions_constructs_aws_eventbridge_sqs-2.85.3}/src/aws_solutions_constructs.aws_eventbridge_sqs.egg-info/top_level.txt +0 -0
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.1
2
+ Name: aws-solutions-constructs.aws-eventbridge-sqs
3
+ Version: 2.85.3
4
+ Summary: CDK Constructs for deploying AWS Eventbridge that invokes AWS SQS
5
+ Home-page: https://github.com/awslabs/aws-solutions-constructs.git
6
+ Author: Amazon Web Services
7
+ License: Apache-2.0
8
+ Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.git
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: JavaScript
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Typing :: Typed
17
+ Classifier: License :: OSI Approved
18
+ Requires-Python: ~=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: aws-cdk-lib<3.0.0,>=2.193.0
22
+ Requires-Dist: aws-solutions-constructs.core==2.85.3
23
+ Requires-Dist: constructs<11.0.0,>=10.0.0
24
+ Requires-Dist: jsii<2.0.0,>=1.111.0
25
+ Requires-Dist: publication>=0.0.3
26
+ Requires-Dist: typeguard<4.3.0,>=2.13.3
27
+
28
+ Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-eventbridge-sqs/README.adoc)
@@ -0,0 +1 @@
1
+ Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-eventbridge-sqs/README.adoc)
@@ -5,7 +5,7 @@ kwargs = json.loads(
5
5
  """
6
6
  {
7
7
  "name": "aws-solutions-constructs.aws-eventbridge-sqs",
8
- "version": "2.85.1",
8
+ "version": "2.85.3",
9
9
  "description": "CDK Constructs for deploying AWS Eventbridge that invokes AWS SQS",
10
10
  "license": "Apache-2.0",
11
11
  "url": "https://github.com/awslabs/aws-solutions-constructs.git",
@@ -26,7 +26,7 @@ kwargs = json.loads(
26
26
  ],
27
27
  "package_data": {
28
28
  "aws_solutions_constructs.aws_eventbridge_sqs._jsii": [
29
- "aws-eventbridge-sqs@2.85.1.jsii.tgz"
29
+ "aws-eventbridge-sqs@2.85.3.jsii.tgz"
30
30
  ],
31
31
  "aws_solutions_constructs.aws_eventbridge_sqs": [
32
32
  "py.typed"
@@ -35,7 +35,7 @@ kwargs = json.loads(
35
35
  "python_requires": "~=3.9",
36
36
  "install_requires": [
37
37
  "aws-cdk-lib>=2.193.0, <3.0.0",
38
- "aws-solutions-constructs.core==2.85.1",
38
+ "aws-solutions-constructs.core==2.85.3",
39
39
  "constructs>=10.0.0, <11.0.0",
40
40
  "jsii>=1.111.0, <2.0.0",
41
41
  "publication>=0.0.3",
@@ -1,173 +1,5 @@
1
1
  r'''
2
- # aws-eventbridge-sqs module
3
-
4
- <!--BEGIN STABILITY BANNER-->---
5
-
6
-
7
- ![Stability: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
8
-
9
- ---
10
- <!--END STABILITY BANNER-->
11
-
12
- | **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
13
- |:-------------|:-------------|
14
-
15
- <div style="height:8px"></div>
16
-
17
- | **Language** | **Package** |
18
- |:-------------|-----------------|
19
- |![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_eventbridge_sqs`|
20
- |![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-eventbridge-sqs`|
21
- |![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.eventbridgesqs`|
22
-
23
- ## Overview
24
-
25
- This AWS Solutions Construct implements an Amazon EventBridge rule and an AWS SQS Queue.
26
-
27
- Here is a minimal deployable pattern definition:
28
-
29
- Typescript
30
-
31
- ```python
32
- import { Construct } from 'constructs';
33
- import { Stack, StackProps, Duration } from 'aws-cdk-lib';
34
- import * as events from 'aws-cdk-lib/aws-events';
35
- import * as iam from 'aws-cdk-lib/aws-iam';
36
- import { EventbridgeToSqsProps, EventbridgeToSqs } from "@aws-solutions-constructs/aws-eventbridge-sqs";
37
-
38
- const constructProps: EventbridgeToSqsProps = {
39
- eventRuleProps: {
40
- schedule: events.Schedule.rate(Duration.minutes(5))
41
- }
42
- };
43
-
44
- const constructStack = new EventbridgeToSqs(this, 'test-construct', constructProps);
45
-
46
- // Grant yourself permissions to use the Customer Managed KMS Key
47
- const policyStatement = new iam.PolicyStatement({
48
- actions: ["kms:Encrypt", "kms:Decrypt"],
49
- effect: iam.Effect.ALLOW,
50
- principals: [new iam.AccountRootPrincipal()],
51
- resources: ["*"]
52
- });
53
-
54
- constructStack.encryptionKey?.addToResourcePolicy(policyStatement);
55
- ```
56
-
57
- Python
58
-
59
- ```Python
60
- from aws_solutions_constructs.aws_eventbridge_sqs import EventbridgeToSqsProps, EventbridgeToSqs
61
- from aws_cdk import (
62
- aws_events as events,
63
- aws_iam as iam,
64
- Duration,
65
- Stack
66
- )
67
- from constructs import Construct
68
-
69
- construct_stack = EventbridgeToSqs(self, 'test-construct',
70
- event_rule_props=events.RuleProps(
71
- schedule=events.Schedule.rate(
72
- Duration.minutes(5))
73
- ))
74
-
75
- # Grant yourself permissions to use the Customer Managed KMS Key
76
- policy_statement = iam.PolicyStatement(
77
- actions=["kms:Encrypt", "kms:Decrypt"],
78
- effect=iam.Effect.ALLOW,
79
- principals=[iam.AccountRootPrincipal()],
80
- resources=["*"]
81
- )
82
-
83
- construct_stack.encryption_key.add_to_resource_policy(policy_statement)
84
- ```
85
-
86
- Java
87
-
88
- ```java
89
- import software.constructs.Construct;
90
- import java.util.List;
91
-
92
- import software.amazon.awscdk.Stack;
93
- import software.amazon.awscdk.StackProps;
94
- import software.amazon.awscdk.Duration;
95
- import software.amazon.awscdk.services.events.*;
96
- import software.amazon.awscdk.services.iam.*;
97
- import software.amazon.awsconstructs.services.eventbridgesqs.*;
98
-
99
- final EventbridgeToSqs constructStack = new EventbridgeToSqs(this, "test-construct",
100
- new EventbridgeToSqsProps.Builder()
101
- .eventRuleProps(new RuleProps.Builder()
102
- .schedule(Schedule.rate(Duration.minutes(5)))
103
- .build())
104
- .build());
105
-
106
- // Grant yourself permissions to use the Customer Managed KMS Key
107
- final PolicyStatement policyStatement = PolicyStatement.Builder.create()
108
- .actions(List.of("kms:Encrypt", "kms:Decrypt"))
109
- .effect(Effect.ALLOW)
110
- .principals(List.of(new AccountRootPrincipal()))
111
- .resources(List.of("*"))
112
- .build();
113
-
114
- constructStack.getEncryptionKey().addToResourcePolicy(policyStatement);
115
- ```
116
-
117
- ## Pattern Construct Props
118
-
119
- | **Name** | **Type** | **Description** |
120
- |:-------------|:----------------|-----------------|
121
- |existingEventBusInterface?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IEventBus.html)| Optional user-provided custom EventBus for construct to use. Providing both this and `eventBusProps` results an error.|
122
- |eventBusProps?|[`events.EventBusProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.EventBusProps.html)|Optional user-provided properties to override the default properties when creating a custom EventBus. Setting this value to `{}` will create a custom EventBus using all default properties. If neither this nor `existingEventBusInterface` is provided the construct will use the `default` EventBus. Providing both this and `existingEventBusInterface` results an error.|
123
- |eventRuleProps|[`events.RuleProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.RuleProps.html)|User provided eventRuleProps to override the defaults. |
124
- |targetProps?|[`eventtargets.SqsQueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets.SqsQueueProps.html)|Optional user provided properties to define the SQS target on the Event Rule. If you specify a deadLetterQueue for the rule here, you are responsible for adding a resource policy to the queue allowing events.amazonaws.com permission to SendMessage, GetQueueUrl and GetQueueAttributes. You cannot send a DLQ in this property and set deployEventRuleDlq to true. Default is undefined and all system defaults are used.|
125
- |eventRuleDlqKeyProps|[kms.KeyProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.KeyProps.html)|Optional properties to define the key created to protect the ruleDlq. Only valid if deployRuleDlq is set to true. Defaults to CloudFormation defaults.|
126
- | deployEventRuleDlq?|boolean|Whether to deploy a DLQ for the Event Rule. If set to `true`, this DLQ will receive any messages that can't be delivered to the target SQS queue. Defaults to `false`.|
127
- |existingQueueObj?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|An optional, existing SQS queue to be used instead of the default queue. Providing both this and `queueProps` will cause an error.|
128
- |queueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|User provided props to override the default props for the SQS Queue. |
129
- |enableQueuePurging?|`boolean`|Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. Defaults to `false`.|
130
- |deployDeadLetterQueue?|`boolean`|Whether to create a secondary queue to be used as a dead letter queue. Defaults to `true`.|
131
- |deadLetterQueueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter queue. Only used if the `deployDeadLetterQueue` property is set to true.|
132
- |maxReceiveCount?|`number`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to `15`.|
133
- |enableEncryptionWithCustomerManagedKey?|`boolean`|If 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: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps.|
134
- |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|An optional, imported encryption key to encrypt the SQS Queue with.|
135
- |encryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html#construct-props)|Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with.|
136
-
137
- ## Pattern Properties
138
-
139
- | **Name** | **Type** | **Description** |
140
- |:-------------|:----------------|-----------------|
141
- |eventBus?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IEventBus.html)|Returns the instance of events.IEventBus used by the construct|
142
- |eventsRule|[`events.Rule`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.Rule.html)|Returns an instance of events.Rule created by the construct|
143
- |eventRuleDlq?|`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|If the client sets deployEventRuleDlq to 'true', then this value will contain the DLQ set up for the rule.|
144
- |eventRuleDlqKey|[kms.IKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html)|The key created to encrypt the eventRuleDlq.|
145
- |sqsQueue|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of sqs.Queue created by the construct|
146
- |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|Returns an instance of kms Key used for the SQS queue.|
147
- |deadLetterQueue?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of the dead-letter SQS queue created by the pattern.|
148
-
149
- ## Default settings
150
-
151
- Out of the box implementation of the Construct without any override will set the following defaults:
152
-
153
- ### Amazon EventBridge Rule
154
-
155
- * Grant least privilege permissions to EventBridge rule to publish to the SQS Queue.
156
-
157
- ### Amazon SQS Queue
158
-
159
- * Deploy SQS dead-letter queue for the source SQS Queue.
160
- * Enable server-side encryption for source SQS Queue using Customer managed KMS Key.
161
- * Enforce encryption of data in transit.
162
-
163
- ## Architecture
164
-
165
- ![Architecture Diagram](architecture.png)
166
-
167
- ---
168
-
169
-
170
- © Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-eventbridge-sqs/README.adoc)
171
3
  '''
172
4
  from pkgutil import extend_path
173
5
  __path__ = extend_path(__path__, __name__)
@@ -34,9 +34,9 @@ import constructs._jsii
34
34
 
35
35
  __jsii_assembly__ = jsii.JSIIAssembly.load(
36
36
  "@aws-solutions-constructs/aws-eventbridge-sqs",
37
- "2.85.1",
37
+ "2.85.3",
38
38
  __name__[0:-6],
39
- "aws-eventbridge-sqs@2.85.1.jsii.tgz",
39
+ "aws-eventbridge-sqs@2.85.3.jsii.tgz",
40
40
  )
41
41
 
42
42
  __all__ = [
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.1
2
+ Name: aws-solutions-constructs.aws-eventbridge-sqs
3
+ Version: 2.85.3
4
+ Summary: CDK Constructs for deploying AWS Eventbridge that invokes AWS SQS
5
+ Home-page: https://github.com/awslabs/aws-solutions-constructs.git
6
+ Author: Amazon Web Services
7
+ License: Apache-2.0
8
+ Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.git
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: JavaScript
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Typing :: Typed
17
+ Classifier: License :: OSI Approved
18
+ Requires-Python: ~=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: aws-cdk-lib<3.0.0,>=2.193.0
22
+ Requires-Dist: aws-solutions-constructs.core==2.85.3
23
+ Requires-Dist: constructs<11.0.0,>=10.0.0
24
+ Requires-Dist: jsii<2.0.0,>=1.111.0
25
+ Requires-Dist: publication>=0.0.3
26
+ Requires-Dist: typeguard<4.3.0,>=2.13.3
27
+
28
+ Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-eventbridge-sqs/README.adoc)
@@ -11,4 +11,4 @@ src/aws_solutions_constructs.aws_eventbridge_sqs.egg-info/top_level.txt
11
11
  src/aws_solutions_constructs/aws_eventbridge_sqs/__init__.py
12
12
  src/aws_solutions_constructs/aws_eventbridge_sqs/py.typed
13
13
  src/aws_solutions_constructs/aws_eventbridge_sqs/_jsii/__init__.py
14
- src/aws_solutions_constructs/aws_eventbridge_sqs/_jsii/aws-eventbridge-sqs@2.85.1.jsii.tgz
14
+ src/aws_solutions_constructs/aws_eventbridge_sqs/_jsii/aws-eventbridge-sqs@2.85.3.jsii.tgz
@@ -1,5 +1,5 @@
1
1
  aws-cdk-lib<3.0.0,>=2.193.0
2
- aws-solutions-constructs.core==2.85.1
2
+ aws-solutions-constructs.core==2.85.3
3
3
  constructs<11.0.0,>=10.0.0
4
4
  jsii<2.0.0,>=1.111.0
5
5
  publication>=0.0.3
@@ -1,196 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: aws-solutions-constructs.aws-eventbridge-sqs
3
- Version: 2.85.1
4
- Summary: CDK Constructs for deploying AWS Eventbridge that invokes AWS SQS
5
- Home-page: https://github.com/awslabs/aws-solutions-constructs.git
6
- Author: Amazon Web Services
7
- License: Apache-2.0
8
- Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.git
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: JavaScript
12
- Classifier: Programming Language :: Python :: 3 :: Only
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Typing :: Typed
17
- Classifier: License :: OSI Approved
18
- Requires-Python: ~=3.9
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: aws-cdk-lib<3.0.0,>=2.193.0
22
- Requires-Dist: aws-solutions-constructs.core==2.85.1
23
- Requires-Dist: constructs<11.0.0,>=10.0.0
24
- Requires-Dist: jsii<2.0.0,>=1.111.0
25
- Requires-Dist: publication>=0.0.3
26
- Requires-Dist: typeguard<4.3.0,>=2.13.3
27
-
28
- # aws-eventbridge-sqs module
29
-
30
- <!--BEGIN STABILITY BANNER-->---
31
-
32
-
33
- ![Stability: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
34
-
35
- ---
36
- <!--END STABILITY BANNER-->
37
-
38
- | **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
39
- |:-------------|:-------------|
40
-
41
- <div style="height:8px"></div>
42
-
43
- | **Language** | **Package** |
44
- |:-------------|-----------------|
45
- |![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_eventbridge_sqs`|
46
- |![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-eventbridge-sqs`|
47
- |![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.eventbridgesqs`|
48
-
49
- ## Overview
50
-
51
- This AWS Solutions Construct implements an Amazon EventBridge rule and an AWS SQS Queue.
52
-
53
- Here is a minimal deployable pattern definition:
54
-
55
- Typescript
56
-
57
- ```python
58
- import { Construct } from 'constructs';
59
- import { Stack, StackProps, Duration } from 'aws-cdk-lib';
60
- import * as events from 'aws-cdk-lib/aws-events';
61
- import * as iam from 'aws-cdk-lib/aws-iam';
62
- import { EventbridgeToSqsProps, EventbridgeToSqs } from "@aws-solutions-constructs/aws-eventbridge-sqs";
63
-
64
- const constructProps: EventbridgeToSqsProps = {
65
- eventRuleProps: {
66
- schedule: events.Schedule.rate(Duration.minutes(5))
67
- }
68
- };
69
-
70
- const constructStack = new EventbridgeToSqs(this, 'test-construct', constructProps);
71
-
72
- // Grant yourself permissions to use the Customer Managed KMS Key
73
- const policyStatement = new iam.PolicyStatement({
74
- actions: ["kms:Encrypt", "kms:Decrypt"],
75
- effect: iam.Effect.ALLOW,
76
- principals: [new iam.AccountRootPrincipal()],
77
- resources: ["*"]
78
- });
79
-
80
- constructStack.encryptionKey?.addToResourcePolicy(policyStatement);
81
- ```
82
-
83
- Python
84
-
85
- ```Python
86
- from aws_solutions_constructs.aws_eventbridge_sqs import EventbridgeToSqsProps, EventbridgeToSqs
87
- from aws_cdk import (
88
- aws_events as events,
89
- aws_iam as iam,
90
- Duration,
91
- Stack
92
- )
93
- from constructs import Construct
94
-
95
- construct_stack = EventbridgeToSqs(self, 'test-construct',
96
- event_rule_props=events.RuleProps(
97
- schedule=events.Schedule.rate(
98
- Duration.minutes(5))
99
- ))
100
-
101
- # Grant yourself permissions to use the Customer Managed KMS Key
102
- policy_statement = iam.PolicyStatement(
103
- actions=["kms:Encrypt", "kms:Decrypt"],
104
- effect=iam.Effect.ALLOW,
105
- principals=[iam.AccountRootPrincipal()],
106
- resources=["*"]
107
- )
108
-
109
- construct_stack.encryption_key.add_to_resource_policy(policy_statement)
110
- ```
111
-
112
- Java
113
-
114
- ```java
115
- import software.constructs.Construct;
116
- import java.util.List;
117
-
118
- import software.amazon.awscdk.Stack;
119
- import software.amazon.awscdk.StackProps;
120
- import software.amazon.awscdk.Duration;
121
- import software.amazon.awscdk.services.events.*;
122
- import software.amazon.awscdk.services.iam.*;
123
- import software.amazon.awsconstructs.services.eventbridgesqs.*;
124
-
125
- final EventbridgeToSqs constructStack = new EventbridgeToSqs(this, "test-construct",
126
- new EventbridgeToSqsProps.Builder()
127
- .eventRuleProps(new RuleProps.Builder()
128
- .schedule(Schedule.rate(Duration.minutes(5)))
129
- .build())
130
- .build());
131
-
132
- // Grant yourself permissions to use the Customer Managed KMS Key
133
- final PolicyStatement policyStatement = PolicyStatement.Builder.create()
134
- .actions(List.of("kms:Encrypt", "kms:Decrypt"))
135
- .effect(Effect.ALLOW)
136
- .principals(List.of(new AccountRootPrincipal()))
137
- .resources(List.of("*"))
138
- .build();
139
-
140
- constructStack.getEncryptionKey().addToResourcePolicy(policyStatement);
141
- ```
142
-
143
- ## Pattern Construct Props
144
-
145
- | **Name** | **Type** | **Description** |
146
- |:-------------|:----------------|-----------------|
147
- |existingEventBusInterface?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IEventBus.html)| Optional user-provided custom EventBus for construct to use. Providing both this and `eventBusProps` results an error.|
148
- |eventBusProps?|[`events.EventBusProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.EventBusProps.html)|Optional user-provided properties to override the default properties when creating a custom EventBus. Setting this value to `{}` will create a custom EventBus using all default properties. If neither this nor `existingEventBusInterface` is provided the construct will use the `default` EventBus. Providing both this and `existingEventBusInterface` results an error.|
149
- |eventRuleProps|[`events.RuleProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.RuleProps.html)|User provided eventRuleProps to override the defaults. |
150
- |targetProps?|[`eventtargets.SqsQueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets.SqsQueueProps.html)|Optional user provided properties to define the SQS target on the Event Rule. If you specify a deadLetterQueue for the rule here, you are responsible for adding a resource policy to the queue allowing events.amazonaws.com permission to SendMessage, GetQueueUrl and GetQueueAttributes. You cannot send a DLQ in this property and set deployEventRuleDlq to true. Default is undefined and all system defaults are used.|
151
- |eventRuleDlqKeyProps|[kms.KeyProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.KeyProps.html)|Optional properties to define the key created to protect the ruleDlq. Only valid if deployRuleDlq is set to true. Defaults to CloudFormation defaults.|
152
- | deployEventRuleDlq?|boolean|Whether to deploy a DLQ for the Event Rule. If set to `true`, this DLQ will receive any messages that can't be delivered to the target SQS queue. Defaults to `false`.|
153
- |existingQueueObj?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|An optional, existing SQS queue to be used instead of the default queue. Providing both this and `queueProps` will cause an error.|
154
- |queueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|User provided props to override the default props for the SQS Queue. |
155
- |enableQueuePurging?|`boolean`|Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. Defaults to `false`.|
156
- |deployDeadLetterQueue?|`boolean`|Whether to create a secondary queue to be used as a dead letter queue. Defaults to `true`.|
157
- |deadLetterQueueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter queue. Only used if the `deployDeadLetterQueue` property is set to true.|
158
- |maxReceiveCount?|`number`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to `15`.|
159
- |enableEncryptionWithCustomerManagedKey?|`boolean`|If 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: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps.|
160
- |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|An optional, imported encryption key to encrypt the SQS Queue with.|
161
- |encryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html#construct-props)|Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with.|
162
-
163
- ## Pattern Properties
164
-
165
- | **Name** | **Type** | **Description** |
166
- |:-------------|:----------------|-----------------|
167
- |eventBus?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IEventBus.html)|Returns the instance of events.IEventBus used by the construct|
168
- |eventsRule|[`events.Rule`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.Rule.html)|Returns an instance of events.Rule created by the construct|
169
- |eventRuleDlq?|`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|If the client sets deployEventRuleDlq to 'true', then this value will contain the DLQ set up for the rule.|
170
- |eventRuleDlqKey|[kms.IKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html)|The key created to encrypt the eventRuleDlq.|
171
- |sqsQueue|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of sqs.Queue created by the construct|
172
- |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|Returns an instance of kms Key used for the SQS queue.|
173
- |deadLetterQueue?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of the dead-letter SQS queue created by the pattern.|
174
-
175
- ## Default settings
176
-
177
- Out of the box implementation of the Construct without any override will set the following defaults:
178
-
179
- ### Amazon EventBridge Rule
180
-
181
- * Grant least privilege permissions to EventBridge rule to publish to the SQS Queue.
182
-
183
- ### Amazon SQS Queue
184
-
185
- * Deploy SQS dead-letter queue for the source SQS Queue.
186
- * Enable server-side encryption for source SQS Queue using Customer managed KMS Key.
187
- * Enforce encryption of data in transit.
188
-
189
- ## Architecture
190
-
191
- ![Architecture Diagram](architecture.png)
192
-
193
- ---
194
-
195
-
196
- © Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -1,169 +0,0 @@
1
- # aws-eventbridge-sqs module
2
-
3
- <!--BEGIN STABILITY BANNER-->---
4
-
5
-
6
- ![Stability: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
7
-
8
- ---
9
- <!--END STABILITY BANNER-->
10
-
11
- | **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
12
- |:-------------|:-------------|
13
-
14
- <div style="height:8px"></div>
15
-
16
- | **Language** | **Package** |
17
- |:-------------|-----------------|
18
- |![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_eventbridge_sqs`|
19
- |![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-eventbridge-sqs`|
20
- |![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.eventbridgesqs`|
21
-
22
- ## Overview
23
-
24
- This AWS Solutions Construct implements an Amazon EventBridge rule and an AWS SQS Queue.
25
-
26
- Here is a minimal deployable pattern definition:
27
-
28
- Typescript
29
-
30
- ```python
31
- import { Construct } from 'constructs';
32
- import { Stack, StackProps, Duration } from 'aws-cdk-lib';
33
- import * as events from 'aws-cdk-lib/aws-events';
34
- import * as iam from 'aws-cdk-lib/aws-iam';
35
- import { EventbridgeToSqsProps, EventbridgeToSqs } from "@aws-solutions-constructs/aws-eventbridge-sqs";
36
-
37
- const constructProps: EventbridgeToSqsProps = {
38
- eventRuleProps: {
39
- schedule: events.Schedule.rate(Duration.minutes(5))
40
- }
41
- };
42
-
43
- const constructStack = new EventbridgeToSqs(this, 'test-construct', constructProps);
44
-
45
- // Grant yourself permissions to use the Customer Managed KMS Key
46
- const policyStatement = new iam.PolicyStatement({
47
- actions: ["kms:Encrypt", "kms:Decrypt"],
48
- effect: iam.Effect.ALLOW,
49
- principals: [new iam.AccountRootPrincipal()],
50
- resources: ["*"]
51
- });
52
-
53
- constructStack.encryptionKey?.addToResourcePolicy(policyStatement);
54
- ```
55
-
56
- Python
57
-
58
- ```Python
59
- from aws_solutions_constructs.aws_eventbridge_sqs import EventbridgeToSqsProps, EventbridgeToSqs
60
- from aws_cdk import (
61
- aws_events as events,
62
- aws_iam as iam,
63
- Duration,
64
- Stack
65
- )
66
- from constructs import Construct
67
-
68
- construct_stack = EventbridgeToSqs(self, 'test-construct',
69
- event_rule_props=events.RuleProps(
70
- schedule=events.Schedule.rate(
71
- Duration.minutes(5))
72
- ))
73
-
74
- # Grant yourself permissions to use the Customer Managed KMS Key
75
- policy_statement = iam.PolicyStatement(
76
- actions=["kms:Encrypt", "kms:Decrypt"],
77
- effect=iam.Effect.ALLOW,
78
- principals=[iam.AccountRootPrincipal()],
79
- resources=["*"]
80
- )
81
-
82
- construct_stack.encryption_key.add_to_resource_policy(policy_statement)
83
- ```
84
-
85
- Java
86
-
87
- ```java
88
- import software.constructs.Construct;
89
- import java.util.List;
90
-
91
- import software.amazon.awscdk.Stack;
92
- import software.amazon.awscdk.StackProps;
93
- import software.amazon.awscdk.Duration;
94
- import software.amazon.awscdk.services.events.*;
95
- import software.amazon.awscdk.services.iam.*;
96
- import software.amazon.awsconstructs.services.eventbridgesqs.*;
97
-
98
- final EventbridgeToSqs constructStack = new EventbridgeToSqs(this, "test-construct",
99
- new EventbridgeToSqsProps.Builder()
100
- .eventRuleProps(new RuleProps.Builder()
101
- .schedule(Schedule.rate(Duration.minutes(5)))
102
- .build())
103
- .build());
104
-
105
- // Grant yourself permissions to use the Customer Managed KMS Key
106
- final PolicyStatement policyStatement = PolicyStatement.Builder.create()
107
- .actions(List.of("kms:Encrypt", "kms:Decrypt"))
108
- .effect(Effect.ALLOW)
109
- .principals(List.of(new AccountRootPrincipal()))
110
- .resources(List.of("*"))
111
- .build();
112
-
113
- constructStack.getEncryptionKey().addToResourcePolicy(policyStatement);
114
- ```
115
-
116
- ## Pattern Construct Props
117
-
118
- | **Name** | **Type** | **Description** |
119
- |:-------------|:----------------|-----------------|
120
- |existingEventBusInterface?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IEventBus.html)| Optional user-provided custom EventBus for construct to use. Providing both this and `eventBusProps` results an error.|
121
- |eventBusProps?|[`events.EventBusProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.EventBusProps.html)|Optional user-provided properties to override the default properties when creating a custom EventBus. Setting this value to `{}` will create a custom EventBus using all default properties. If neither this nor `existingEventBusInterface` is provided the construct will use the `default` EventBus. Providing both this and `existingEventBusInterface` results an error.|
122
- |eventRuleProps|[`events.RuleProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.RuleProps.html)|User provided eventRuleProps to override the defaults. |
123
- |targetProps?|[`eventtargets.SqsQueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets.SqsQueueProps.html)|Optional user provided properties to define the SQS target on the Event Rule. If you specify a deadLetterQueue for the rule here, you are responsible for adding a resource policy to the queue allowing events.amazonaws.com permission to SendMessage, GetQueueUrl and GetQueueAttributes. You cannot send a DLQ in this property and set deployEventRuleDlq to true. Default is undefined and all system defaults are used.|
124
- |eventRuleDlqKeyProps|[kms.KeyProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.KeyProps.html)|Optional properties to define the key created to protect the ruleDlq. Only valid if deployRuleDlq is set to true. Defaults to CloudFormation defaults.|
125
- | deployEventRuleDlq?|boolean|Whether to deploy a DLQ for the Event Rule. If set to `true`, this DLQ will receive any messages that can't be delivered to the target SQS queue. Defaults to `false`.|
126
- |existingQueueObj?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|An optional, existing SQS queue to be used instead of the default queue. Providing both this and `queueProps` will cause an error.|
127
- |queueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|User provided props to override the default props for the SQS Queue. |
128
- |enableQueuePurging?|`boolean`|Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. Defaults to `false`.|
129
- |deployDeadLetterQueue?|`boolean`|Whether to create a secondary queue to be used as a dead letter queue. Defaults to `true`.|
130
- |deadLetterQueueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter queue. Only used if the `deployDeadLetterQueue` property is set to true.|
131
- |maxReceiveCount?|`number`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to `15`.|
132
- |enableEncryptionWithCustomerManagedKey?|`boolean`|If 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: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps.|
133
- |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|An optional, imported encryption key to encrypt the SQS Queue with.|
134
- |encryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html#construct-props)|Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with.|
135
-
136
- ## Pattern Properties
137
-
138
- | **Name** | **Type** | **Description** |
139
- |:-------------|:----------------|-----------------|
140
- |eventBus?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IEventBus.html)|Returns the instance of events.IEventBus used by the construct|
141
- |eventsRule|[`events.Rule`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.Rule.html)|Returns an instance of events.Rule created by the construct|
142
- |eventRuleDlq?|`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|If the client sets deployEventRuleDlq to 'true', then this value will contain the DLQ set up for the rule.|
143
- |eventRuleDlqKey|[kms.IKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html)|The key created to encrypt the eventRuleDlq.|
144
- |sqsQueue|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of sqs.Queue created by the construct|
145
- |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|Returns an instance of kms Key used for the SQS queue.|
146
- |deadLetterQueue?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of the dead-letter SQS queue created by the pattern.|
147
-
148
- ## Default settings
149
-
150
- Out of the box implementation of the Construct without any override will set the following defaults:
151
-
152
- ### Amazon EventBridge Rule
153
-
154
- * Grant least privilege permissions to EventBridge rule to publish to the SQS Queue.
155
-
156
- ### Amazon SQS Queue
157
-
158
- * Deploy SQS dead-letter queue for the source SQS Queue.
159
- * Enable server-side encryption for source SQS Queue using Customer managed KMS Key.
160
- * Enforce encryption of data in transit.
161
-
162
- ## Architecture
163
-
164
- ![Architecture Diagram](architecture.png)
165
-
166
- ---
167
-
168
-
169
- © Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -1,196 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: aws-solutions-constructs.aws-eventbridge-sqs
3
- Version: 2.85.1
4
- Summary: CDK Constructs for deploying AWS Eventbridge that invokes AWS SQS
5
- Home-page: https://github.com/awslabs/aws-solutions-constructs.git
6
- Author: Amazon Web Services
7
- License: Apache-2.0
8
- Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.git
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: JavaScript
12
- Classifier: Programming Language :: Python :: 3 :: Only
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Typing :: Typed
17
- Classifier: License :: OSI Approved
18
- Requires-Python: ~=3.9
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: aws-cdk-lib<3.0.0,>=2.193.0
22
- Requires-Dist: aws-solutions-constructs.core==2.85.1
23
- Requires-Dist: constructs<11.0.0,>=10.0.0
24
- Requires-Dist: jsii<2.0.0,>=1.111.0
25
- Requires-Dist: publication>=0.0.3
26
- Requires-Dist: typeguard<4.3.0,>=2.13.3
27
-
28
- # aws-eventbridge-sqs module
29
-
30
- <!--BEGIN STABILITY BANNER-->---
31
-
32
-
33
- ![Stability: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
34
-
35
- ---
36
- <!--END STABILITY BANNER-->
37
-
38
- | **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
39
- |:-------------|:-------------|
40
-
41
- <div style="height:8px"></div>
42
-
43
- | **Language** | **Package** |
44
- |:-------------|-----------------|
45
- |![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_eventbridge_sqs`|
46
- |![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-eventbridge-sqs`|
47
- |![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.eventbridgesqs`|
48
-
49
- ## Overview
50
-
51
- This AWS Solutions Construct implements an Amazon EventBridge rule and an AWS SQS Queue.
52
-
53
- Here is a minimal deployable pattern definition:
54
-
55
- Typescript
56
-
57
- ```python
58
- import { Construct } from 'constructs';
59
- import { Stack, StackProps, Duration } from 'aws-cdk-lib';
60
- import * as events from 'aws-cdk-lib/aws-events';
61
- import * as iam from 'aws-cdk-lib/aws-iam';
62
- import { EventbridgeToSqsProps, EventbridgeToSqs } from "@aws-solutions-constructs/aws-eventbridge-sqs";
63
-
64
- const constructProps: EventbridgeToSqsProps = {
65
- eventRuleProps: {
66
- schedule: events.Schedule.rate(Duration.minutes(5))
67
- }
68
- };
69
-
70
- const constructStack = new EventbridgeToSqs(this, 'test-construct', constructProps);
71
-
72
- // Grant yourself permissions to use the Customer Managed KMS Key
73
- const policyStatement = new iam.PolicyStatement({
74
- actions: ["kms:Encrypt", "kms:Decrypt"],
75
- effect: iam.Effect.ALLOW,
76
- principals: [new iam.AccountRootPrincipal()],
77
- resources: ["*"]
78
- });
79
-
80
- constructStack.encryptionKey?.addToResourcePolicy(policyStatement);
81
- ```
82
-
83
- Python
84
-
85
- ```Python
86
- from aws_solutions_constructs.aws_eventbridge_sqs import EventbridgeToSqsProps, EventbridgeToSqs
87
- from aws_cdk import (
88
- aws_events as events,
89
- aws_iam as iam,
90
- Duration,
91
- Stack
92
- )
93
- from constructs import Construct
94
-
95
- construct_stack = EventbridgeToSqs(self, 'test-construct',
96
- event_rule_props=events.RuleProps(
97
- schedule=events.Schedule.rate(
98
- Duration.minutes(5))
99
- ))
100
-
101
- # Grant yourself permissions to use the Customer Managed KMS Key
102
- policy_statement = iam.PolicyStatement(
103
- actions=["kms:Encrypt", "kms:Decrypt"],
104
- effect=iam.Effect.ALLOW,
105
- principals=[iam.AccountRootPrincipal()],
106
- resources=["*"]
107
- )
108
-
109
- construct_stack.encryption_key.add_to_resource_policy(policy_statement)
110
- ```
111
-
112
- Java
113
-
114
- ```java
115
- import software.constructs.Construct;
116
- import java.util.List;
117
-
118
- import software.amazon.awscdk.Stack;
119
- import software.amazon.awscdk.StackProps;
120
- import software.amazon.awscdk.Duration;
121
- import software.amazon.awscdk.services.events.*;
122
- import software.amazon.awscdk.services.iam.*;
123
- import software.amazon.awsconstructs.services.eventbridgesqs.*;
124
-
125
- final EventbridgeToSqs constructStack = new EventbridgeToSqs(this, "test-construct",
126
- new EventbridgeToSqsProps.Builder()
127
- .eventRuleProps(new RuleProps.Builder()
128
- .schedule(Schedule.rate(Duration.minutes(5)))
129
- .build())
130
- .build());
131
-
132
- // Grant yourself permissions to use the Customer Managed KMS Key
133
- final PolicyStatement policyStatement = PolicyStatement.Builder.create()
134
- .actions(List.of("kms:Encrypt", "kms:Decrypt"))
135
- .effect(Effect.ALLOW)
136
- .principals(List.of(new AccountRootPrincipal()))
137
- .resources(List.of("*"))
138
- .build();
139
-
140
- constructStack.getEncryptionKey().addToResourcePolicy(policyStatement);
141
- ```
142
-
143
- ## Pattern Construct Props
144
-
145
- | **Name** | **Type** | **Description** |
146
- |:-------------|:----------------|-----------------|
147
- |existingEventBusInterface?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IEventBus.html)| Optional user-provided custom EventBus for construct to use. Providing both this and `eventBusProps` results an error.|
148
- |eventBusProps?|[`events.EventBusProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.EventBusProps.html)|Optional user-provided properties to override the default properties when creating a custom EventBus. Setting this value to `{}` will create a custom EventBus using all default properties. If neither this nor `existingEventBusInterface` is provided the construct will use the `default` EventBus. Providing both this and `existingEventBusInterface` results an error.|
149
- |eventRuleProps|[`events.RuleProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.RuleProps.html)|User provided eventRuleProps to override the defaults. |
150
- |targetProps?|[`eventtargets.SqsQueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets.SqsQueueProps.html)|Optional user provided properties to define the SQS target on the Event Rule. If you specify a deadLetterQueue for the rule here, you are responsible for adding a resource policy to the queue allowing events.amazonaws.com permission to SendMessage, GetQueueUrl and GetQueueAttributes. You cannot send a DLQ in this property and set deployEventRuleDlq to true. Default is undefined and all system defaults are used.|
151
- |eventRuleDlqKeyProps|[kms.KeyProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.KeyProps.html)|Optional properties to define the key created to protect the ruleDlq. Only valid if deployRuleDlq is set to true. Defaults to CloudFormation defaults.|
152
- | deployEventRuleDlq?|boolean|Whether to deploy a DLQ for the Event Rule. If set to `true`, this DLQ will receive any messages that can't be delivered to the target SQS queue. Defaults to `false`.|
153
- |existingQueueObj?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|An optional, existing SQS queue to be used instead of the default queue. Providing both this and `queueProps` will cause an error.|
154
- |queueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|User provided props to override the default props for the SQS Queue. |
155
- |enableQueuePurging?|`boolean`|Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. Defaults to `false`.|
156
- |deployDeadLetterQueue?|`boolean`|Whether to create a secondary queue to be used as a dead letter queue. Defaults to `true`.|
157
- |deadLetterQueueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter queue. Only used if the `deployDeadLetterQueue` property is set to true.|
158
- |maxReceiveCount?|`number`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to `15`.|
159
- |enableEncryptionWithCustomerManagedKey?|`boolean`|If 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: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps.|
160
- |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|An optional, imported encryption key to encrypt the SQS Queue with.|
161
- |encryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html#construct-props)|Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with.|
162
-
163
- ## Pattern Properties
164
-
165
- | **Name** | **Type** | **Description** |
166
- |:-------------|:----------------|-----------------|
167
- |eventBus?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.IEventBus.html)|Returns the instance of events.IEventBus used by the construct|
168
- |eventsRule|[`events.Rule`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.Rule.html)|Returns an instance of events.Rule created by the construct|
169
- |eventRuleDlq?|`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|If the client sets deployEventRuleDlq to 'true', then this value will contain the DLQ set up for the rule.|
170
- |eventRuleDlqKey|[kms.IKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html)|The key created to encrypt the eventRuleDlq.|
171
- |sqsQueue|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of sqs.Queue created by the construct|
172
- |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|Returns an instance of kms Key used for the SQS queue.|
173
- |deadLetterQueue?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of the dead-letter SQS queue created by the pattern.|
174
-
175
- ## Default settings
176
-
177
- Out of the box implementation of the Construct without any override will set the following defaults:
178
-
179
- ### Amazon EventBridge Rule
180
-
181
- * Grant least privilege permissions to EventBridge rule to publish to the SQS Queue.
182
-
183
- ### Amazon SQS Queue
184
-
185
- * Deploy SQS dead-letter queue for the source SQS Queue.
186
- * Enable server-side encryption for source SQS Queue using Customer managed KMS Key.
187
- * Enforce encryption of data in transit.
188
-
189
- ## Architecture
190
-
191
- ![Architecture Diagram](architecture.png)
192
-
193
- ---
194
-
195
-
196
- © Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.