diff --git a/infra/input-vars.tf b/infra/input-vars.tf index e9dc738..56eb5a3 100644 --- a/infra/input-vars.tf +++ b/infra/input-vars.tf @@ -127,18 +127,6 @@ variable "shockrah_xyz_s3_secret_key" { sensitive = true } -variable "shockrah_xyz_bucket_name" { - description = "shockrah.xyz bucket name" - type = string - sensitive = true -} - -variable "shockrah_xyz_s3_server" { - description = "S3 target server" - type = string - sensitive = true -} - variable "shockrah_xyz_nginx_port" { description = "Port for shockrah.xyz" type = number diff --git a/infra/s3.tf b/infra/s3.tf index 88ed4b6..a5677ce 100644 --- a/infra/s3.tf +++ b/infra/s3.tf @@ -1,8 +1,20 @@ -resource "aws_s3_bucket" "shockrah_xyz" { - bucket = var.shockrah_xyz_bucket_name +locals { + static_content_shockrah_xyz = [ + { name = "shockrah-xyz" }, + { name = "resume-shockrah-xyz" } + ] +} + +resource "aws_s3_bucket" "static-content" { + for_each = { + for idx, record in local.static_content_shockrah_xyz: + idx => record + } + + bucket = each.value.name tags = { - Name = var.shockrah_xyz_bucket_name - Description = "Bucket for star.shockrah.xyz" + Name = each.value.name + Description = lookup(each.value, "desc", "Static content") } }