diff --git a/CHANGELOG.md b/CHANGELOG.md index ec749db..2ff8eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ #### Consider Implementing: * ipv6 support +## 0.3.3 (November 13, 2017) + +#### IMPROVEMENTS / NEW FEATURES: +* Add 'enable' flag for DHCP. Default is true. This allows for stacks to include these based on variable since at this time you cannot conditionally include modules. + ## 0.3.2 (May 16, 2017) #### BACKWARDS INCOMPATIBILITIES / NOTES: diff --git a/Rakefile b/Rakefile index 24c77b4..b0d99d7 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ require 'rake' require 'covalence/environment_tasks' -require 'covalence/packer_tasks' require 'covalence/spec_tasks' diff --git a/dhcp/main.tf b/dhcp/main.tf index 382000b..d68af4d 100644 --- a/dhcp/main.tf +++ b/dhcp/main.tf @@ -7,6 +7,8 @@ terraform { ## Provisions DHCP options resource "aws_vpc_dhcp_options" "dhcp" { + count = "${var.enable == "true" ? "1" : "0"}" + domain_name = "${var.domain_name}" domain_name_servers = ["${compact(var.name_servers)}"] netbios_name_servers = ["${compact(var.netbios_name_servers)}"] @@ -21,6 +23,8 @@ resource "aws_vpc_dhcp_options" "dhcp" { } resource "aws_vpc_dhcp_options_association" "dns_resolver" { + count = "${var.enable == "true" ? "1" : "0"}" + dhcp_options_id = "${aws_vpc_dhcp_options.dhcp.id}" vpc_id = "${var.vpc_id}" } diff --git a/dhcp/variables.tf b/dhcp/variables.tf index 6eec3ce..e0e4d65 100644 --- a/dhcp/variables.tf +++ b/dhcp/variables.tf @@ -24,6 +24,12 @@ variable "domain_name" { default = "" } +variable "enable" { + type = "string" + description = "Determine if resources should be added. Used if you want to include conditionally in a module." + default = "true" +} + variable "name_servers" { type = "list" description = "List of name servers to configure in '/etc/resolv.conf'"