Skip to content

Commit 093fad8

Browse files
fix(core): z116 aws config permissions (#359)
* adding putObject permissiong from master account to log-archive account s3 bucket to avoid CloudTrail error AccessDenied messages
1 parent 74f8cc9 commit 093fad8

File tree

1 file changed

+15
-0
lines changed
  • src/deployments/cdk/src/deployments/iam

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ export async function createConfigServiceRoles(props: IamConfigServiceRoleProps)
2929
managedPolicies: [iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSConfigRole')],
3030
});
3131

32+
/**
33+
*
34+
* As per the documentation, the config role should have
35+
* the s3:PutObject permission to avoid access denied issues
36+
* while AWS config tries to check the s3 bucket (in another account) write permissions
37+
* https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html
38+
*
39+
*/
40+
configRecorderRole.addToPrincipalPolicy(
41+
new iam.PolicyStatement({
42+
actions: ['s3:PutObject'],
43+
resources: ['*'],
44+
}),
45+
);
46+
3247
new CfnIamRoleOutput(accountStack, `ConfigRecorderRoleOutput`, {
3348
roleName: configRecorderRole.roleName,
3449
roleArn: configRecorderRole.roleArn,

0 commit comments

Comments
 (0)