@aws-solutions-constructs/aws-lambda-dynamodb 2.50.0 → 2.52.0
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 +50 -5
- package/integ.config.json +7 -0
- package/lib/index.js +1 -1
- package/package.json +12 -11
- package/test/integ.lamddb-add-secondary-index.js +5 -2
- package/test/integ.lamddb-add-secondary-index.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamddb-add-secondary-index.js.snapshot/cdk.out +1 -0
- package/test/integ.lamddb-add-secondary-index.js.snapshot/integ.json +12 -0
- package/test/integ.lamddb-add-secondary-index.js.snapshot/lamddb-add-secondary-index.assets.json +32 -0
- package/test/integ.lamddb-add-secondary-index.js.snapshot/lamddb-add-secondary-index.template.json +262 -0
- package/test/integ.lamddb-add-secondary-index.js.snapshot/lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.assets.json +19 -0
- package/test/integ.lamddb-add-secondary-index.js.snapshot/lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.template.json +36 -0
- package/test/integ.lamddb-add-secondary-index.js.snapshot/manifest.json +131 -0
- package/test/integ.lamddb-add-secondary-index.js.snapshot/tree.json +415 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js +6 -2
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/cdk.out +1 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/integ.json +12 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddb-deployFunctionWithExistingVpc.assets.json +45 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddb-deployFunctionWithExistingVpc.template.json +984 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddbdeployFunctionWithExistingVpcIntegDefaultTestDeployAssertEE08E38E.assets.json +19 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddbdeployFunctionWithExistingVpcIntegDefaultTestDeployAssertEE08E38E.template.json +36 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/manifest.json +323 -0
- package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/tree.json +1372 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js +6 -2
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/cdk.out +1 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/integ.json +12 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddb-deployFunctionWithVpc.assets.json +45 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddb-deployFunctionWithVpc.template.json +694 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddbdeployFunctionWithVpcIntegDefaultTestDeployAssert0AB8275C.assets.json +19 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddbdeployFunctionWithVpcIntegDefaultTestDeployAssert0AB8275C.template.json +36 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/manifest.json +227 -0
- package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/tree.json +954 -0
- package/test/integ.lamddb-no-arguments.js +5 -2
- package/test/integ.lamddb-no-arguments.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamddb-no-arguments.js.snapshot/cdk.out +1 -0
- package/test/integ.lamddb-no-arguments.js.snapshot/integ.json +12 -0
- package/test/integ.lamddb-no-arguments.js.snapshot/lamddb-no-arguments.assets.json +32 -0
- package/test/integ.lamddb-no-arguments.js.snapshot/lamddb-no-arguments.template.json +233 -0
- package/test/integ.lamddb-no-arguments.js.snapshot/lamddbnoargumentsIntegDefaultTestDeployAssert248B75D0.assets.json +19 -0
- package/test/integ.lamddb-no-arguments.js.snapshot/lamddbnoargumentsIntegDefaultTestDeployAssert248B75D0.template.json +36 -0
- package/test/integ.lamddb-no-arguments.js.snapshot/manifest.json +131 -0
- package/test/integ.lamddb-no-arguments.js.snapshot/tree.json +386 -0
- package/test/integ.lamddb-set-billing-mode.js +5 -2
- package/test/integ.lamddb-set-billing-mode.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamddb-set-billing-mode.js.snapshot/cdk.out +1 -0
- package/test/integ.lamddb-set-billing-mode.js.snapshot/integ.json +12 -0
- package/test/integ.lamddb-set-billing-mode.js.snapshot/lamddb-set-billing-mode.assets.json +32 -0
- package/test/integ.lamddb-set-billing-mode.js.snapshot/lamddb-set-billing-mode.template.json +246 -0
- package/test/integ.lamddb-set-billing-mode.js.snapshot/lamddbsetbillingmodeIntegDefaultTestDeployAssertDAE32272.assets.json +19 -0
- package/test/integ.lamddb-set-billing-mode.js.snapshot/lamddbsetbillingmodeIntegDefaultTestDeployAssertDAE32272.template.json +36 -0
- package/test/integ.lamddb-set-billing-mode.js.snapshot/manifest.json +131 -0
- package/test/integ.lamddb-set-billing-mode.js.snapshot/tree.json +389 -0
- package/test/integ.lamddb-use-existing-func.js +5 -2
- package/test/integ.lamddb-use-existing-func.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamddb-use-existing-func.js.snapshot/cdk.out +1 -0
- package/test/integ.lamddb-use-existing-func.js.snapshot/integ.json +12 -0
- package/test/integ.lamddb-use-existing-func.js.snapshot/lamddb-use-existing-func.assets.json +32 -0
- package/test/integ.lamddb-use-existing-func.js.snapshot/lamddb-use-existing-func.template.json +233 -0
- package/test/integ.lamddb-use-existing-func.js.snapshot/lamddbuseexistingfuncIntegDefaultTestDeployAssert48D284DD.assets.json +19 -0
- package/test/integ.lamddb-use-existing-func.js.snapshot/lamddbuseexistingfuncIntegDefaultTestDeployAssert48D284DD.template.json +36 -0
- package/test/integ.lamddb-use-existing-func.js.snapshot/manifest.json +131 -0
- package/test/integ.lamddb-use-existing-func.js.snapshot/tree.json +386 -0
- package/test/integ.lamddb-add-secondary-index.expected.json +0 -262
- package/test/integ.lamddb-deployFunctionWithExistingVpc.expected.json +0 -1012
- package/test/integ.lamddb-deployFunctionWithVpc.expected.json +0 -609
- package/test/integ.lamddb-no-arguments.expected.json +0 -233
- package/test/integ.lamddb-set-billing-mode.expected.json +0 -246
- package/test/integ.lamddb-use-existing-func.expected.json +0 -233
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "36.0.0",
|
|
3
|
+
"artifacts": {
|
|
4
|
+
"lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.assets": {
|
|
5
|
+
"type": "cdk:asset-manifest",
|
|
6
|
+
"properties": {
|
|
7
|
+
"file": "lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.assets.json",
|
|
8
|
+
"requiresBootstrapStackVersion": 6,
|
|
9
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9": {
|
|
13
|
+
"type": "aws:cloudformation:stack",
|
|
14
|
+
"environment": "aws://unknown-account/unknown-region",
|
|
15
|
+
"properties": {
|
|
16
|
+
"templateFile": "lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.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
|
+
"lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.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
|
+
"lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.assets"
|
|
35
|
+
],
|
|
36
|
+
"metadata": {
|
|
37
|
+
"/lamddb-add-secondary-index/Integ/DefaultTest/DeployAssert/BootstrapVersion": [
|
|
38
|
+
{
|
|
39
|
+
"type": "aws:cdk:logicalId",
|
|
40
|
+
"data": "BootstrapVersion"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"/lamddb-add-secondary-index/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [
|
|
44
|
+
{
|
|
45
|
+
"type": "aws:cdk:logicalId",
|
|
46
|
+
"data": "CheckBootstrapVersion"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"displayName": "lamddb-add-secondary-index/Integ/DefaultTest/DeployAssert"
|
|
51
|
+
},
|
|
52
|
+
"lamddb-add-secondary-index.assets": {
|
|
53
|
+
"type": "cdk:asset-manifest",
|
|
54
|
+
"properties": {
|
|
55
|
+
"file": "lamddb-add-secondary-index.assets.json",
|
|
56
|
+
"requiresBootstrapStackVersion": 6,
|
|
57
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"lamddb-add-secondary-index": {
|
|
61
|
+
"type": "aws:cloudformation:stack",
|
|
62
|
+
"environment": "aws://unknown-account/unknown-region",
|
|
63
|
+
"properties": {
|
|
64
|
+
"templateFile": "lamddb-add-secondary-index.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}/4bd1c16e8e9fa7e057a6f49587cf6061a8597d81283fc89f2c430ef81159daae.json",
|
|
70
|
+
"requiresBootstrapStackVersion": 6,
|
|
71
|
+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
|
|
72
|
+
"additionalDependencies": [
|
|
73
|
+
"lamddb-add-secondary-index.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
|
+
"lamddb-add-secondary-index.assets"
|
|
83
|
+
],
|
|
84
|
+
"metadata": {
|
|
85
|
+
"/lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunctionServiceRole/Resource": [
|
|
86
|
+
{
|
|
87
|
+
"type": "aws:cdk:logicalId",
|
|
88
|
+
"data": "testlambdadynamodbstackLambdaFunctionServiceRole758347A1"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"/lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunctionServiceRole/DefaultPolicy/Resource": [
|
|
92
|
+
{
|
|
93
|
+
"type": "aws:cdk:logicalId",
|
|
94
|
+
"data": "testlambdadynamodbstackLambdaFunctionServiceRoleDefaultPolicy547FB7F4"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"/lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunction/Resource": [
|
|
98
|
+
{
|
|
99
|
+
"type": "aws:cdk:logicalId",
|
|
100
|
+
"data": "testlambdadynamodbstackLambdaFunction5DDB3E8D"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"/lamddb-add-secondary-index/test-lambda-dynamodb-stack/DynamoTable/Resource": [
|
|
104
|
+
{
|
|
105
|
+
"type": "aws:cdk:logicalId",
|
|
106
|
+
"data": "testlambdadynamodbstackDynamoTable8138E93B"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"/lamddb-add-secondary-index/BootstrapVersion": [
|
|
110
|
+
{
|
|
111
|
+
"type": "aws:cdk:logicalId",
|
|
112
|
+
"data": "BootstrapVersion"
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"/lamddb-add-secondary-index/CheckBootstrapVersion": [
|
|
116
|
+
{
|
|
117
|
+
"type": "aws:cdk:logicalId",
|
|
118
|
+
"data": "CheckBootstrapVersion"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"displayName": "lamddb-add-secondary-index"
|
|
123
|
+
},
|
|
124
|
+
"Tree": {
|
|
125
|
+
"type": "cdk:tree",
|
|
126
|
+
"properties": {
|
|
127
|
+
"file": "tree.json"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "tree-0.1",
|
|
3
|
+
"tree": {
|
|
4
|
+
"id": "App",
|
|
5
|
+
"path": "",
|
|
6
|
+
"children": {
|
|
7
|
+
"lamddb-add-secondary-index": {
|
|
8
|
+
"id": "lamddb-add-secondary-index",
|
|
9
|
+
"path": "lamddb-add-secondary-index",
|
|
10
|
+
"children": {
|
|
11
|
+
"test-lambda-dynamodb-stack": {
|
|
12
|
+
"id": "test-lambda-dynamodb-stack",
|
|
13
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack",
|
|
14
|
+
"children": {
|
|
15
|
+
"LambdaFunctionServiceRole": {
|
|
16
|
+
"id": "LambdaFunctionServiceRole",
|
|
17
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunctionServiceRole",
|
|
18
|
+
"children": {
|
|
19
|
+
"ImportLambdaFunctionServiceRole": {
|
|
20
|
+
"id": "ImportLambdaFunctionServiceRole",
|
|
21
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunctionServiceRole/ImportLambdaFunctionServiceRole",
|
|
22
|
+
"constructInfo": {
|
|
23
|
+
"fqn": "aws-cdk-lib.Resource",
|
|
24
|
+
"version": "2.118.0"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"Resource": {
|
|
28
|
+
"id": "Resource",
|
|
29
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunctionServiceRole/Resource",
|
|
30
|
+
"attributes": {
|
|
31
|
+
"aws:cdk:cloudformation:type": "AWS::IAM::Role",
|
|
32
|
+
"aws:cdk:cloudformation:props": {
|
|
33
|
+
"assumeRolePolicyDocument": {
|
|
34
|
+
"Statement": [
|
|
35
|
+
{
|
|
36
|
+
"Action": "sts:AssumeRole",
|
|
37
|
+
"Effect": "Allow",
|
|
38
|
+
"Principal": {
|
|
39
|
+
"Service": "lambda.amazonaws.com"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"Version": "2012-10-17"
|
|
44
|
+
},
|
|
45
|
+
"policies": [
|
|
46
|
+
{
|
|
47
|
+
"policyName": "LambdaFunctionServiceRolePolicy",
|
|
48
|
+
"policyDocument": {
|
|
49
|
+
"Statement": [
|
|
50
|
+
{
|
|
51
|
+
"Action": [
|
|
52
|
+
"logs:CreateLogGroup",
|
|
53
|
+
"logs:CreateLogStream",
|
|
54
|
+
"logs:PutLogEvents"
|
|
55
|
+
],
|
|
56
|
+
"Effect": "Allow",
|
|
57
|
+
"Resource": {
|
|
58
|
+
"Fn::Join": [
|
|
59
|
+
"",
|
|
60
|
+
[
|
|
61
|
+
"arn:",
|
|
62
|
+
{
|
|
63
|
+
"Ref": "AWS::Partition"
|
|
64
|
+
},
|
|
65
|
+
":logs:",
|
|
66
|
+
{
|
|
67
|
+
"Ref": "AWS::Region"
|
|
68
|
+
},
|
|
69
|
+
":",
|
|
70
|
+
{
|
|
71
|
+
"Ref": "AWS::AccountId"
|
|
72
|
+
},
|
|
73
|
+
":log-group:/aws/lambda/*"
|
|
74
|
+
]
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"Version": "2012-10-17"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"constructInfo": {
|
|
86
|
+
"fqn": "aws-cdk-lib.aws_iam.CfnRole",
|
|
87
|
+
"version": "2.118.0"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"DefaultPolicy": {
|
|
91
|
+
"id": "DefaultPolicy",
|
|
92
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunctionServiceRole/DefaultPolicy",
|
|
93
|
+
"children": {
|
|
94
|
+
"Resource": {
|
|
95
|
+
"id": "Resource",
|
|
96
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunctionServiceRole/DefaultPolicy/Resource",
|
|
97
|
+
"attributes": {
|
|
98
|
+
"aws:cdk:cloudformation:type": "AWS::IAM::Policy",
|
|
99
|
+
"aws:cdk:cloudformation:props": {
|
|
100
|
+
"policyDocument": {
|
|
101
|
+
"Statement": [
|
|
102
|
+
{
|
|
103
|
+
"Action": [
|
|
104
|
+
"xray:PutTelemetryRecords",
|
|
105
|
+
"xray:PutTraceSegments"
|
|
106
|
+
],
|
|
107
|
+
"Effect": "Allow",
|
|
108
|
+
"Resource": "*"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"Action": [
|
|
112
|
+
"dynamodb:BatchGetItem",
|
|
113
|
+
"dynamodb:BatchWriteItem",
|
|
114
|
+
"dynamodb:ConditionCheckItem",
|
|
115
|
+
"dynamodb:DeleteItem",
|
|
116
|
+
"dynamodb:DescribeTable",
|
|
117
|
+
"dynamodb:GetItem",
|
|
118
|
+
"dynamodb:GetRecords",
|
|
119
|
+
"dynamodb:GetShardIterator",
|
|
120
|
+
"dynamodb:PutItem",
|
|
121
|
+
"dynamodb:Query",
|
|
122
|
+
"dynamodb:Scan",
|
|
123
|
+
"dynamodb:UpdateItem"
|
|
124
|
+
],
|
|
125
|
+
"Effect": "Allow",
|
|
126
|
+
"Resource": [
|
|
127
|
+
{
|
|
128
|
+
"Fn::GetAtt": [
|
|
129
|
+
"testlambdadynamodbstackDynamoTable8138E93B",
|
|
130
|
+
"Arn"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"Fn::Join": [
|
|
135
|
+
"",
|
|
136
|
+
[
|
|
137
|
+
{
|
|
138
|
+
"Fn::GetAtt": [
|
|
139
|
+
"testlambdadynamodbstackDynamoTable8138E93B",
|
|
140
|
+
"Arn"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"/index/*"
|
|
144
|
+
]
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"Version": "2012-10-17"
|
|
151
|
+
},
|
|
152
|
+
"policyName": "testlambdadynamodbstackLambdaFunctionServiceRoleDefaultPolicy547FB7F4",
|
|
153
|
+
"roles": [
|
|
154
|
+
{
|
|
155
|
+
"Ref": "testlambdadynamodbstackLambdaFunctionServiceRole758347A1"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"constructInfo": {
|
|
161
|
+
"fqn": "aws-cdk-lib.aws_iam.CfnPolicy",
|
|
162
|
+
"version": "2.118.0"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"constructInfo": {
|
|
167
|
+
"fqn": "aws-cdk-lib.aws_iam.Policy",
|
|
168
|
+
"version": "2.118.0"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"constructInfo": {
|
|
173
|
+
"fqn": "aws-cdk-lib.aws_iam.Role",
|
|
174
|
+
"version": "2.118.0"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"LambdaFunction": {
|
|
178
|
+
"id": "LambdaFunction",
|
|
179
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunction",
|
|
180
|
+
"children": {
|
|
181
|
+
"Code": {
|
|
182
|
+
"id": "Code",
|
|
183
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunction/Code",
|
|
184
|
+
"children": {
|
|
185
|
+
"Stage": {
|
|
186
|
+
"id": "Stage",
|
|
187
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunction/Code/Stage",
|
|
188
|
+
"constructInfo": {
|
|
189
|
+
"fqn": "aws-cdk-lib.AssetStaging",
|
|
190
|
+
"version": "2.118.0"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"AssetBucket": {
|
|
194
|
+
"id": "AssetBucket",
|
|
195
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunction/Code/AssetBucket",
|
|
196
|
+
"constructInfo": {
|
|
197
|
+
"fqn": "aws-cdk-lib.aws_s3.BucketBase",
|
|
198
|
+
"version": "2.118.0"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"constructInfo": {
|
|
203
|
+
"fqn": "aws-cdk-lib.aws_s3_assets.Asset",
|
|
204
|
+
"version": "2.118.0"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"Resource": {
|
|
208
|
+
"id": "Resource",
|
|
209
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/LambdaFunction/Resource",
|
|
210
|
+
"attributes": {
|
|
211
|
+
"aws:cdk:cloudformation:type": "AWS::Lambda::Function",
|
|
212
|
+
"aws:cdk:cloudformation:props": {
|
|
213
|
+
"code": {
|
|
214
|
+
"s3Bucket": {
|
|
215
|
+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
|
|
216
|
+
},
|
|
217
|
+
"s3Key": "0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8.zip"
|
|
218
|
+
},
|
|
219
|
+
"environment": {
|
|
220
|
+
"variables": {
|
|
221
|
+
"AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
|
|
222
|
+
"DDB_TABLE_NAME": {
|
|
223
|
+
"Ref": "testlambdadynamodbstackDynamoTable8138E93B"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"handler": "index.handler",
|
|
228
|
+
"role": {
|
|
229
|
+
"Fn::GetAtt": [
|
|
230
|
+
"testlambdadynamodbstackLambdaFunctionServiceRole758347A1",
|
|
231
|
+
"Arn"
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"runtime": "nodejs16.x",
|
|
235
|
+
"tracingConfig": {
|
|
236
|
+
"mode": "Active"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"constructInfo": {
|
|
241
|
+
"fqn": "aws-cdk-lib.aws_lambda.CfnFunction",
|
|
242
|
+
"version": "2.118.0"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"constructInfo": {
|
|
247
|
+
"fqn": "aws-cdk-lib.aws_lambda.Function",
|
|
248
|
+
"version": "2.118.0"
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"DynamoTable": {
|
|
252
|
+
"id": "DynamoTable",
|
|
253
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/DynamoTable",
|
|
254
|
+
"children": {
|
|
255
|
+
"Resource": {
|
|
256
|
+
"id": "Resource",
|
|
257
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/DynamoTable/Resource",
|
|
258
|
+
"attributes": {
|
|
259
|
+
"aws:cdk:cloudformation:type": "AWS::DynamoDB::Table",
|
|
260
|
+
"aws:cdk:cloudformation:props": {
|
|
261
|
+
"attributeDefinitions": [
|
|
262
|
+
{
|
|
263
|
+
"attributeName": "id",
|
|
264
|
+
"attributeType": "S"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"attributeName": "id2",
|
|
268
|
+
"attributeType": "S"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"billingMode": "PAY_PER_REQUEST",
|
|
272
|
+
"globalSecondaryIndexes": [
|
|
273
|
+
{
|
|
274
|
+
"indexName": "test_id2",
|
|
275
|
+
"keySchema": [
|
|
276
|
+
{
|
|
277
|
+
"attributeName": "id2",
|
|
278
|
+
"keyType": "HASH"
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
"projection": {
|
|
282
|
+
"projectionType": "ALL"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"keySchema": [
|
|
287
|
+
{
|
|
288
|
+
"attributeName": "id",
|
|
289
|
+
"keyType": "HASH"
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"pointInTimeRecoverySpecification": {
|
|
293
|
+
"pointInTimeRecoveryEnabled": true
|
|
294
|
+
},
|
|
295
|
+
"sseSpecification": {
|
|
296
|
+
"sseEnabled": true
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"constructInfo": {
|
|
301
|
+
"fqn": "aws-cdk-lib.aws_dynamodb.CfnTable",
|
|
302
|
+
"version": "2.118.0"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"ScalingRole": {
|
|
306
|
+
"id": "ScalingRole",
|
|
307
|
+
"path": "lamddb-add-secondary-index/test-lambda-dynamodb-stack/DynamoTable/ScalingRole",
|
|
308
|
+
"constructInfo": {
|
|
309
|
+
"fqn": "aws-cdk-lib.Resource",
|
|
310
|
+
"version": "2.118.0"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"constructInfo": {
|
|
315
|
+
"fqn": "aws-cdk-lib.aws_dynamodb.Table",
|
|
316
|
+
"version": "2.118.0"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"constructInfo": {
|
|
321
|
+
"fqn": "@aws-solutions-constructs/aws-lambda-dynamodb.LambdaToDynamoDB",
|
|
322
|
+
"version": "2.50.0"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"Integ": {
|
|
326
|
+
"id": "Integ",
|
|
327
|
+
"path": "lamddb-add-secondary-index/Integ",
|
|
328
|
+
"children": {
|
|
329
|
+
"DefaultTest": {
|
|
330
|
+
"id": "DefaultTest",
|
|
331
|
+
"path": "lamddb-add-secondary-index/Integ/DefaultTest",
|
|
332
|
+
"children": {
|
|
333
|
+
"Default": {
|
|
334
|
+
"id": "Default",
|
|
335
|
+
"path": "lamddb-add-secondary-index/Integ/DefaultTest/Default",
|
|
336
|
+
"constructInfo": {
|
|
337
|
+
"fqn": "constructs.Construct",
|
|
338
|
+
"version": "10.0.0"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"DeployAssert": {
|
|
342
|
+
"id": "DeployAssert",
|
|
343
|
+
"path": "lamddb-add-secondary-index/Integ/DefaultTest/DeployAssert",
|
|
344
|
+
"children": {
|
|
345
|
+
"BootstrapVersion": {
|
|
346
|
+
"id": "BootstrapVersion",
|
|
347
|
+
"path": "lamddb-add-secondary-index/Integ/DefaultTest/DeployAssert/BootstrapVersion",
|
|
348
|
+
"constructInfo": {
|
|
349
|
+
"fqn": "aws-cdk-lib.CfnParameter",
|
|
350
|
+
"version": "2.118.0"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"CheckBootstrapVersion": {
|
|
354
|
+
"id": "CheckBootstrapVersion",
|
|
355
|
+
"path": "lamddb-add-secondary-index/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion",
|
|
356
|
+
"constructInfo": {
|
|
357
|
+
"fqn": "aws-cdk-lib.CfnRule",
|
|
358
|
+
"version": "2.118.0"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"constructInfo": {
|
|
363
|
+
"fqn": "aws-cdk-lib.Stack",
|
|
364
|
+
"version": "2.118.0"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"constructInfo": {
|
|
369
|
+
"fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase",
|
|
370
|
+
"version": "2.118.0-alpha.0"
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
"constructInfo": {
|
|
375
|
+
"fqn": "@aws-cdk/integ-tests-alpha.IntegTest",
|
|
376
|
+
"version": "2.118.0-alpha.0"
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"BootstrapVersion": {
|
|
380
|
+
"id": "BootstrapVersion",
|
|
381
|
+
"path": "lamddb-add-secondary-index/BootstrapVersion",
|
|
382
|
+
"constructInfo": {
|
|
383
|
+
"fqn": "aws-cdk-lib.CfnParameter",
|
|
384
|
+
"version": "2.118.0"
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
"CheckBootstrapVersion": {
|
|
388
|
+
"id": "CheckBootstrapVersion",
|
|
389
|
+
"path": "lamddb-add-secondary-index/CheckBootstrapVersion",
|
|
390
|
+
"constructInfo": {
|
|
391
|
+
"fqn": "aws-cdk-lib.CfnRule",
|
|
392
|
+
"version": "2.118.0"
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
"constructInfo": {
|
|
397
|
+
"fqn": "aws-cdk-lib.Stack",
|
|
398
|
+
"version": "2.118.0"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
"Tree": {
|
|
402
|
+
"id": "Tree",
|
|
403
|
+
"path": "Tree",
|
|
404
|
+
"constructInfo": {
|
|
405
|
+
"fqn": "constructs.Construct",
|
|
406
|
+
"version": "10.0.0"
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
"constructInfo": {
|
|
411
|
+
"fqn": "aws-cdk-lib.App",
|
|
412
|
+
"version": "2.118.0"
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
@@ -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));
|
|
@@ -41,6 +42,9 @@ const props = {
|
|
|
41
42
|
existingVpc: vpc
|
|
42
43
|
};
|
|
43
44
|
new lib_1.LambdaToDynamoDB(stack, "test-lambda-dynamodb-stack", props);
|
|
45
|
+
defaults.suppressCustomHandlerCfnNagWarnings(stack, 'Custom::VpcRestrictDefaultSGCustomResourceProvider');
|
|
44
46
|
// Synth
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
new integ_tests_alpha_1.IntegTest(stack, 'Integ', { testCases: [
|
|
48
|
+
stack
|
|
49
|
+
] });
|
|
50
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcubGFtZGRiLWRlcGxveUZ1bmN0aW9uV2l0aEV4aXN0aW5nVnBjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW50ZWcubGFtZGRiLWRlcGxveUZ1bmN0aW9uV2l0aEV4aXN0aW5nVnBjLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7R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VsdHMuQWRkQXdzU2VydmljZUVuZHBvaW50KHN0YWNrLCB2cGMsIGRlZmF1bHRzLlNlcnZpY2VFbmRwb2ludFR5cGVzLkRZTkFNT0RCKTtcblxuLy8gRGVmaW5pdGlvbnNcbmNvbnN0IHByb3BzOiBMYW1iZGFUb0R5bmFtb0RCUHJvcHMgPSB7XG4gIGxhbWJkYUZ1bmN0aW9uUHJvcHM6IHtcbiAgICBydW50aW1lOiBsYW1iZGEuUnVudGltZS5OT0RFSlNfMTZfWCxcbiAgICBoYW5kbGVyOiBcImluZGV4LmhhbmRsZXJcIixcbiAgICBjb2RlOiBsYW1iZGEuQ29kZS5mcm9tQXNzZXQoYCR7X19kaXJuYW1lfS9sYW1iZGFgKSxcbiAgfSxcbiAgZXhpc3RpbmdWcGM6IHZwY1xufTtcblxubmV3IExhbWJkYVRvRHluYW1vREIoc3RhY2ssIFwidGVzdC1sYW1iZGEtZHluYW1vZGItc3RhY2tcIiwgcHJvcHMpO1xuXG5kZWZhdWx0cy5zdXBwcmVzc0N1c3RvbUhhbmRsZXJDZm5OYWdXYXJuaW5ncyhzdGFjaywgJ0N1c3RvbTo6VnBjUmVzdHJpY3REZWZhdWx0U0dDdXN0b21SZXNvdXJjZVByb3ZpZGVyJyk7XG5cbi8vIFN5bnRoXG5uZXcgSW50ZWdUZXN0KHN0YWNrLCAnSW50ZWcnLCB7IHRlc3RDYXNlczogW1xuICBzdGFja1xuXSB9KTtcbiJdfQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withRetries=exports.handler=exports.external=void 0;const https=require("https"),url=require("url");exports.external={sendHttpRequest:defaultSendHttpRequest,log:defaultLog,includeStackTraces:!0,userHandlerIndex:"./index"};const CREATE_FAILED_PHYSICAL_ID_MARKER="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",MISSING_PHYSICAL_ID_MARKER="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";async function handler(event,context){const sanitizedEvent={...event,ResponseURL:"..."};if(exports.external.log(JSON.stringify(sanitizedEvent,void 0,2)),event.RequestType==="Delete"&&event.PhysicalResourceId===CREATE_FAILED_PHYSICAL_ID_MARKER){exports.external.log("ignoring DELETE event caused by a failed CREATE event"),await submitResponse("SUCCESS",event);return}try{const userHandler=require(exports.external.userHandlerIndex).handler,result=await userHandler(sanitizedEvent,context),responseEvent=renderResponse(event,result);await submitResponse("SUCCESS",responseEvent)}catch(e){const resp={...event,Reason:exports.external.includeStackTraces?e.stack:e.message};resp.PhysicalResourceId||(event.RequestType==="Create"?(exports.external.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),resp.PhysicalResourceId=CREATE_FAILED_PHYSICAL_ID_MARKER):exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`)),await submitResponse("FAILED",resp)}}exports.handler=handler;function renderResponse(cfnRequest,handlerResponse={}){const physicalResourceId=handlerResponse.PhysicalResourceId??cfnRequest.PhysicalResourceId??cfnRequest.RequestId;if(cfnRequest.RequestType==="Delete"&&physicalResourceId!==cfnRequest.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`);return{...cfnRequest,...handlerResponse,PhysicalResourceId:physicalResourceId}}async function submitResponse(status,event){const json={Status:status,Reason:event.Reason??status,StackId:event.StackId,RequestId:event.RequestId,PhysicalResourceId:event.PhysicalResourceId||MISSING_PHYSICAL_ID_MARKER,LogicalResourceId:event.LogicalResourceId,NoEcho:event.NoEcho,Data:event.Data};exports.external.log("submit response to cloudformation",json);const responseBody=JSON.stringify(json),parsedUrl=url.parse(event.ResponseURL),req={hostname:parsedUrl.hostname,path:parsedUrl.path,method:"PUT",headers:{"content-type":"","content-length":Buffer.byteLength(responseBody,"utf8")}};await withRetries({attempts:5,sleep:1e3},exports.external.sendHttpRequest)(req,responseBody)}async function defaultSendHttpRequest(options,responseBody){return new Promise((resolve,reject)=>{try{const request=https.request(options,_=>resolve());request.on("error",reject),request.write(responseBody),request.end()}catch(e){reject(e)}})}function defaultLog(fmt,...params){console.log(fmt,...params)}function withRetries(options,fn){return async(...xs)=>{let attempts=options.attempts,ms=options.sleep;for(;;)try{return await fn(...xs)}catch(e){if(attempts--<=0)throw e;await sleep(Math.floor(Math.random()*ms)),ms*=2}}}exports.withRetries=withRetries;async function sleep(ms){return new Promise(ok=>setTimeout(ok,ms))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var I=Object.create,t=Object.defineProperty,y=Object.getOwnPropertyDescriptor,P=Object.getOwnPropertyNames,g=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,G=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},n=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!l.call(r,s)&&s!==o&&t(r,s,{get:()=>e[s],enumerable:!(i=y(e,s))||i.enumerable});return r},R=(r,e,o)=>(o=r!=null?I(g(r)):{},n(e||!r||!r.__esModule?t(o,"default",{value:r,enumerable:!0}):o,r)),S=r=>n(t({},"__esModule",{value:!0}),r),k={};G(k,{handler:()=>f}),module.exports=S(k);var a=R(require("@aws-sdk/client-ec2")),u=new a.EC2({});function c(r,e){return{GroupId:r,IpPermissions:[{UserIdGroupPairs:[{GroupId:r,UserId:e}],IpProtocol:"-1"}]}}function d(r){return{GroupId:r,IpPermissions:[{IpRanges:[{CidrIp:"0.0.0.0/0"}],IpProtocol:"-1"}]}}async function f(r){let e=r.ResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.Account;switch(r.RequestType){case"Create":return p(e,o);case"Update":return h(r);case"Delete":return m(e,o)}}async function h(r){let e=r.OldResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.DefaultSecurityGroupId;e!==o&&(await m(e,r.ResourceProperties.Account),await p(o,r.ResourceProperties.Account))}async function p(r,e){try{await u.revokeSecurityGroupEgress(d(r))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}try{await u.revokeSecurityGroupIngress(c(r,e))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}}async function m(r,e){await u.authorizeSecurityGroupIngress(c(r,e)),await u.authorizeSecurityGroupEgress(d(r))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"36.0.0"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "36.0.0",
|
|
3
|
+
"testCases": {
|
|
4
|
+
"lamddb-deployFunctionWithExistingVpc/Integ/DefaultTest": {
|
|
5
|
+
"stacks": [
|
|
6
|
+
"lamddb-deployFunctionWithExistingVpc"
|
|
7
|
+
],
|
|
8
|
+
"assertionStack": "lamddb-deployFunctionWithExistingVpc/Integ/DefaultTest/DeployAssert",
|
|
9
|
+
"assertionStackName": "lamddbdeployFunctionWithExistingVpcIntegDefaultTestDeployAssertEE08E38E"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|