Merge pull request #21 from elizabeth-ikechukwu/feat/week8-auth-ui-ssm

feat: add Route53 hosted zone and DNS records for lizzycloudlab.online
This commit is contained in:
Elizabeth Nkwo Ikechukwu
2026-05-31 04:02:04 +01:00
committed by GitHub
3 changed files with 47 additions and 32 deletions
+34
View File
@@ -0,0 +1,34 @@
# --------------------------------------------------
# Route53 Hosted Zone
# --------------------------------------------------
resource "aws_route53_zone" "main" {
name = var.domain_name
tags = {
Name = "${var.project_name}-hosted-zone"
Project = var.project_name
Environment = var.environment
}
}
# --------------------------------------------------
# A Record - taskflow subdomain points to Elastic IP
# --------------------------------------------------
resource "aws_route53_record" "taskflow" {
zone_id = aws_route53_zone.main.zone_id
name = "taskflow.${var.domain_name}"
type = "A"
ttl = 300
records = [aws_eip.app.public_ip]
}
# --------------------------------------------------
# A Record - root domain points to Elastic IP
# --------------------------------------------------
resource "aws_route53_record" "root" {
zone_id = aws_route53_zone.main.zone_id
name = var.domain_name
type = "A"
ttl = 300
records = [aws_eip.app.public_ip]
}
+6 -31
View File
@@ -1,34 +1,9 @@
output "vpc_id" { output "nameservers" {
description = "ID of the VPC" description = "Route53 nameservers - paste these into Hostinger DNS settings"
value = aws_vpc.main.id value = aws_route53_zone.main.name_servers
} }
output "public_subnet_id" { output "app_url" {
description = "ID of the public subnet" description = "TaskFlow app URL"
value = aws_subnet.public.id value = "http://taskflow.${var.domain_name}"
}
output "private_subnet_id" {
description = "ID of the private subnet"
value = aws_subnet.private[0].id
}
output "ec2_instance_id" {
description = "EC2 instance ID - use this to connect via SSM"
value = aws_instance.app.id
}
output "ec2_public_ip" {
description = "Public IP of the EC2 instance"
value = aws_instance.app.public_ip
}
output "ec2_public_dns" {
description = "Public DNS of the EC2 instance"
value = aws_instance.app.public_dns
}
output "elastic_ip" {
description = "Permanent Elastic IP - point your domain DNS A record to this"
value = aws_eip.app.public_ip
} }
+6
View File
@@ -67,3 +67,9 @@ variable "jwt_secret" {
type = string type = string
sensitive = true sensitive = true
} }
variable "domain_name" {
description = "Root domain name for Route53 hosted zone"
type = string
default = "lizzycloudlab.online"
}