Skip to content

Commit

Permalink
Merge pull request #24 from unifio/dhcp-updates
Browse files Browse the repository at this point in the history
DHCP updates
  • Loading branch information
blakeneyops authored Apr 24, 2017
2 parents 1d15e65 + 26c04e0 commit f4f994b
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 10 deletions.
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"editor.renderWhitespace": "all",
"files.associations": {
"*.tpl": "hcl",
"*.tf" : "terraform"
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true
"files.trimTrailingWhitespace": true,
"terraform.formatOnSave": true
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#### Consider Implementing:
* ipv6 support

## 0.3.1 (April 23, 2017)

#### IMPROVEMENTS / NEW FEATURES:
* DHCP defaults are now more minimal and do not set values for all parameters.

## 0.3.0 (April 3, 2017)

#### BACKWARDS INCOMPATIBILITIES / NOTES:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The DHCP module provisions a DHCP options resource and associates it with the sp
- `domain_name` - (Optional) The suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the search value in the /etc/resolv.conf file.
- `name_servers` - (Optional) List of name servers to configure in /etc/resolv.conf.
- `netbios_name_servers` - (Optional) List of NETBIOS name servers.
- `netbios_node_type` - (Optional) The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132. Defaults to 2.
- `netbios_node_type` - (Optional) The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- `ntp_servers` - (Optional) List of NTP servers to configure.
- `stack_item_fullname` - Long form descriptive name for this stack item. This value is used to create the "application" resource tag for resources created by this stack item.
- `stack_item_label` - Short form identifier for this stack. This value is used to create the "Name" resource tag for resources created by this stack item, and also serves as a unique key for re-use.
Expand Down
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 f4f994b

Please sign in to comment.