Skip to content

Commit 9e1388d

Browse files
chore(iam): update integ tests to use IntegTest construct (#24151)
> REPLACE THIS TEXT BLOCK > > Describe the reason for this change, what the solution is, and any > important design decisions you made. > > Remember to follow the [CONTRIBUTING GUIDE] and [DESIGN GUIDELINES] for any > code you submit. > > [CONTRIBUTING GUIDE]: https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md > [DESIGN GUIDELINES]: https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md Closes #<issue number here>. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent eee005f commit 9e1388d

File tree

115 files changed

+2331
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2331
-541
lines changed

packages/@aws-cdk/aws-iam/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
"devDependencies": {
8383
"@aws-cdk/assertions": "0.0.0",
8484
"@aws-cdk/cdk-build-tools": "0.0.0",
85-
"@aws-cdk/integ-tests": "0.0.0",
8685
"@aws-cdk/integ-runner": "0.0.0",
8786
"@aws-cdk/integ-tests": "0.0.0",
8887
"@aws-cdk/cfn2ts": "0.0.0",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"20.0.0"}
1+
{"version":"30.0.0"}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "30.0.0",
3+
"files": {
4+
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5+
"source": {
6+
"path": "iamaccesskey1DefaultTestDeployAssert00360C89.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+
}
Original file line numberDiff line numberDiff line change
@@ -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+
}

packages/@aws-cdk/aws-iam/test/integ.access-key.js.snapshot/integ-iam-access-key-1.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "20.0.0",
2+
"version": "30.0.0",
33
"files": {
44
"69e05eb7844cf593041f8404d87f7b0b4f0f71044f328c497d24f5dad7bae04c": {
55
"source": {
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
2-
"version": "20.0.0",
2+
"version": "30.0.0",
33
"testCases": {
4-
"integ.access-key": {
4+
"iam-access-key-1/DefaultTest": {
55
"stacks": [
66
"integ-iam-access-key-1"
77
],
8-
"diffAssets": false,
9-
"stackUpdateWorkflow": true
8+
"assertionStack": "iam-access-key-1/DefaultTest/DeployAssert",
9+
"assertionStackName": "iamaccesskey1DefaultTestDeployAssert00360C89"
1010
}
11-
},
12-
"synthContext": {},
13-
"enableLookups": false
11+
}
1412
}

packages/@aws-cdk/aws-iam/test/integ.access-key.js.snapshot/manifest.json

+54-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
2-
"version": "20.0.0",
2+
"version": "30.0.0",
33
"artifacts": {
4-
"Tree": {
5-
"type": "cdk:tree",
6-
"properties": {
7-
"file": "tree.json"
8-
}
9-
},
104
"integ-iam-access-key-1.assets": {
115
"type": "cdk:asset-manifest",
126
"properties": {
@@ -71,6 +65,59 @@
7165
]
7266
},
7367
"displayName": "integ-iam-access-key-1"
68+
},
69+
"iamaccesskey1DefaultTestDeployAssert00360C89.assets": {
70+
"type": "cdk:asset-manifest",
71+
"properties": {
72+
"file": "iamaccesskey1DefaultTestDeployAssert00360C89.assets.json",
73+
"requiresBootstrapStackVersion": 6,
74+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
75+
}
76+
},
77+
"iamaccesskey1DefaultTestDeployAssert00360C89": {
78+
"type": "aws:cloudformation:stack",
79+
"environment": "aws://unknown-account/unknown-region",
80+
"properties": {
81+
"templateFile": "iamaccesskey1DefaultTestDeployAssert00360C89.template.json",
82+
"validateOnSynth": false,
83+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
84+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
85+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
86+
"requiresBootstrapStackVersion": 6,
87+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
88+
"additionalDependencies": [
89+
"iamaccesskey1DefaultTestDeployAssert00360C89.assets"
90+
],
91+
"lookupRole": {
92+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
93+
"requiresBootstrapStackVersion": 8,
94+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
95+
}
96+
},
97+
"dependencies": [
98+
"iamaccesskey1DefaultTestDeployAssert00360C89.assets"
99+
],
100+
"metadata": {
101+
"/iam-access-key-1/DefaultTest/DeployAssert/BootstrapVersion": [
102+
{
103+
"type": "aws:cdk:logicalId",
104+
"data": "BootstrapVersion"
105+
}
106+
],
107+
"/iam-access-key-1/DefaultTest/DeployAssert/CheckBootstrapVersion": [
108+
{
109+
"type": "aws:cdk:logicalId",
110+
"data": "CheckBootstrapVersion"
111+
}
112+
]
113+
},
114+
"displayName": "iam-access-key-1/DefaultTest/DeployAssert"
115+
},
116+
"Tree": {
117+
"type": "cdk:tree",
118+
"properties": {
119+
"file": "tree.json"
120+
}
74121
}
75122
}
76123
}

packages/@aws-cdk/aws-iam/test/integ.access-key.js.snapshot/tree.json

+83-13
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
"id": "App",
55
"path": "",
66
"children": {
7-
"Tree": {
8-
"id": "Tree",
9-
"path": "Tree",
10-
"constructInfo": {
11-
"fqn": "constructs.Construct",
12-
"version": "10.1.85"
13-
}
14-
},
157
"integ-iam-access-key-1": {
168
"id": "integ-iam-access-key-1",
179
"path": "integ-iam-access-key-1",
@@ -68,20 +60,98 @@
6860
"id": "AccessKeyId",
6961
"path": "integ-iam-access-key-1/AccessKeyId",
7062
"constructInfo": {
71-
"fqn": "constructs.Construct",
72-
"version": "10.1.85"
63+
"fqn": "@aws-cdk/core.CfnOutput",
64+
"version": "0.0.0"
65+
}
66+
},
67+
"BootstrapVersion": {
68+
"id": "BootstrapVersion",
69+
"path": "integ-iam-access-key-1/BootstrapVersion",
70+
"constructInfo": {
71+
"fqn": "@aws-cdk/core.CfnParameter",
72+
"version": "0.0.0"
73+
}
74+
},
75+
"CheckBootstrapVersion": {
76+
"id": "CheckBootstrapVersion",
77+
"path": "integ-iam-access-key-1/CheckBootstrapVersion",
78+
"constructInfo": {
79+
"fqn": "@aws-cdk/core.CfnRule",
80+
"version": "0.0.0"
7381
}
7482
}
7583
},
84+
"constructInfo": {
85+
"fqn": "@aws-cdk/core.Stack",
86+
"version": "0.0.0"
87+
}
88+
},
89+
"iam-access-key-1": {
90+
"id": "iam-access-key-1",
91+
"path": "iam-access-key-1",
92+
"children": {
93+
"DefaultTest": {
94+
"id": "DefaultTest",
95+
"path": "iam-access-key-1/DefaultTest",
96+
"children": {
97+
"Default": {
98+
"id": "Default",
99+
"path": "iam-access-key-1/DefaultTest/Default",
100+
"constructInfo": {
101+
"fqn": "constructs.Construct",
102+
"version": "10.1.249"
103+
}
104+
},
105+
"DeployAssert": {
106+
"id": "DeployAssert",
107+
"path": "iam-access-key-1/DefaultTest/DeployAssert",
108+
"children": {
109+
"BootstrapVersion": {
110+
"id": "BootstrapVersion",
111+
"path": "iam-access-key-1/DefaultTest/DeployAssert/BootstrapVersion",
112+
"constructInfo": {
113+
"fqn": "@aws-cdk/core.CfnParameter",
114+
"version": "0.0.0"
115+
}
116+
},
117+
"CheckBootstrapVersion": {
118+
"id": "CheckBootstrapVersion",
119+
"path": "iam-access-key-1/DefaultTest/DeployAssert/CheckBootstrapVersion",
120+
"constructInfo": {
121+
"fqn": "@aws-cdk/core.CfnRule",
122+
"version": "0.0.0"
123+
}
124+
}
125+
},
126+
"constructInfo": {
127+
"fqn": "@aws-cdk/core.Stack",
128+
"version": "0.0.0"
129+
}
130+
}
131+
},
132+
"constructInfo": {
133+
"fqn": "@aws-cdk/integ-tests.IntegTestCase",
134+
"version": "0.0.0"
135+
}
136+
}
137+
},
138+
"constructInfo": {
139+
"fqn": "@aws-cdk/integ-tests.IntegTest",
140+
"version": "0.0.0"
141+
}
142+
},
143+
"Tree": {
144+
"id": "Tree",
145+
"path": "Tree",
76146
"constructInfo": {
77147
"fqn": "constructs.Construct",
78-
"version": "10.1.85"
148+
"version": "10.1.249"
79149
}
80150
}
81151
},
82152
"constructInfo": {
83-
"fqn": "constructs.Construct",
84-
"version": "10.1.85"
153+
"fqn": "@aws-cdk/core.App",
154+
"version": "0.0.0"
85155
}
86156
}
87157
}

packages/@aws-cdk/aws-iam/test/integ.access-key.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { App, CfnOutput, Stack } from '@aws-cdk/core';
2+
import { IntegTest } from '@aws-cdk/integ-tests';
23
import { AccessKey, User } from '../lib';
34

45
const app = new App();
@@ -9,4 +10,8 @@ const accessKey = new AccessKey(stack, 'TestAccessKey', { user });
910

1011
new CfnOutput(stack, 'AccessKeyId', { value: accessKey.accessKeyId });
1112

13+
new IntegTest(app, 'iam-access-key-1', {
14+
testCases: [stack],
15+
});
16+
1217
app.synth();
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"20.0.0"}
1+
{"version":"30.0.0"}

packages/@aws-cdk/aws-iam/test/integ.composite-principal.js.snapshot/iam-integ-composite-principal.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"files": {
44
"3578a01f103e8c62fb5829a4bb0e5ee48141025197ba209fb3f42bb70e480a11": {
55
"source": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "30.0.0",
3+
"files": {
4+
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5+
"source": {
6+
"path": "iamintegcompositeprincipaltestDefaultTestDeployAssertDD256D71.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+
}
Original file line numberDiff line numberDiff line change
@@ -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 commit comments

Comments
 (0)