Skip to content

Commit

Permalink
r/s3_bucket_acl: add warning log when deleting from state
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 committed Feb 4, 2022
1 parent e77df37 commit c913409
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/service/s3/bucket_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func ResourceBucketAcl() *schema.Resource {
CreateContext: resourceBucketAclCreate,
ReadContext: resourceBucketAclRead,
UpdateContext: resourceBucketAclUpdate,
DeleteContext: schema.NoopContext,
DeleteContext: resourceBucketAclDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down Expand Up @@ -243,6 +243,11 @@ func resourceBucketAclUpdate(ctx context.Context, d *schema.ResourceData, meta i
return resourceBucketAclRead(ctx, d, meta)
}

func resourceBucketAclDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
log.Printf("[WARN] Cannot destroy S3 Bucket ACL. Terraform will remove this resource from the state file, however resources may remain.")
return nil
}

func expandBucketAclAccessControlPolicy(l []interface{}) *s3.AccessControlPolicy {
if len(l) == 0 || l[0] == nil {
return nil
Expand Down

0 comments on commit c913409

Please sign in to comment.