Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 3c2342e

Browse files
eb-greatcallketzacoatl
authored andcommitted
Added variable to set domain_name in DHCP Options Set in VPC module.
1 parent e1e21fb commit 3c2342e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

modules/vpc/main.tf

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
*
88
*/
99

10+
locals {
11+
domain_name = (var.domain_name != "" ? var.domain_name : "${var.region}.compute.internal")
12+
}
13+
1014
resource "aws_vpc" "main" {
1115
cidr_block = var.cidr
1216
enable_dns_hostnames = var.enable_dns_hostnames
@@ -22,7 +26,7 @@ resource "aws_vpc" "main" {
2226

2327
// move these two into their own module? or combine with aws_vpc in a module?
2428
resource "aws_vpc_dhcp_options" "main" {
25-
domain_name = "${var.region}.compute.internal"
29+
domain_name = local.domain_name
2630
domain_name_servers = var.dns_servers
2731
ntp_servers = var.ntp_servers
2832

modules/vpc/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@ variable "ntp_servers" {
4343
type = list(string)
4444
}
4545

46+
variable "domain_name" {
47+
default = ""
48+
description = "string, domain name for the DHCP options resource"
49+
type = string
50+
}

0 commit comments

Comments
 (0)