Skip to content

Commit d20aea2

Browse files
authored
Removed deprecated params from bucket doc examples (#1970)
The `acl` and `versioning` parameters are deprecated on the aws_s3_bucket resource. The docs recommend using aws_s3_bucket_acl and aws_s3_bucket_versioning resources instead. From what I can gather, this helps with drift detection in Terraform.
1 parent 5096193 commit d20aea2

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

scripts/awsmt-integration/data-security.tf

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
// create bucket for mounting
22
resource "aws_s3_bucket" "ds" {
33
bucket = "${local.prefix}-ds"
4-
acl = "private"
5-
versioning {
6-
enabled = false
7-
}
84
force_destroy = true
95
tags = merge(local.tags, {
106
Name = "${local.prefix}-ds"
117
})
128
}
139

10+
resource "aws_s3_bucket_acl" "ds" {
11+
bucket = aws_s3_bucket.ds.id
12+
acl = "private"
13+
}
14+
15+
resource "aws_s3_bucket_versioning" "ds" {
16+
bucket = aws_s3_bucket.ds.id
17+
versioning_configuration {
18+
status = "Disabled"
19+
}
20+
}
21+
1422
data "aws_iam_policy_document" "assume_role_for_ec2" {
1523
statement {
1624
effect = "Allow"
@@ -65,4 +73,4 @@ output "test_s3_bucket" {
6573

6674
output "test_ec2_instance_profile" {
6775
value = aws_iam_instance_profile.this.arn
68-
}
76+
}

0 commit comments

Comments
 (0)