diff --git a/infra/Makefile b/infra/Makefile index c3a6eae..507406e 100644 --- a/infra/Makefile +++ b/infra/Makefile @@ -3,7 +3,7 @@ plan=out.plan SHELL := /bin/bash $(plan): *.tf - source secrets/set-env.sh && terraform plan -out $(plan) + source secrets/set-env.sh && terraform plan -input=false -out $(plan) push: build source secrets/set-env.sh && terraform apply $(plan) diff --git a/infra/ecr.tf b/infra/ecr.tf index 2412110..ee029ea 100644 --- a/infra/ecr.tf +++ b/infra/ecr.tf @@ -1,8 +1,3 @@ -locals { - repos = [ - "reverse-proxy", - ] -} resource "aws_ecr_repository" "this" { for_each = { for index, repo in local.repos: diff --git a/infra/local.tf b/infra/local.tf new file mode 100644 index 0000000..34ce88c --- /dev/null +++ b/infra/local.tf @@ -0,0 +1,11 @@ +locals { + # ECR + repos = [ + "reverse-proxy", + ] + buckets = [ + "shockrah.xyz", + "resume.shockrah.xyz" + ] +} + diff --git a/infra/s3.tf b/infra/s3.tf index a5677ce..0426b21 100644 --- a/infra/s3.tf +++ b/infra/s3.tf @@ -1,20 +1,13 @@ -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: + for idx, record in local.buckets: idx => record } - bucket = each.value.name + bucket = each.value tags = { - Name = each.value.name - Description = lookup(each.value, "desc", "Static content") + Name = each.value + Description = "Static content" } }