@aws-solutions-constructs/aws-lambda-sns 2.51.0 → 2.52.1
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.
- package/.eslintignore +2 -0
- package/.jsii +49 -4
- package/integ.config.json +7 -0
- package/lib/index.js +1 -1
- package/package.json +9 -8
- package/test/integ.lamsns-deployFunction.js +5 -2
- package/test/integ.lamsns-deployFunction.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
- package/test/integ.lamsns-deployFunction.js.snapshot/cdk.out +1 -0
- package/test/integ.lamsns-deployFunction.js.snapshot/integ.json +12 -0
- package/test/integ.lamsns-deployFunction.js.snapshot/lamsns-deployFunction.assets.json +32 -0
- package/test/integ.lamsns-deployFunction.js.snapshot/lamsns-deployFunction.template.json +302 -0
- package/test/integ.lamsns-deployFunction.js.snapshot/lamsnsdeployFunctionIntegDefaultTestDeployAssert36FE5D09.assets.json +19 -0
- package/test/integ.lamsns-deployFunction.js.snapshot/lamsnsdeployFunctionIntegDefaultTestDeployAssert36FE5D09.template.json +36 -0
- package/test/integ.lamsns-deployFunction.js.snapshot/manifest.json +137 -0
- package/test/integ.lamsns-deployFunction.js.snapshot/tree.json +474 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js +6 -2
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/cdk.out +1 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/integ.json +12 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsns-deployFunctionWithVpc.assets.json +45 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsns-deployFunctionWithVpc.template.json +829 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsnsdeployFunctionWithVpcIntegDefaultTestDeployAssertEDF33408.assets.json +19 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsnsdeployFunctionWithVpcIntegDefaultTestDeployAssertEDF33408.template.json +36 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/manifest.json +239 -0
- package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/tree.json +1113 -0
- package/test/integ.lamsns-existingFunction.js +5 -2
- package/test/integ.lamsns-existingFunction.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
- package/test/integ.lamsns-existingFunction.js.snapshot/cdk.out +1 -0
- package/test/integ.lamsns-existingFunction.js.snapshot/integ.json +12 -0
- package/test/integ.lamsns-existingFunction.js.snapshot/lamsns-existingFunction.assets.json +32 -0
- package/test/integ.lamsns-existingFunction.js.snapshot/lamsns-existingFunction.template.json +302 -0
- package/test/integ.lamsns-existingFunction.js.snapshot/lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.assets.json +19 -0
- package/test/integ.lamsns-existingFunction.js.snapshot/lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.template.json +36 -0
- package/test/integ.lamsns-existingFunction.js.snapshot/manifest.json +137 -0
- package/test/integ.lamsns-existingFunction.js.snapshot/tree.json +474 -0
- package/test/integ.lamsns-deployFunction.expected.json +0 -302
- package/test/integ.lamsns-deployFunctionWithVpc.expected.json +0 -744
- package/test/integ.lamsns-existingFunction.expected.json +0 -302
|
@@ -18,6 +18,7 @@ const lib_1 = require("../lib");
|
|
|
18
18
|
const lambda = require("aws-cdk-lib/aws-lambda");
|
|
19
19
|
const defaults = require("@aws-solutions-constructs/core");
|
|
20
20
|
const core_1 = require("@aws-solutions-constructs/core");
|
|
21
|
+
const integ_tests_alpha_1 = require("@aws-cdk/integ-tests-alpha");
|
|
21
22
|
// Setup
|
|
22
23
|
const app = new aws_cdk_lib_1.App();
|
|
23
24
|
const stack = new aws_cdk_lib_1.Stack(app, core_1.generateIntegStackName(__filename));
|
|
@@ -34,5 +35,7 @@ const props = {
|
|
|
34
35
|
};
|
|
35
36
|
new lib_1.LambdaToSns(stack, 'test-lambda-sns', props);
|
|
36
37
|
// Synth
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
new integ_tests_alpha_1.IntegTest(stack, 'Integ', { testCases: [
|
|
39
|
+
stack
|
|
40
|
+
] });
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcubGFtc25zLWV4aXN0aW5nRnVuY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbnRlZy5sYW1zbnMtZXhpc3RpbmdGdW5jdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7O0dBV0c7O0FBRUgsVUFBVTtBQUNWLDZDQUF5QztBQUN6QyxnQ0FBdUQ7QUFDdkQsaURBQWlEO0FBQ2pELDJEQUEyRDtBQUMzRCx5REFBd0U7QUFDeEUsa0VBQXVEO0FBRXZELFFBQVE7QUFDUixNQUFNLEdBQUcsR0FBRyxJQUFJLGlCQUFHLEVBQUUsQ0FBQztBQUN0QixNQUFNLEtBQUssR0FBRyxJQUFJLG1CQUFLLENBQUMsR0FBRyxFQUFFLDZCQUFzQixDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUM7QUFDakUsS0FBSyxDQUFDLGVBQWUsQ0FBQyxXQUFXLEdBQUcscUNBQXFDLENBQUM7QUFFMUUsY0FBYztBQUNkLE1BQU0sbUJBQW1CLEdBQUc7SUFDMUIsT0FBTyx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VuY3Rpb25Qcm9wcyA9IHtcbiAgcnVudGltZTogbGFtYmRhLlJ1bnRpbWUuTk9ERUpTXzE2X1gsXG4gIGhhbmRsZXI6ICdpbmRleC5oYW5kbGVyJyxcbiAgY29kZTogbGFtYmRhLkNvZGUuZnJvbUFzc2V0KGAke19fZGlybmFtZX0vbGFtYmRhYClcbn07XG5cbmNvbnN0IGZ1bmMgPSBkZWZhdWx0cy5kZXBsb3lMYW1iZGFGdW5jdGlvbihzdGFjaywgbGFtYmRhRnVuY3Rpb25Qcm9wcyk7XG5cbmNvbnN0IHByb3BzOiBMYW1iZGFUb1Nuc1Byb3BzID0ge1xuICBleGlzdGluZ0xhbWJkYU9iajogZnVuY1xufTtcblxubmV3IExhbWJkYVRvU25zKHN0YWNrLCAndGVzdC1sYW1iZGEtc25zJywgcHJvcHMpO1xuXG4vLyBTeW50aFxubmV3IEludGVnVGVzdChzdGFjaywgJ0ludGVnJywgeyB0ZXN0Q2FzZXM6IFtcbiAgc3RhY2tcbl0gfSk7XG4iXX0=
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
exports.handler = async (event, context) => {
|
|
15
|
+
console.log('Received event:', JSON.stringify(event, null, 2));
|
|
16
|
+
return {
|
|
17
|
+
statusCode: 200,
|
|
18
|
+
headers: { 'Content-Type': 'text/plain' },
|
|
19
|
+
body: `Hello from Project Vesper! You've hit ${event.path}\n`
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"36.0.0"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "36.0.0",
|
|
3
|
+
"testCases": {
|
|
4
|
+
"lamsns-existingFunction/Integ/DefaultTest": {
|
|
5
|
+
"stacks": [
|
|
6
|
+
"lamsns-existingFunction"
|
|
7
|
+
],
|
|
8
|
+
"assertionStack": "lamsns-existingFunction/Integ/DefaultTest/DeployAssert",
|
|
9
|
+
"assertionStackName": "lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "36.0.0",
|
|
3
|
+
"files": {
|
|
4
|
+
"0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f": {
|
|
5
|
+
"source": {
|
|
6
|
+
"path": "asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f",
|
|
7
|
+
"packaging": "zip"
|
|
8
|
+
},
|
|
9
|
+
"destinations": {
|
|
10
|
+
"current_account-current_region": {
|
|
11
|
+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
12
|
+
"objectKey": "0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f.zip",
|
|
13
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"993cb84724defbc88190b9e479b46236fa8b9a18e08ee37d1fd8c6cd560e7ab8": {
|
|
18
|
+
"source": {
|
|
19
|
+
"path": "lamsns-existingFunction.template.json",
|
|
20
|
+
"packaging": "file"
|
|
21
|
+
},
|
|
22
|
+
"destinations": {
|
|
23
|
+
"current_account-current_region": {
|
|
24
|
+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
25
|
+
"objectKey": "993cb84724defbc88190b9e479b46236fa8b9a18e08ee37d1fd8c6cd560e7ab8.json",
|
|
26
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"dockerImages": {}
|
|
32
|
+
}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Description": "Integration Test for aws-lambda-sns",
|
|
3
|
+
"Resources": {
|
|
4
|
+
"LambdaFunctionServiceRole0C4CDE0B": {
|
|
5
|
+
"Type": "AWS::IAM::Role",
|
|
6
|
+
"Properties": {
|
|
7
|
+
"AssumeRolePolicyDocument": {
|
|
8
|
+
"Statement": [
|
|
9
|
+
{
|
|
10
|
+
"Action": "sts:AssumeRole",
|
|
11
|
+
"Effect": "Allow",
|
|
12
|
+
"Principal": {
|
|
13
|
+
"Service": "lambda.amazonaws.com"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"Version": "2012-10-17"
|
|
18
|
+
},
|
|
19
|
+
"Policies": [
|
|
20
|
+
{
|
|
21
|
+
"PolicyDocument": {
|
|
22
|
+
"Statement": [
|
|
23
|
+
{
|
|
24
|
+
"Action": [
|
|
25
|
+
"logs:CreateLogGroup",
|
|
26
|
+
"logs:CreateLogStream",
|
|
27
|
+
"logs:PutLogEvents"
|
|
28
|
+
],
|
|
29
|
+
"Effect": "Allow",
|
|
30
|
+
"Resource": {
|
|
31
|
+
"Fn::Join": [
|
|
32
|
+
"",
|
|
33
|
+
[
|
|
34
|
+
"arn:",
|
|
35
|
+
{
|
|
36
|
+
"Ref": "AWS::Partition"
|
|
37
|
+
},
|
|
38
|
+
":logs:",
|
|
39
|
+
{
|
|
40
|
+
"Ref": "AWS::Region"
|
|
41
|
+
},
|
|
42
|
+
":",
|
|
43
|
+
{
|
|
44
|
+
"Ref": "AWS::AccountId"
|
|
45
|
+
},
|
|
46
|
+
":log-group:/aws/lambda/*"
|
|
47
|
+
]
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"Version": "2012-10-17"
|
|
53
|
+
},
|
|
54
|
+
"PolicyName": "LambdaFunctionServiceRolePolicy"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"LambdaFunctionServiceRoleDefaultPolicy126C8897": {
|
|
60
|
+
"Type": "AWS::IAM::Policy",
|
|
61
|
+
"Properties": {
|
|
62
|
+
"PolicyDocument": {
|
|
63
|
+
"Statement": [
|
|
64
|
+
{
|
|
65
|
+
"Action": [
|
|
66
|
+
"xray:PutTelemetryRecords",
|
|
67
|
+
"xray:PutTraceSegments"
|
|
68
|
+
],
|
|
69
|
+
"Effect": "Allow",
|
|
70
|
+
"Resource": "*"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"Action": "sns:Publish",
|
|
74
|
+
"Effect": "Allow",
|
|
75
|
+
"Resource": {
|
|
76
|
+
"Ref": "testlambdasnsSnsTopic57DFED98"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"Version": "2012-10-17"
|
|
81
|
+
},
|
|
82
|
+
"PolicyName": "LambdaFunctionServiceRoleDefaultPolicy126C8897",
|
|
83
|
+
"Roles": [
|
|
84
|
+
{
|
|
85
|
+
"Ref": "LambdaFunctionServiceRole0C4CDE0B"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"Metadata": {
|
|
90
|
+
"cfn_nag": {
|
|
91
|
+
"rules_to_suppress": [
|
|
92
|
+
{
|
|
93
|
+
"id": "W12",
|
|
94
|
+
"reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"LambdaFunctionBF21E41F": {
|
|
101
|
+
"Type": "AWS::Lambda::Function",
|
|
102
|
+
"Properties": {
|
|
103
|
+
"Code": {
|
|
104
|
+
"S3Bucket": {
|
|
105
|
+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
|
|
106
|
+
},
|
|
107
|
+
"S3Key": "0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f.zip"
|
|
108
|
+
},
|
|
109
|
+
"Environment": {
|
|
110
|
+
"Variables": {
|
|
111
|
+
"AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
|
|
112
|
+
"SNS_TOPIC_ARN": {
|
|
113
|
+
"Ref": "testlambdasnsSnsTopic57DFED98"
|
|
114
|
+
},
|
|
115
|
+
"SNS_TOPIC_NAME": {
|
|
116
|
+
"Fn::GetAtt": [
|
|
117
|
+
"testlambdasnsSnsTopic57DFED98",
|
|
118
|
+
"TopicName"
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"Handler": "index.handler",
|
|
124
|
+
"Role": {
|
|
125
|
+
"Fn::GetAtt": [
|
|
126
|
+
"LambdaFunctionServiceRole0C4CDE0B",
|
|
127
|
+
"Arn"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"Runtime": "nodejs16.x",
|
|
131
|
+
"TracingConfig": {
|
|
132
|
+
"Mode": "Active"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"DependsOn": [
|
|
136
|
+
"LambdaFunctionServiceRoleDefaultPolicy126C8897",
|
|
137
|
+
"LambdaFunctionServiceRole0C4CDE0B"
|
|
138
|
+
],
|
|
139
|
+
"Metadata": {
|
|
140
|
+
"cfn_nag": {
|
|
141
|
+
"rules_to_suppress": [
|
|
142
|
+
{
|
|
143
|
+
"id": "W58",
|
|
144
|
+
"reason": "Lambda functions has the required permission to write CloudWatch Logs. It uses custom policy instead of arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole with tighter permissions."
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "W89",
|
|
148
|
+
"reason": "This is not a rule for the general case, just for specific use cases/industries"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "W92",
|
|
152
|
+
"reason": "Impossible for us to define the correct concurrency for clients"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"testlambdasnsSnsTopic57DFED98": {
|
|
159
|
+
"Type": "AWS::SNS::Topic",
|
|
160
|
+
"Properties": {
|
|
161
|
+
"KmsMasterKeyId": {
|
|
162
|
+
"Fn::Join": [
|
|
163
|
+
"",
|
|
164
|
+
[
|
|
165
|
+
"arn:",
|
|
166
|
+
{
|
|
167
|
+
"Ref": "AWS::Partition"
|
|
168
|
+
},
|
|
169
|
+
":kms:",
|
|
170
|
+
{
|
|
171
|
+
"Ref": "AWS::Region"
|
|
172
|
+
},
|
|
173
|
+
":",
|
|
174
|
+
{
|
|
175
|
+
"Ref": "AWS::AccountId"
|
|
176
|
+
},
|
|
177
|
+
":alias/aws/sns"
|
|
178
|
+
]
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"testlambdasnsSnsTopicPolicy4481ABC3": {
|
|
184
|
+
"Type": "AWS::SNS::TopicPolicy",
|
|
185
|
+
"Properties": {
|
|
186
|
+
"PolicyDocument": {
|
|
187
|
+
"Statement": [
|
|
188
|
+
{
|
|
189
|
+
"Action": [
|
|
190
|
+
"SNS:AddPermission",
|
|
191
|
+
"SNS:DeleteTopic",
|
|
192
|
+
"SNS:GetTopicAttributes",
|
|
193
|
+
"SNS:ListSubscriptionsByTopic",
|
|
194
|
+
"SNS:Publish",
|
|
195
|
+
"SNS:Receive",
|
|
196
|
+
"SNS:RemovePermission",
|
|
197
|
+
"SNS:SetTopicAttributes",
|
|
198
|
+
"SNS:Subscribe"
|
|
199
|
+
],
|
|
200
|
+
"Condition": {
|
|
201
|
+
"StringEquals": {
|
|
202
|
+
"AWS:SourceOwner": {
|
|
203
|
+
"Ref": "AWS::AccountId"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"Effect": "Allow",
|
|
208
|
+
"Principal": {
|
|
209
|
+
"AWS": {
|
|
210
|
+
"Fn::Join": [
|
|
211
|
+
"",
|
|
212
|
+
[
|
|
213
|
+
"arn:",
|
|
214
|
+
{
|
|
215
|
+
"Ref": "AWS::Partition"
|
|
216
|
+
},
|
|
217
|
+
":iam::",
|
|
218
|
+
{
|
|
219
|
+
"Ref": "AWS::AccountId"
|
|
220
|
+
},
|
|
221
|
+
":root"
|
|
222
|
+
]
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"Resource": {
|
|
227
|
+
"Ref": "testlambdasnsSnsTopic57DFED98"
|
|
228
|
+
},
|
|
229
|
+
"Sid": "TopicOwnerOnlyAccess"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"Action": [
|
|
233
|
+
"SNS:AddPermission",
|
|
234
|
+
"SNS:DeleteTopic",
|
|
235
|
+
"SNS:GetTopicAttributes",
|
|
236
|
+
"SNS:ListSubscriptionsByTopic",
|
|
237
|
+
"SNS:Publish",
|
|
238
|
+
"SNS:Receive",
|
|
239
|
+
"SNS:RemovePermission",
|
|
240
|
+
"SNS:SetTopicAttributes",
|
|
241
|
+
"SNS:Subscribe"
|
|
242
|
+
],
|
|
243
|
+
"Condition": {
|
|
244
|
+
"Bool": {
|
|
245
|
+
"aws:SecureTransport": "false"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"Effect": "Deny",
|
|
249
|
+
"Principal": {
|
|
250
|
+
"AWS": "*"
|
|
251
|
+
},
|
|
252
|
+
"Resource": {
|
|
253
|
+
"Ref": "testlambdasnsSnsTopic57DFED98"
|
|
254
|
+
},
|
|
255
|
+
"Sid": "HttpsOnly"
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
"Version": "2012-10-17"
|
|
259
|
+
},
|
|
260
|
+
"Topics": [
|
|
261
|
+
{
|
|
262
|
+
"Ref": "testlambdasnsSnsTopic57DFED98"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"Parameters": {
|
|
269
|
+
"BootstrapVersion": {
|
|
270
|
+
"Type": "AWS::SSM::Parameter::Value<String>",
|
|
271
|
+
"Default": "/cdk-bootstrap/hnb659fds/version",
|
|
272
|
+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"Rules": {
|
|
276
|
+
"CheckBootstrapVersion": {
|
|
277
|
+
"Assertions": [
|
|
278
|
+
{
|
|
279
|
+
"Assert": {
|
|
280
|
+
"Fn::Not": [
|
|
281
|
+
{
|
|
282
|
+
"Fn::Contains": [
|
|
283
|
+
[
|
|
284
|
+
"1",
|
|
285
|
+
"2",
|
|
286
|
+
"3",
|
|
287
|
+
"4",
|
|
288
|
+
"5"
|
|
289
|
+
],
|
|
290
|
+
{
|
|
291
|
+
"Ref": "BootstrapVersion"
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "36.0.0",
|
|
3
|
+
"files": {
|
|
4
|
+
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
|
|
5
|
+
"source": {
|
|
6
|
+
"path": "lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.template.json",
|
|
7
|
+
"packaging": "file"
|
|
8
|
+
},
|
|
9
|
+
"destinations": {
|
|
10
|
+
"current_account-current_region": {
|
|
11
|
+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
12
|
+
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
|
|
13
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"dockerImages": {}
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Parameters": {
|
|
3
|
+
"BootstrapVersion": {
|
|
4
|
+
"Type": "AWS::SSM::Parameter::Value<String>",
|
|
5
|
+
"Default": "/cdk-bootstrap/hnb659fds/version",
|
|
6
|
+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"Rules": {
|
|
10
|
+
"CheckBootstrapVersion": {
|
|
11
|
+
"Assertions": [
|
|
12
|
+
{
|
|
13
|
+
"Assert": {
|
|
14
|
+
"Fn::Not": [
|
|
15
|
+
{
|
|
16
|
+
"Fn::Contains": [
|
|
17
|
+
[
|
|
18
|
+
"1",
|
|
19
|
+
"2",
|
|
20
|
+
"3",
|
|
21
|
+
"4",
|
|
22
|
+
"5"
|
|
23
|
+
],
|
|
24
|
+
{
|
|
25
|
+
"Ref": "BootstrapVersion"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "36.0.0",
|
|
3
|
+
"artifacts": {
|
|
4
|
+
"lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.assets": {
|
|
5
|
+
"type": "cdk:asset-manifest",
|
|
6
|
+
"properties": {
|
|
7
|
+
"file": "lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.assets.json",
|
|
8
|
+
"requiresBootstrapStackVersion": 6,
|
|
9
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB": {
|
|
13
|
+
"type": "aws:cloudformation:stack",
|
|
14
|
+
"environment": "aws://unknown-account/unknown-region",
|
|
15
|
+
"properties": {
|
|
16
|
+
"templateFile": "lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.template.json",
|
|
17
|
+
"terminationProtection": false,
|
|
18
|
+
"validateOnSynth": false,
|
|
19
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
|
|
20
|
+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
|
|
21
|
+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
|
|
22
|
+
"requiresBootstrapStackVersion": 6,
|
|
23
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
|
|
24
|
+
"additionalDependencies": [
|
|
25
|
+
"lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.assets"
|
|
26
|
+
],
|
|
27
|
+
"lookupRole": {
|
|
28
|
+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
|
|
29
|
+
"requiresBootstrapStackVersion": 8,
|
|
30
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"dependencies": [
|
|
34
|
+
"lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.assets"
|
|
35
|
+
],
|
|
36
|
+
"metadata": {
|
|
37
|
+
"/lamsns-existingFunction/Integ/DefaultTest/DeployAssert/BootstrapVersion": [
|
|
38
|
+
{
|
|
39
|
+
"type": "aws:cdk:logicalId",
|
|
40
|
+
"data": "BootstrapVersion"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"/lamsns-existingFunction/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [
|
|
44
|
+
{
|
|
45
|
+
"type": "aws:cdk:logicalId",
|
|
46
|
+
"data": "CheckBootstrapVersion"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"displayName": "lamsns-existingFunction/Integ/DefaultTest/DeployAssert"
|
|
51
|
+
},
|
|
52
|
+
"lamsns-existingFunction.assets": {
|
|
53
|
+
"type": "cdk:asset-manifest",
|
|
54
|
+
"properties": {
|
|
55
|
+
"file": "lamsns-existingFunction.assets.json",
|
|
56
|
+
"requiresBootstrapStackVersion": 6,
|
|
57
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"lamsns-existingFunction": {
|
|
61
|
+
"type": "aws:cloudformation:stack",
|
|
62
|
+
"environment": "aws://unknown-account/unknown-region",
|
|
63
|
+
"properties": {
|
|
64
|
+
"templateFile": "lamsns-existingFunction.template.json",
|
|
65
|
+
"terminationProtection": false,
|
|
66
|
+
"validateOnSynth": false,
|
|
67
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
|
|
68
|
+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
|
|
69
|
+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/993cb84724defbc88190b9e479b46236fa8b9a18e08ee37d1fd8c6cd560e7ab8.json",
|
|
70
|
+
"requiresBootstrapStackVersion": 6,
|
|
71
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
|
|
72
|
+
"additionalDependencies": [
|
|
73
|
+
"lamsns-existingFunction.assets"
|
|
74
|
+
],
|
|
75
|
+
"lookupRole": {
|
|
76
|
+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
|
|
77
|
+
"requiresBootstrapStackVersion": 8,
|
|
78
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"dependencies": [
|
|
82
|
+
"lamsns-existingFunction.assets"
|
|
83
|
+
],
|
|
84
|
+
"metadata": {
|
|
85
|
+
"/lamsns-existingFunction/LambdaFunctionServiceRole/Resource": [
|
|
86
|
+
{
|
|
87
|
+
"type": "aws:cdk:logicalId",
|
|
88
|
+
"data": "LambdaFunctionServiceRole0C4CDE0B"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"/lamsns-existingFunction/LambdaFunctionServiceRole/DefaultPolicy/Resource": [
|
|
92
|
+
{
|
|
93
|
+
"type": "aws:cdk:logicalId",
|
|
94
|
+
"data": "LambdaFunctionServiceRoleDefaultPolicy126C8897"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"/lamsns-existingFunction/LambdaFunction/Resource": [
|
|
98
|
+
{
|
|
99
|
+
"type": "aws:cdk:logicalId",
|
|
100
|
+
"data": "LambdaFunctionBF21E41F"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"/lamsns-existingFunction/test-lambda-sns/SnsTopic/Resource": [
|
|
104
|
+
{
|
|
105
|
+
"type": "aws:cdk:logicalId",
|
|
106
|
+
"data": "testlambdasnsSnsTopic57DFED98"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"/lamsns-existingFunction/test-lambda-sns/SnsTopic/Policy/Resource": [
|
|
110
|
+
{
|
|
111
|
+
"type": "aws:cdk:logicalId",
|
|
112
|
+
"data": "testlambdasnsSnsTopicPolicy4481ABC3"
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"/lamsns-existingFunction/BootstrapVersion": [
|
|
116
|
+
{
|
|
117
|
+
"type": "aws:cdk:logicalId",
|
|
118
|
+
"data": "BootstrapVersion"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"/lamsns-existingFunction/CheckBootstrapVersion": [
|
|
122
|
+
{
|
|
123
|
+
"type": "aws:cdk:logicalId",
|
|
124
|
+
"data": "CheckBootstrapVersion"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"displayName": "lamsns-existingFunction"
|
|
129
|
+
},
|
|
130
|
+
"Tree": {
|
|
131
|
+
"type": "cdk:tree",
|
|
132
|
+
"properties": {
|
|
133
|
+
"file": "tree.json"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|