Consolidating locals into one place
Also adding -input=false to Makefile
This commit is contained in:
parent
17d3f66073
commit
dfdc62f80c
@ -3,7 +3,7 @@ plan=out.plan
|
|||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
|
|
||||||
$(plan): *.tf
|
$(plan): *.tf
|
||||||
source secrets/set-env.sh && terraform plan -out $(plan)
|
source secrets/set-env.sh && terraform plan -input=false -out $(plan)
|
||||||
|
|
||||||
push: build
|
push: build
|
||||||
source secrets/set-env.sh && terraform apply $(plan)
|
source secrets/set-env.sh && terraform apply $(plan)
|
||||||
|
@ -1,8 +1,3 @@
|
|||||||
locals {
|
|
||||||
repos = [
|
|
||||||
"reverse-proxy",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
resource "aws_ecr_repository" "this" {
|
resource "aws_ecr_repository" "this" {
|
||||||
for_each = {
|
for_each = {
|
||||||
for index, repo in local.repos:
|
for index, repo in local.repos:
|
||||||
|
11
infra/local.tf
Normal file
11
infra/local.tf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
locals {
|
||||||
|
# ECR
|
||||||
|
repos = [
|
||||||
|
"reverse-proxy",
|
||||||
|
]
|
||||||
|
buckets = [
|
||||||
|
"shockrah.xyz",
|
||||||
|
"resume.shockrah.xyz"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
15
infra/s3.tf
15
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" {
|
resource "aws_s3_bucket" "static-content" {
|
||||||
for_each = {
|
for_each = {
|
||||||
for idx, record in local.static_content_shockrah_xyz:
|
for idx, record in local.buckets:
|
||||||
idx => record
|
idx => record
|
||||||
}
|
}
|
||||||
|
|
||||||
bucket = each.value.name
|
bucket = each.value
|
||||||
|
|
||||||
tags = {
|
tags = {
|
||||||
Name = each.value.name
|
Name = each.value
|
||||||
Description = lookup(each.value, "desc", "Static content")
|
Description = "Static content"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user