diff --git a/enos/modules/aws_bucket/main.tf b/enos/modules/aws_bucket/main.tf index 20c7b1c39..955782066 100644 --- a/enos/modules/aws_bucket/main.tf +++ b/enos/modules/aws_bucket/main.tf @@ -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" {