-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from zoitech/feature/fix_issues_with_s3
Fix S3 deprecated items
- Loading branch information
Showing
5 changed files
with
128 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,37 @@ | ||
# The S3 bucket | ||
# The S3 bucket | ||
resource "aws_s3_bucket" "s3_bucket" { | ||
bucket = var.s3_bucket_name | ||
} | ||
|
||
resource "aws_s3_bucket_acl" "name" { | ||
bucket = aws_s3_bucket.s3_bucket.id | ||
acl = "private" | ||
region = var.region | ||
} | ||
|
||
versioning { | ||
enabled = var.s3_versioning_enabled #default = false | ||
resource "aws_s3_bucket_versioning" "s3_bucket" { | ||
bucket = aws_s3_bucket.s3_bucket.id | ||
versioning_configuration { | ||
status = var.s3_versioning_enabled ? "Enabled" : "Suspended" | ||
} | ||
} | ||
|
||
resource "aws_s3_bucket_lifecycle_configuration" "s3_bucket" { | ||
bucket = aws_s3_bucket.s3_bucket.id | ||
rule { | ||
status = var.lifecycle_rule_enabled ? "Enabled" : "Disabled" #default = false | ||
id = var.lifecycle_config_rule_id #required #default = "" | ||
|
||
filter { | ||
prefix = var.lifecycle_rule_prefix #default = whole bucket | ||
} | ||
|
||
lifecycle_rule { | ||
enabled = var.lifecycle_rule_enabled #default = false | ||
id = var.lifecycle_rule_id #required #default = "" | ||
prefix = var.lifecycle_rule_prefix #default = whole bucket | ||
|
||
expiration { | ||
days = var.lifecycle_rule_expiration #default = 0 | ||
} | ||
|
||
noncurrent_version_expiration { | ||
days = var.lifecycle_rule_noncurrent_version_expiration #default = 90 | ||
noncurrent_days = var.lifecycle_rule_noncurrent_version_expiration #default = 90 | ||
} | ||
} | ||
#Make prevent_destroy setable with variable when terraform code has been changed to make this possible | ||
#hashicorp/terraform#3116 | ||
|
||
#lifecycle { | ||
# prevent_destroy = true | ||
#} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters