chore(e2e): Add object expiration policy to s3 bucket (#5298)

* chore(e2e): Add expiration date to aws bucket objects

* chore(e2e): Add user tag to bucket
This commit is contained in:
Michael Li authored and GitHub committed 2024-12-05 09:51:53 -05:00
1 parent 1cf231a147
commit 5896a3b44b
1 file changed
+20 -1
+20 -1
View File
@@ -3,10 +3,29 @@
resource "random_pet" "default" {}
data "aws_caller_identity" "current" {}
resource "aws_s3_bucket" "default" {
bucket_prefix = "enos-${random_pet.default.id}-"
force_destroy = true
tags = local.common_tags
tags = merge(
local.common_tags,
{
User = "${split(":", data.aws_caller_identity.current.user_id)[1]}"
},
)
}
resource "aws_s3_bucket_lifecycle_configuration" "example" {
bucket = aws_s3_bucket.default.id
rule {
id = "file_retention"
expiration {
days = 30
}
status = "Enabled"
}
}
data "aws_iam_policy_document" "default" {