Skip to content

Commit

Permalink
Updated DHCP variable defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeneyops committed Apr 24, 2017
1 parent 7ee89a0 commit ea98acc
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions data/stacks/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

## Basic example
examples::basic::vars:
domain_name: 'basic.example'
region: 'us-east-2'
stack_item_fullname: 'Basic Examples'
stack_item_label: 'bsc'
Expand Down
11 changes: 8 additions & 3 deletions dhcp/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# DHCP Options

## Set Terraform version constraint
terraform {
required_version = "> 0.8.0"
}

## Provisions DHCP options
resource "aws_vpc_dhcp_options" "dhcp" {
domain_name = "${var.domain_name}"
domain_name_servers = ["${var.name_servers}"]
netbios_name_servers = ["${var.netbios_name_servers}"]
domain_name_servers = ["${compact(var.name_servers)}"]
netbios_name_servers = ["${compact(var.netbios_name_servers)}"]
netbios_node_type = "${var.netbios_node_type}"
ntp_servers = ["${var.ntp_servers}"]
ntp_servers = ["${compact(var.ntp_servers)}"]

tags {
application = "${var.stack_item_fullname}"
Expand Down
10 changes: 5 additions & 5 deletions dhcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ variable "vpc_id" {
variable "domain_name" {
type = "string"
description = "The suffix domain name to use by default when resolving non Fully Qualified Domain Names"
default = "service.consul"
default = ""
}

variable "name_servers" {
type = "list"
description = "List of name servers to configure in '/etc/resolv.conf'"
default = ["127.0.0.1"]
default = ["AmazonProvidedDNS"]
}

variable "netbios_name_servers" {
type = "list"
description = "List of NETBIOS name servers"
default = ["127.0.0.1"]
default = []
}

variable "netbios_node_type" {
type = "string"
description = "The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network."
default = "2"
default = ""
}

variable "ntp_servers" {
type = "list"
description = "List of NTP servers to configure"
default = ["127.0.0.1"]
default = []
}
12 changes: 12 additions & 0 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ module "vpc_base" {
vpc_cidr = "${var.vpc_cidr}"
}

## Configures DHCP
module "vpc_dhcp" {
# Example GitHub source
#source = "github.com/unifio/terraform-aws-vpc?ref=master//dhcp"
source = "../../dhcp"

domain_name = "${var.domain_name}"
stack_item_fullname = "${var.stack_item_fullname}"
stack_item_label = "${var.stack_item_label}"
vpc_id = "${module.vpc_base.vpc_id}"
}

## Configures VPC Availabilty Zones
module "vpc_az" {
# Example GitHub source
Expand Down
6 changes: 6 additions & 0 deletions examples/basic/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ variable "vpc_cidr" {
type = "string"
}

## DHCP
variable "domain_name" {
type = "string"
default = ""
}

## AZ parameters
variable "azs_provisioned" {
type = "string"
Expand Down

0 comments on commit ea98acc

Please sign in to comment.