Skip to content

Commit 015d122

Browse files
fix(core): z116 aws config permissions (#354)
* fixed HeadBucket access denied issue * added comment * fixed lint issues
1 parent 4a8f8de commit 015d122

File tree

1 file changed

+9
-0
lines changed
  • src/deployments/cdk/src/deployments/defaults

1 file changed

+9
-0
lines changed

src/deployments/cdk/src/deployments/defaults/step-1.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@ function createCentralLogBucket(props: DefaultsStep1Props) {
234234
}),
235235
);
236236

237+
// Permission to allow checking existence of AWSConfig bucket
238+
logBucket.addToResourcePolicy(
239+
new iam.PolicyStatement({
240+
principals: [new iam.ServicePrincipal('config.amazonaws.com')],
241+
actions: ['s3:ListBucket'],
242+
resources: [`${logBucket.bucketArn}`],
243+
}),
244+
);
245+
237246
// Allow cross account encrypt access for logArchive bucket
238247
logBucket.encryptionKey?.addToResourcePolicy(
239248
new iam.PolicyStatement({

0 commit comments

Comments
 (0)