diff --git a/.vscode/settings.json b/.vscode/settings.json index fe25b32..33619cb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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 } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9677fae..c3f69cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/README.md b/README.md index 2747798..17aa50c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/data/stacks/common.yaml b/data/stacks/common.yaml index 94e37ad..6955851 100644 --- a/data/stacks/common.yaml +++ b/data/stacks/common.yaml @@ -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' diff --git a/dhcp/main.tf b/dhcp/main.tf index 5d3312f..382000b 100644 --- a/dhcp/main.tf +++ b/dhcp/main.tf @@ -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}" diff --git a/dhcp/variables.tf b/dhcp/variables.tf index ba02bb5..6eec3ce 100644 --- a/dhcp/variables.tf +++ b/dhcp/variables.tf @@ -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 = [] } diff --git a/examples/basic/main.tf b/examples/basic/main.tf index 266d9b7..14550bd 100644 --- a/examples/basic/main.tf +++ b/examples/basic/main.tf @@ -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 diff --git a/examples/basic/variables.tf b/examples/basic/variables.tf index 0ef624d..9aa7cbb 100644 --- a/examples/basic/variables.tf +++ b/examples/basic/variables.tf @@ -28,6 +28,12 @@ variable "vpc_cidr" { type = "string" } +## DHCP +variable "domain_name" { + type = "string" + default = "" +} + ## AZ parameters variable "azs_provisioned" { type = "string"