aws_s3_bucket_lifecycle_configuration for AWS Provider 4.x

This commit is contained in:
Edward Viaene
2022-03-14 09:12:49 -04:00
parent b6dbf6aaf8
commit 5b5aad79ee
+10 -3
View File
@@ -7,10 +7,16 @@ resource "aws_s3_bucket" "codebuild-cache" {
resource "aws_s3_bucket" "demo-artifacts" { resource "aws_s3_bucket" "demo-artifacts" {
bucket = "demo-artifacts-${random_string.random.result}" bucket = "demo-artifacts-${random_string.random.result}"
# lifecycle moved to aws_s3_bucket_lifecycle_configuration (Change starting from AWS Provider 4.x)
}
lifecycle_rule { resource "aws_s3_bucket_lifecycle_configuration" "demo-artifacts-lifecycle" {
id = "clean-up" bucket = aws_s3_bucket.demo-artifacts.id
enabled = "true"
rule {
id = "clean-up"
status = "Enabled"
expiration { expiration {
days = 30 days = 30
@@ -18,6 +24,7 @@ resource "aws_s3_bucket" "demo-artifacts" {
} }
} }
resource "random_string" "random" { resource "random_string" "random" {
length = 8 length = 8
special = false special = false