feat: add Route53 hosted zone and DNS records for lizzycloudlab.online

This commit is contained in:
ikechukwu Elizabeth
2026-05-31 03:49:51 +01:00
parent 0128361798
commit a9df65231d
3 changed files with 88 additions and 32 deletions
+75
View File
@@ -0,0 +1,75 @@
variable "aws_region" {
description = "AWS region for all resources"
type = string
}
variable "aws_account_id" {
description = "AWS account ID - set in terraform.tfvars, never hardcoded"
type = string
}
variable "project_name" {
description = "Project name used for naming and tagging all resources"
type = string
default = "scalable-task-platform"
}
variable "environment" {
description = "Deployment environment"
type = string
default = "production"
}
variable "vpc_cidr" {
description = "CIDR block for the VPC"
type = string
default = "10.0.0.0/16"
}
variable "public_subnet_cidr" {
description = "CIDR block for the public subnet"
type = string
default = "10.0.1.0/24"
}
variable "private_subnet_cidrs" {
description = "CIDR blocks for the two private subnets across two AZs"
type = list(string)
default = ["10.0.2.0/24", "10.0.3.0/24"]
}
variable "db_name" {
description = "PostgreSQL database name"
type = string
default = "tasksdb"
}
variable "db_username" {
description = "PostgreSQL master username"
type = string
sensitive = true
}
variable "db_password" {
description = "PostgreSQL master password"
type = string
sensitive = true
}
variable "db_host" {
description = "RDS instance hostname - output from aws_db_instance.tasks.address"
type = string
sensitive = true
}
variable "jwt_secret" {
description = "JWT signing secret for authentication"
type = string
sensitive = true
}
variable "domain_name" {
description = "Root domain name for Route53 hosted zone"
type = string
default = "lizzycloudlab.online"
}
+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"
}