Skip to content

Commit

Permalink
Add simple_vm DNS records
Browse files Browse the repository at this point in the history
  • Loading branch information
strugee committed Mar 13, 2024
1 parent 0a81e06 commit a04bf95
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mailu.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ module "mailu-vm" {
instance_type = "m1.medium"
network = "general_servers2"
disk_size = 30
# TODO replace this with a real Route 53 zone object when we control that in Terraform
dns_zone = {
zone_id = "Z0173878287JIU5M4KB8R"
name = "seagl.org"
}
}
5 changes: 5 additions & 0 deletions nextcloud-office.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ module "nc-office-vm" {
instance_type = "m1.small"
network = "general_servers2"
disk_size = 15
# TODO replace this with a real Route 53 zone object when we control that in Terraform
dns_zone = {
zone_id = "Z0173878287JIU5M4KB8R"
name = "seagl.org"
}
}
10 changes: 10 additions & 0 deletions simple_vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,13 @@ resource "openstack_compute_instance_v2" "instance" {
name = var.network
}
}

resource "aws_route53_record" "dns-a" {
zone_id = var.dns_zone.zone_id
name = "${var.name}.host.${var.dns_zone.name}"
type = "A"
ttl = "300"
records = [
openstack_compute_instance_v2.instance.access_ip_v4
]
}
8 changes: 8 additions & 0 deletions simple_vm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ variable "disk_size" {
description = "Size of the VM's root volume"
type = number
}

variable "dns_zone" {
description = "Route 53 zone object to provision records in"
type = object({
zone_id = string
name = string
})
}

0 comments on commit a04bf95

Please sign in to comment.