Skip to content

Commit 70a420b

Browse files
committed
Remove replication configuration as deployment role lacks s3:PutReplicationConfiguration permission
1 parent 5427e8a commit 70a420b

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

packages/cdk/stacks/EpsAssistMeStack.ts

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,20 @@ export class EpsAssistMeStack extends Stack {
6262
objectOwnership: ObjectOwnership.BUCKET_OWNER_ENFORCED
6363
})
6464

65-
// Replication config via escape hatch
65+
// Get the underlying CFN resource
6666
const accessLogBucketCfn = accessLogBucket.node.defaultChild as AWSCDK.CfnBucket
67-
accessLogBucketCfn.replicationConfiguration = {
68-
role: `arn:aws:iam::${account}:role/account-resources-s3-replication-role`,
69-
rules: [{
70-
status: "Enabled",
71-
priority: 1,
72-
destination: {
73-
bucket: "arn:aws:s3:::dummy-replication-bucket"
74-
},
75-
deleteMarkerReplication: {status: "Disabled"}
76-
}]
77-
}
67+
// Removed replication configuration as deployment role lacks s3:PutReplicationConfiguration permission
68+
// accessLogBucketCfn.replicationConfiguration = {
69+
// role: `arn:aws:iam::${account}:role/account-resources-s3-replication-role`,
70+
// rules: [{
71+
// status: "Enabled",
72+
// priority: 1,
73+
// destination: {
74+
// bucket: "arn:aws:s3:::dummy-replication-bucket"
75+
// },
76+
// deleteMarkerReplication: {status: "Disabled"}
77+
// }]
78+
// }
7879

7980
// TLS-only policy (strictly compliant for cfn-guard)
8081
new AWSCDK.CfnBucketPolicy(this, "AccessLogsBucketTlsPolicy", {
@@ -110,19 +111,20 @@ export class EpsAssistMeStack extends Stack {
110111
serverAccessLogsPrefix: "s3-access-logs/"
111112
})
112113

113-
// Replication config via escape hatch
114+
// Get the underlying CFN resource
114115
const kbDocsBucketCfn = kbDocsBucket.node.defaultChild as AWSCDK.CfnBucket
115-
kbDocsBucketCfn.replicationConfiguration = {
116-
role: `arn:aws:iam::${account}:role/account-resources-s3-replication-role`,
117-
rules: [{
118-
status: "Enabled",
119-
priority: 1,
120-
destination: {
121-
bucket: "arn:aws:s3:::dummy-replication-bucket"
122-
},
123-
deleteMarkerReplication: {status: "Disabled"}
124-
}]
125-
}
116+
// Removed replication configuration as deployment role lacks s3:PutReplicationConfiguration permission
117+
// kbDocsBucketCfn.replicationConfiguration = {
118+
// role: `arn:aws:iam::${account}:role/account-resources-s3-replication-role`,
119+
// rules: [{
120+
// status: "Enabled",
121+
// priority: 1,
122+
// destination: {
123+
// bucket: "arn:aws:s3:::dummy-replication-bucket"
124+
// },
125+
// deleteMarkerReplication: {status: "Disabled"}
126+
// }]
127+
// }
126128

127129
// TLS-only policy (strictly compliant for cfn-guard)
128130
new AWSCDK.CfnBucketPolicy(this, "KbDocsTlsPolicy", {

0 commit comments

Comments
 (0)