diff --git a/infrastructure/terraform/dev.tfvars b/infrastructure/terraform/dev.tfvars index 93e7804a..2ec93fa3 100644 --- a/infrastructure/terraform/dev.tfvars +++ b/infrastructure/terraform/dev.tfvars @@ -2,6 +2,11 @@ stage = "dev" profile = "DevAdmin" region = "eu-west-2" +# Domain +# Remember to create a production url in Google domains before deploying +domain_name = "hestia.homes" +api_url_prefix = "api-dev" + # Database allocated_storage = 20 instance_class = "db.t3.micro" diff --git a/infrastructure/terraform/main.tf b/infrastructure/terraform/main.tf index b01506a0..dfde8f94 100644 --- a/infrastructure/terraform/main.tf +++ b/infrastructure/terraform/main.tf @@ -82,4 +82,12 @@ module "s3_presignable_bucket" { source = "./modules/s3_presignable_bucket" environment = var.stage allowed_origins = var.allowed_origins +} + +# Set up the route53 record for the API +module "route53" { + source = "./modules/route53" + domain_name = var.domain_name + api_url_prefix = var.api_url_prefix + } \ No newline at end of file diff --git a/infrastructure/terraform/modules/route53/main.tf b/infrastructure/terraform/modules/route53/main.tf new file mode 100644 index 00000000..e69de29b diff --git a/infrastructure/terraform/modules/route53/variables.tf b/infrastructure/terraform/modules/route53/variables.tf new file mode 100644 index 00000000..7241929c --- /dev/null +++ b/infrastructure/terraform/modules/route53/variables.tf @@ -0,0 +1,9 @@ +variable "domain_name" { + description = "Name of the base domain for Route53" + type = string +} + +variable "api_url_prefix" { + description = "Prefix for the API URL" + type = string +} \ No newline at end of file diff --git a/infrastructure/terraform/variables.tf b/infrastructure/terraform/variables.tf index 65b4e0d6..76734340 100644 --- a/infrastructure/terraform/variables.tf +++ b/infrastructure/terraform/variables.tf @@ -13,6 +13,16 @@ variable "region" { type = string } +variable "domain_name" { + description = "Name of the base domain for Route53" + type = string +} + +variable "api_url_prefix" { + description = "Prefix for the API URL" + type = string +} + variable allocated_storage { description = "The allocated storage in gigabytes" type = number