You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
visibilityTimeout: 120# optional (in seconds) - AWS default is 30 secs
@@ -104,6 +104,58 @@ This would be set to 'true' by default if this was the first version of the plug
104
104
105
105
See also: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html
106
106
107
+
### Notes on Encryption
108
+
109
+
If you choose to encrypt your SQS queue, the SNS topic will not be able to send it any messages if you use a managed key (alias/aws/sqs). This is due to an AWS limitation.
# To allow SNS to push messages to an encrypted queue, a CMK must be used
117
+
SQSQueueCMK:
118
+
Type: AWS::KMS::Key
119
+
Properties:
120
+
KeyPolicy:
121
+
Version: "2012-10-17"
122
+
Id: key-default-1
123
+
Statement:
124
+
- Sid: Enable IAM User Permissions
125
+
Effect: Allow
126
+
Principal:
127
+
AWS: !Join
128
+
- ""
129
+
- - "arn:aws:iam::"
130
+
- !Ref"AWS::AccountId"
131
+
- ":root"
132
+
Action: "kms:*"
133
+
Resource: "*"
134
+
- Sid: Allow SNS publish to SQS
135
+
Effect: Allow
136
+
Principal:
137
+
Service: sns.amazonaws.com
138
+
Action:
139
+
- kms:GenerateDataKey
140
+
- kms:Decrypt
141
+
Resource: "*"
142
+
```
143
+
144
+
and then reference it in the `snsSqs` config with the `kmsMasterKeyId` attribute.
145
+
146
+
```yaml
147
+
functions:
148
+
processEvent:
149
+
handler: handler.handler
150
+
events:
151
+
- snsSqs:
152
+
# ...
153
+
kmsMasterKeyId: !GetAtt SQSQueueKey.Arn
154
+
# ...
155
+
```
156
+
157
+
`kmsMasterKeyId`can either be a key ID (simple string) or an ARN or reference to to ARN. Using !Ref on a key will return a key ID and is invalid, so you'll need to use GetAtt and reference the Arn property.
158
+
107
159
### CloudFormation Overrides
108
160
109
161
If you would like to override a part of the CloudFormation template
0 commit comments