Merge pull request #529 from cloudskiff/fix/sqs_queue_migration_policy

fix policy not deleted when empty
main
William BEUIL 2021-05-19 17:31:00 +02:00 committed by GitHub
commit 41f37f70a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -62,6 +62,7 @@ func (m AwsSqsQueuePolicyExpander) Execute(remoteResources, resourcesFromState *
func (m *AwsSqsQueuePolicyExpander) handlePolicy(queue *resource.AbstractResource, results *[]resource.Resource) error {
policy, exists := queue.Attrs.Get("policy")
if !exists || policy.(string) == "" {
queue.Attrs.SafeDelete([]string{"policy"})
return nil
}