~nromdotcom/gemif

a458f93891ec4c1f10a9f4ca83b38ab51590a001 — Norm MacLennan 11 months ago 0ff198c
Variableize Terraform
3 files changed, 16 insertions(+), 4 deletions(-)

M infra/dns.tf
M infra/tls.tf
M infra/variables.tf
M infra/dns.tf => infra/dns.tf +2 -2
@@ 1,10 1,10 @@
data "aws_route53_zone" "fedifarm" {
  name = "fedi.farm."
  name = "${var.gemif_zone_name}."
}

resource "aws_route53_record" "gemif" {
  zone_id = data.aws_route53_zone.fedifarm.zone_id
  name    = "gemif.fedi.farm"
  name    = "${var.gemif_subdomain_name}${var.gemif_zone_name}"
  type    = "A"
  ttl     = "300"
  records = [aws_eip.gemif.public_ip]

M infra/tls.tf => infra/tls.tf +2 -2
@@ 12,14 12,14 @@ resource "tls_private_key" "gemif" {

resource "acme_registration" "le_reg" {
  account_key_pem = tls_private_key.gemif.private_key_pem
  email_address   = "norm@fedi.farm"
  email_address   = var.le_email_address
}

resource "acme_certificate" "cert" {
  account_key_pem = acme_registration.le_reg.account_key_pem
  key_type        = "P384"

  common_name        = "gemif.fedi.farm"
  common_name        = "${var.gemif_subdomain_name}${var.gemif_zone_name}"
  min_days_remaining = "14"

  dns_challenge {

M infra/variables.tf => infra/variables.tf +12 -0
@@ 4,4 4,16 @@ variable "gemif_version" {

variable "instance_type" {
  default = "t4g.nano"
}

variable "le_email_address" {
  default = "norm@fedi.farm"
}

variable "gemif_subdomain_name" {
  default = "gemif."
}

variable "gemif_zone_name" {
  default = "fedi.farm"
}
\ No newline at end of file