From 2dda090f9cdfdc9745754b6ba4c402279369fd59 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Tue, 8 Feb 2022 15:27:20 -0500 Subject: [PATCH] tests/lambda: update to aws_s3_bucket_acl --- internal/service/lambda/function_test.go | 12 ++++++++++-- internal/service/lambda/permission_test.go | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 664172dfc23..730fdadd53b 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -3414,10 +3414,14 @@ func testAccFunctionConfig_s3(bucketName, key, path, roleName, funcName string) return fmt.Sprintf(` resource "aws_s3_bucket" "artifacts" { bucket = "%s" - acl = "private" force_destroy = true } +resource "aws_s3_bucket_acl" "artifacts" { + bucket = aws_s3_bucket.artifacts.id + acl = "private" +} + resource "aws_s3_bucket_versioning" "artifacts" { bucket = aws_s3_bucket.artifacts.id versioning_configuration { @@ -3471,10 +3475,14 @@ func testAccFunctionConfig_s3_unversioned_tpl(bucketName, roleName, funcName, ke return fmt.Sprintf(` resource "aws_s3_bucket" "artifacts" { bucket = "%s" - acl = "private" force_destroy = true } +resource "aws_s3_bucket_acl" "artifacts" { + bucket = aws_s3_bucket.artifacts.id + acl = "private" +} + resource "aws_s3_object" "o" { bucket = aws_s3_bucket.artifacts.bucket key = "%s" diff --git a/internal/service/lambda/permission_test.go b/internal/service/lambda/permission_test.go index a19f8cce8af..f23c422eb05 100644 --- a/internal/service/lambda/permission_test.go +++ b/internal/service/lambda/permission_test.go @@ -1030,6 +1030,10 @@ resource "aws_lambda_permission" "with_s3" { resource "aws_s3_bucket" "default" { bucket = "%s" +} + +resource "aws_s3_bucket_acl" "default" { + bucket = aws_s3_bucket.default.id acl = "private" }