Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(opensearch): log group policies ignore incorrect error code on delete #22364

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -42,7 +42,7 @@ export class LogGroupResourcePolicy extends cr.AwsCustomResource {
parameters: {
policyName: props.policyName,
},
ignoreErrorCodesMatching: '400',
ignoreErrorCodesMatching: 'ResourceNotFoundException',
},
policy: cr.AwsCustomResourcePolicy.fromSdkCalls({ resources: ['*'] }),
});
Expand Down
Expand Up @@ -104,7 +104,7 @@
]
]
},
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc82ca7bfe2f2589b859ebab89e88da2efd284adfad\"},\"ignoreErrorCodesMatching\":\"400\"}",
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc82ca7bfe2f2589b859ebab89e88da2efd284adfad\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}",
"InstallLatestAwsSdk": true
},
"DependsOn": [
Expand Down
Expand Up @@ -69,7 +69,7 @@
]
]
},
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc8858d5dba055f677469d76cb6ad538fd732ba69a6\"},\"ignoreErrorCodesMatching\":\"400\"}",
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc8858d5dba055f677469d76cb6ad538fd732ba69a6\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}",
"InstallLatestAwsSdk": true
},
"DependsOn": [
Expand Down Expand Up @@ -377,7 +377,7 @@
]
]
},
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc8405238e455eeabd840cf6933e1814efc51d2de71\"},\"ignoreErrorCodesMatching\":\"400\"}",
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc8405238e455eeabd840cf6933e1814efc51d2de71\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}",
"InstallLatestAwsSdk": true
},
"DependsOn": [
Expand Down
Expand Up @@ -59,7 +59,7 @@ test('minimal example renders correctly', () => {
parameters: {
policyName: 'TestPolicy',
},
ignoreErrorCodesMatching: '400',
ignoreErrorCodesMatching: 'ResourceNotFoundException',
}),
});
});
Expand Up @@ -42,7 +42,7 @@ export class LogGroupResourcePolicy extends cr.AwsCustomResource {
parameters: {
policyName: props.policyName,
},
ignoreErrorCodesMatching: '400',
ignoreErrorCodesMatching: 'ResourceNotFoundException',
},
policy: cr.AwsCustomResourcePolicy.fromSdkCalls({ resources: ['*'] }),
});
Expand Down
Expand Up @@ -59,7 +59,7 @@ test('minimal example renders correctly', () => {
parameters: {
policyName: 'TestPolicy',
},
ignoreErrorCodesMatching: '400',
ignoreErrorCodesMatching: 'ResourceNotFoundException',
}),
});
});
Expand Up @@ -69,7 +69,7 @@
]
]
},
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc881416c4fcb1ec2b4bf7f47a5cde4097f01ec50fc\"},\"ignoreErrorCodesMatching\":\"400\"}",
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc881416c4fcb1ec2b4bf7f47a5cde4097f01ec50fc\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}",
"InstallLatestAwsSdk": true
},
"DependsOn": [
Expand Down Expand Up @@ -374,7 +374,7 @@
]
]
},
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc80140a7754e9c0dd4e81167ef19e15da5b55dca02\"},\"ignoreErrorCodesMatching\":\"400\"}",
"Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc80140a7754e9c0dd4e81167ef19e15da5b55dca02\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}",
"InstallLatestAwsSdk": true
},
"DependsOn": [
Expand Down