Skip to content

Commit c3003ab

Browse files
authored
feat(codebuild): add deleteReports property to the ReportGroup Construct (#30141)
### Issue # (if applicable) N/A ### Reason for this change Missing property in the L2 Construct. ### Description of changes Add deleteReports property. https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.CfnReportGroup.html#deletereports ### Description of how you validated changes Add unit tests and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 555d1c7 commit c3003ab

12 files changed

+854
-1
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.report-group-delete-reports.js.snapshot/ReportGroupDeleteReportsIntegTestDefaultTestDeployAssertFBD2FDC0.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.report-group-delete-reports.js.snapshot/ReportGroupDeleteReportsIntegTestDefaultTestDeployAssertFBD2FDC0.template.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.report-group-delete-reports.js.snapshot/aws-cdk-report-group-delete-reports.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
{
2+
"Resources": {
3+
"TestReportGroupDeleteReportsE2EEFA13": {
4+
"Type": "AWS::CodeBuild::ReportGroup",
5+
"Properties": {
6+
"DeleteReports": true,
7+
"ExportConfig": {
8+
"ExportConfigType": "NO_EXPORT"
9+
},
10+
"Type": "TEST"
11+
},
12+
"UpdateReplacePolicy": "Delete",
13+
"DeletionPolicy": "Delete"
14+
},
15+
"MyProjectRole9BBE5233": {
16+
"Type": "AWS::IAM::Role",
17+
"Properties": {
18+
"AssumeRolePolicyDocument": {
19+
"Statement": [
20+
{
21+
"Action": "sts:AssumeRole",
22+
"Effect": "Allow",
23+
"Principal": {
24+
"Service": "codebuild.amazonaws.com"
25+
}
26+
}
27+
],
28+
"Version": "2012-10-17"
29+
}
30+
}
31+
},
32+
"MyProjectRoleDefaultPolicyB19B7C29": {
33+
"Type": "AWS::IAM::Policy",
34+
"Properties": {
35+
"PolicyDocument": {
36+
"Statement": [
37+
{
38+
"Action": [
39+
"logs:CreateLogGroup",
40+
"logs:CreateLogStream",
41+
"logs:PutLogEvents"
42+
],
43+
"Effect": "Allow",
44+
"Resource": [
45+
{
46+
"Fn::Join": [
47+
"",
48+
[
49+
"arn:",
50+
{
51+
"Ref": "AWS::Partition"
52+
},
53+
":logs:",
54+
{
55+
"Ref": "AWS::Region"
56+
},
57+
":",
58+
{
59+
"Ref": "AWS::AccountId"
60+
},
61+
":log-group:/aws/codebuild/",
62+
{
63+
"Ref": "MyProject39F7B0AE"
64+
},
65+
":*"
66+
]
67+
]
68+
},
69+
{
70+
"Fn::Join": [
71+
"",
72+
[
73+
"arn:",
74+
{
75+
"Ref": "AWS::Partition"
76+
},
77+
":logs:",
78+
{
79+
"Ref": "AWS::Region"
80+
},
81+
":",
82+
{
83+
"Ref": "AWS::AccountId"
84+
},
85+
":log-group:/aws/codebuild/",
86+
{
87+
"Ref": "MyProject39F7B0AE"
88+
}
89+
]
90+
]
91+
}
92+
]
93+
},
94+
{
95+
"Action": [
96+
"codebuild:BatchPutTestCases",
97+
"codebuild:CreateReport",
98+
"codebuild:UpdateReport"
99+
],
100+
"Effect": "Allow",
101+
"Resource": {
102+
"Fn::GetAtt": [
103+
"TestReportGroupDeleteReportsE2EEFA13",
104+
"Arn"
105+
]
106+
}
107+
}
108+
],
109+
"Version": "2012-10-17"
110+
},
111+
"PolicyName": "MyProjectRoleDefaultPolicyB19B7C29",
112+
"Roles": [
113+
{
114+
"Ref": "MyProjectRole9BBE5233"
115+
}
116+
]
117+
}
118+
},
119+
"MyProject39F7B0AE": {
120+
"Type": "AWS::CodeBuild::Project",
121+
"Properties": {
122+
"Artifacts": {
123+
"Type": "NO_ARTIFACTS"
124+
},
125+
"Cache": {
126+
"Type": "NO_CACHE"
127+
},
128+
"EncryptionKey": "alias/aws/s3",
129+
"Environment": {
130+
"ComputeType": "BUILD_GENERAL1_SMALL",
131+
"Image": "aws/codebuild/standard:1.0",
132+
"ImagePullCredentialsType": "CODEBUILD",
133+
"PrivilegedMode": false,
134+
"Type": "LINUX_CONTAINER"
135+
},
136+
"ServiceRole": {
137+
"Fn::GetAtt": [
138+
"MyProjectRole9BBE5233",
139+
"Arn"
140+
]
141+
},
142+
"Source": {
143+
"BuildSpec": {
144+
"Fn::Join": [
145+
"",
146+
[
147+
"{\n \"version\": \"0.2\",\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"echo \\\"Nothing to do!\\\"\"\n ]\n }\n },\n \"reports\": {\n \"",
148+
{
149+
"Fn::GetAtt": [
150+
"TestReportGroupDeleteReportsE2EEFA13",
151+
"Arn"
152+
]
153+
},
154+
"\": {\n \"base-directory\": \"test-reports\",\n \"file-format\": \"JUNITXML\",\n \"files\": [\n \"**/*\"\n ]\n }\n }\n}"
155+
]
156+
]
157+
},
158+
"Type": "NO_SOURCE"
159+
}
160+
}
161+
}
162+
},
163+
"Parameters": {
164+
"BootstrapVersion": {
165+
"Type": "AWS::SSM::Parameter::Value<String>",
166+
"Default": "/cdk-bootstrap/hnb659fds/version",
167+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
168+
}
169+
},
170+
"Rules": {
171+
"CheckBootstrapVersion": {
172+
"Assertions": [
173+
{
174+
"Assert": {
175+
"Fn::Not": [
176+
{
177+
"Fn::Contains": [
178+
[
179+
"1",
180+
"2",
181+
"3",
182+
"4",
183+
"5"
184+
],
185+
{
186+
"Ref": "BootstrapVersion"
187+
}
188+
]
189+
}
190+
]
191+
},
192+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
193+
}
194+
]
195+
}
196+
}
197+
}

packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.report-group-delete-reports.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.report-group-delete-reports.js.snapshot/integ.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)