feat: abstracted all domain instances away to the configuration files
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
locals {
|
||||
# The IP block for the VPC.
|
||||
vpc_cidr = "10.0.0.0/16"
|
||||
|
||||
# Here is the domain name changes.
|
||||
domain_name = "maximhutz.com"
|
||||
}
|
||||
|
||||
data "aws_availability_zones" "all" {}
|
||||
|
||||
@@ -25,3 +25,9 @@ output "boot_secret" {
|
||||
description = "The access secret to manipulate the codebase repository boot."
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "full_domain" {
|
||||
value = "${var.subdomain}.${var.domain}"
|
||||
description = "The domain of the Gitea instance."
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# The Route53 DNS zone.
|
||||
data "aws_route53_zone" "main" {
|
||||
name = local.domain_name
|
||||
name = var.domain
|
||||
}
|
||||
|
||||
# Push all domain traffic through the reverse proxy.
|
||||
resource "aws_route53_record" "domain" {
|
||||
zone_id = data.aws_route53_zone.main.zone_id
|
||||
name = "git.${data.aws_route53_zone.main.name}"
|
||||
name = "${var.subdomain}.${data.aws_route53_zone.main.name}"
|
||||
type = "A"
|
||||
ttl = "60"
|
||||
records = [aws_eip.public.public_ip]
|
||||
|
||||
@@ -27,3 +27,13 @@ variable "boot_role" {
|
||||
type = string
|
||||
description = "The name of the role for boot access."
|
||||
}
|
||||
|
||||
variable "domain" {
|
||||
type = string
|
||||
description = "The name of the domain."
|
||||
}
|
||||
|
||||
variable "subdomain" {
|
||||
type = string
|
||||
description = "The name of the subdomain."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user