Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/deployments/cdk/src/deployments/iam/step-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ export async function createConfigServiceRoles(props: IamConfigServiceRoleProps)
managedPolicies: [iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSConfigRole')],
});

/**
*
* As per the documentation, the config role should have
* the s3:PutObject permission to avoid access denied issues
* while AWS config tries to check the s3 bucket (in another account) write permissions
* https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html
*
*/
configRecorderRole.addToPrincipalPolicy(
new iam.PolicyStatement({
actions: ['s3:PutObject'],
resources: ['*'],
}),
);

new CfnIamRoleOutput(accountStack, `ConfigRecorderRoleOutput`, {
roleName: configRecorderRole.roleName,
roleArn: configRecorderRole.roleArn,
Expand Down