From c9134099105c85d32e10898b96988dcf8e656ea7 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Fri, 4 Feb 2022 18:22:56 -0500 Subject: [PATCH] r/s3_bucket_acl: add warning log when deleting from state --- internal/service/s3/bucket_acl.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/service/s3/bucket_acl.go b/internal/service/s3/bucket_acl.go index 9192e6bff06..a99aa033569 100644 --- a/internal/service/s3/bucket_acl.go +++ b/internal/service/s3/bucket_acl.go @@ -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, }, @@ -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