File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
src/lib/custom-resources/cdk-s3-update-logarchive-bucket-policy/runtime/src Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -200,14 +200,12 @@ async function onDelete(event: CloudFormationCustomResourceDeleteEvent) {
200200 let keyPolicy = await getKmsKeyPolicy ( props . logBucketKmsKeyArn ) ;
201201
202202 if ( Object . keys ( bucketPolicy ) . length > 0 ) {
203- const updatedStatements = removeExistingReadOnlyStatement ( bucketPolicy . Statement ) ;
204- bucketPolicy . Statement = updatedStatements ;
203+ bucketPolicy = removeExistingReadOnlyStatement ( bucketPolicy ) ;
205204 const response = await putBucketPolicy ( props . logBucketName , JSON . stringify ( bucketPolicy ) ) ;
206205 }
207206
208207 if ( Object . keys ( keyPolicy ) . length > 0 ) {
209- const updatedStatements = removeExistingReadOnlyStatement ( keyPolicy . Statement ) ;
210- keyPolicy . Statement = updatedStatements ;
208+ keyPolicy = removeExistingReadOnlyStatement ( keyPolicy ) ;
211209 const response = await putKmsKeyPolicy ( props . logBucketKmsKeyArn , JSON . stringify ( keyPolicy ) ) ;
212210 }
213211 return { } ;
You can’t perform that action at this time.
0 commit comments