From 8f375def3bce9b10726e84ca05e8a1e3f19c7a73 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 28 Feb 2023 21:04:26 -0800 Subject: [PATCH] Updating bucket names to include blog and resume --- infra/input-vars.tf | 12 ------------ infra/s3.tf | 20 ++++++++++++++++---- 2 files changed, 16 insertions(+), 16 deletions(-) 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") } }