mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-23 07:02:57 -06:00
provider/aws: Suceed deleting bucket policy on err (#9641)
If there is no bucket, a bucket policy can be counted as successfully deleted.
This commit is contained in:
parent
68d865f46e
commit
54e4deb3e3
@ -100,6 +100,9 @@ func resourceAwsS3BucketPolicyDelete(d *schema.ResourceData, meta interface{}) e
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchBucket" {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("Error deleting S3 policy: %s", err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user