Skip to content

Commit 8ac5e84

Browse files
authored
Merge pull request #19 from unifio/wc-updates
Updates for TF 0.8.X
2 parents 8404938 + 9106f0f commit 8ac5e84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1388
-710
lines changed

.env.docker

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
AWS_REGION=us-east-2
2+
COVALENCE_PACKER_DIR=./
3+
COVALENCE_TERRAFORM_DIR=./
4+
COVALENCE_TEST_ENVS=basic,complete
5+
CHECKPOINT_DISABLE=1
6+
GODEBUG=netdns=cgo
7+
USER=root

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.tfstate*
22
.terraform/
33
.env
4+
spec/reports/**

.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"editor.renderWhitespace": "all",
3+
"files.insertFinalNewline": true,
4+
"files.trimTrailingWhitespace": true
5+
}

CHANGELOG.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,65 @@
1-
## Unreleased
1+
#### Consider Implementing:
2+
* ipv6 support
3+
4+
## 0.3.0 (April 3, 2017)
5+
6+
#### BACKWARDS INCOMPATIBILITIES / NOTES:
7+
* Enabled complex variable types, which are only supported in Terraform 0.7.0 and newer.
8+
* The following input variables have been removed
9+
* peer module
10+
* `multi_acct`
11+
* The following input variables have been changed:
12+
* az module
13+
* `az (string, required)` -> `azs (list, optional)`
14+
* `dmz_cidr (string, required)` -> `dmz_cidrs (list, optional)`
15+
* `lan_cidr (string, required)` -> `lan_cidrs (list, optional)`
16+
* `vgw_ids (string, optional` - > `vgw_ids (list, optional)`
17+
* dhcp module
18+
* `name_servers (string, optional)` -> `name_servers (list, optional)`
19+
* `netbios_name_servers (string, optional)` -> `netbios_name_servers (list, optional)`
20+
* `ntp_servers (string, optional)` -> `ntp_servers (list, optional)`
21+
* peer module
22+
* `peer_owner_id (string, required)` -> `accepter_owner_id (string, optional)`
23+
* `peer_vpc_id (string, required)` -> `accepter_vpc_id (string, optional)`
24+
* `vpc_id (string, required)` -> `requester_vpc_id (string, optional)`
25+
* The following output variables have been changed:
26+
* az module
27+
* `dmz_cidr (string)` -> `dmz_cidrs (string)`
28+
* `dmz_id (string)` -> `dmz_ids (string)`
29+
* `eip_nat_id (string)` -> `eip_nat_ids (string)`
30+
* `eip_nat_ip (string)` -> `eip_nat_ips (string)`
31+
* `lan_id (string)` -> `lan_ids (string)`
32+
* `lan_cidr (string)` -> `lan_cidrs (string)`
33+
* `nat_id (string)` -> `nat_ids (string)`
34+
* base module
35+
* `dmz_subnet_id (string)` -> `dmz_subnet_ids (string)`
36+
* `lan_subnet_id (string)` -> `lan_subnet_ids (string)`
37+
* `lan_rt_id (string)` -> `lan_rt_ids (string)`
38+
39+
#### IMPROVEMENTS / NEW FEATURES:
40+
* Added conditional support for the following parameters:
41+
* az module
42+
* `azs`
43+
* `dmz_cidrs`
44+
* `enable_dmz_public_ips`
45+
* `nat_key_name`
46+
* base module
47+
* `enable_classiclink`
48+
* `enable_dns`
49+
* `enable_hostnames`
50+
* `instance_tenancy`
51+
* peer module
52+
* `accepter_allow_clasic_link_to_remote`
53+
* `accepter_allow_to_remote_classic_link`
54+
* `accepter_auto_accept`
55+
* `requester_allow_clasic_link_to_remote`
56+
* `requester_allow_to_remote_classic_link`
57+
* vpg module
58+
* `availability_zone`
59+
60+
* Added support for AZ auto-provisioning.
61+
* Re-enabled support for EC2 based NATs.
62+
* Added conditional support for EIPs with EC2 based NATs.
263

364
## 0.2.5 (October 7, 2016)
465

Gemfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

Gemfile.lock

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Module stack that supports full AWS VPC deployment. Users can provision a basic
99

1010
## Requirements ##
1111

12-
- Terraform 0.6.16 or newer
12+
- Terraform 0.8.0 or newer
1313
- AWS provider
1414

1515
## Base Module ##
@@ -35,11 +35,11 @@ The Base module provisions the VPC, attaches an Internet Gateway, and creates NA
3535
module "vpc_base" {
3636
source = "github.com/unifio/terraform-aws-vpc?ref=master//base"
3737

38-
enable_dns = true
39-
enable_hostnames = false
40-
stack_item_fullname = "Stack Item Description"
41-
stack_item_label = "mystack1"
42-
vpc_cidr = "10.10.0.0/22"
38+
enable_dns = "true"
39+
enable_hostnames = "false"
40+
stack_item_fullname = "My Stack"
41+
stack_item_label = "mystck"
42+
vpc_cidr = "172.16.0.0/21"
4343
}
4444
```
4545

@@ -74,12 +74,12 @@ module "dhcp" {
7474
source = "github.com/terraform-aws-vpc?ref=master//dhcp"
7575

7676
domain_name = "mydomain.com"
77-
name_servers = "10.128.8.10"
78-
netbios_name_servers = "10.128.8.10"
77+
name_servers = ["172.16.0.2"]
78+
netbios_name_servers = ["172.16.0.2"]
7979
netbios_node_type = 2
80-
ntp_servers = "10.128.8.10"
81-
stack_item_fullname = "myname"
82-
stack_item_label = "mystack1"
80+
ntp_servers = ["172.16.0.2"]
81+
stack_item_fullname = "My Stack"
82+
stack_item_label = "mystck"
8383
vpc_id = "${module.vpc_base.vpc_id}"
8484
}
8585
```
@@ -96,8 +96,8 @@ Creates a VPC VPN Gateway
9696

9797
- `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.
9898
- `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.
99-
- `vpc_attach` - Specifies whether the VPG should be associated with a VPC. Valid value: 0 or 1. Defaults to 0 (unattached).
100-
- `vpc_id` - The VPC to associate the VPG with.
99+
- `vpc_attach` - (Optional) Specifies whether the VPG should be associated with a VPC.
100+
- `vpc_id` - (Optional) The VPC to associate the VPG with.
101101

102102
### Usage
103103

@@ -107,8 +107,8 @@ The usage examples may assume that previous modules in this stack have already b
107107
module "vpg" {
108108
source = "github.com/terraform-aws-vpc?ref=master//vpg"
109109

110-
stack_item_fullname = "Stack Item Description"
111-
stack_item_label = "mystack1"
110+
stack_item_fullname = "My Stack"
111+
stack_item_label = "mystck"
112112
vpc_attach = 1
113113
vpc_id = "${module.vpc_base.vpc_id}"
114114
}
@@ -124,14 +124,18 @@ In each Availability Zone provided, this module provisions subnets and routing t
124124

125125
### Input Variables ###
126126

127-
- `az` - Availability zone(s). Will accept a comma delimited string.
128-
- `dmz_cidr` - The CIDR block(s) you want the DMZ subnet(s) to cover. Will accept a comma delimited string. This list should correspond 1:1 to each AZ.
129-
- `enable_dmz_public_ips` - (Optional) Specify true to indicate that instances launched into the DMZ subnet should be assigned a public IP address. Defaults to true.
130-
- `lan_cidr` - The CIDR block(s) you want the LAN subnet(s) to cover. Will accept a comma delimited string. This list should correspond 1:1 to each AZ.
131-
- `lans_per_az` - (Optional) The number of private LAN subnets to be provisioned per AZ. You will need to double the CIDR blocks specified in the `lan_cidr` variable for each increase in this value. Defaults to 1.
132-
- `region` - The AWS region.
127+
- `azs_provisioned` - (Optional) The number of availability zones to be provisioned. Either this or **azs\_provisioned\_override** must be specified.
128+
- `azs_provisioned_override` - List of availability zone letters to be provisioned. Useful in regions where not all AZs are VPC ready. Either this or **azs_provisioned** must be specified.
129+
- `dmz_cidrs` - (Optional) The CIDR block(s) you want the DMZ subnet(s) to cover.
130+
- `enable_dmz_public_ips` - (Optional) Specify true to indicate that instances launched into the DMZ subnet should be assigned a public IP address.
131+
- `lan_cidrs` - (Optional) The CIDR block(s) you want the LAN subnet(s) to cover.
132+
- `lans_per_az` - (Optional) The number of private LAN subnets to be provisioned per AZ. Auto-provisioning will support up to 2 LANs without the need for overrides.
133+
- `nat_ami_override` - (Optional) Custom NAT Amazon machine image.
134+
- `nat_eips_enabled` - (Optional) Flag for specifying allocation of Elastic IPs to NATs for the purposes of whitelisting. This value is overriden to 'true' when utilizing NAT gateways.
135+
- `nat_gateways_enabled` - (Optional) Flag for specifying utilization of managed NAT gateways over EC2 based NAT instances.
136+
- `nat_instance_type` - (Default: t2.nano) NAT EC2 instance type.
137+
- `nat_key_name` - (Optional) NAT EC2 key pair name.
133138
- `rt_dmz_id` - The ID of the DMZ routing table.
134-
- `rt_vgw_prop` - (Optional) Specifies whether virtual gateway route propagation should be enabled on the routing table(s). Valid values: 0 or 1. Defaults to 0 (disabled).
135139
- `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.
136140
- `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.
137141
- `vgw_ids` - (Optional) A list of virtual gateways to associate with the routing tables for route propagation.
@@ -145,48 +149,47 @@ The usage examples may assume that previous modules in this stack have already b
145149
module "az" {
146150
source = "github.com/unifio/terraform-aws-vpc?ref=master//az"
147151

148-
az = "a,b"
149-
dmz_cidr = "10.10.0.0/25,10.10.0.128/25,10.10.1.0/25"
150-
enable_dmz_public_ips = true
151-
lan_cidr = "10.10.2.0/25,10.10.2.128/25,10.10.3.0/25"
152-
lans_per_az = "1"
153-
region = "us-west-2"
152+
azs_provisioned = 2
153+
enable_dmz_public_ips = "true"
154154
rt_dmz_id = "${module.vpc_base.rt_dmz_id}"
155-
rt_vgw_prop = 1
156-
stack_item_fullname = "Stack Item Description"
157-
stack_item_label = "mystack1"
155+
stack_item_fullname = "My Stack"
156+
stack_item_label = "mystck"
158157
vgw_ids = "${aws_vpn_gateway.vpg.id}"
159-
vpc_id = "${module.vpc_base.vpc_id}"
158+
vpc_id = "${module.vpc_base.vpc_id}"
160159
}
161160
```
162161

163162
### Outputs ###
164163

165164
** The order and association of the IDs match the order of the availability zones passed to the module.
166165

167-
- `dmz_id` - List of subnet IDs of the DMZ subnetworks.
168-
- `lan_id` - List of subnet IDs of the LAN subnetworks.
169-
- `dmz_cidr` - List of subnet CIDR blocks of the DMZ subnetworks.
170-
- `lan_cidr` - List of subnet CIDR blocks of the LAN subnetworks.
171-
- `eip_nat_id` - List of Elastic IP IDs for each of the NAT gateways.
172-
- `nat_id` - List of NAT gateways IDs.
173-
- `eip_nat_ip` - List of NAT gateway public IPs.
174-
- `rt_lan_id` - List of routing table IDs for the LAN subnets.
166+
- `dmz_ids` - Comma-delimeted list of subnet IDs of the DMZ subnetworks.
167+
- `lan_ids` - Comma-delimeted list of subnet IDs of the LAN subnetworks.
168+
- `dmz_cidrs` - Comma-delimeted list of subnet CIDR blocks of the DMZ subnetworks.
169+
- `lan_cidrs` - Comma-delimeted list of subnet CIDR blocks of the LAN subnetworks.
170+
- `eip_nat_ids` - Comma-delimeted list of Elastic IP IDs for each of the NAT gateways.
171+
- `nat_ids` - Comma-delimeted list of NAT gateways IDs.
172+
- `eip_nat_ips` - Comma-delimeted list of NAT gateway public IPs.
173+
- `rt_lan_ids` - Comma-delimeted list of routing table IDs for the LAN subnets.
175174

176175
## Peer Module ##
177176

178177
Creates a VPC peering connection
179178

180179
### Input Variables
181180

181+
- `accepter_allow_classic_link_to_remote` - Allow a local linked EC2-Classic instance to communicate with instances in a peer VPC. This enables an outbound communication from the local ClassicLink connection to the remote VPC.
182182
- `accepter_allow_remote_dns` - Allow accepter VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the requester VPC.
183-
- `multi_acct` - Flag indicating whether the peering connection spans multiple AWS accounts.
184-
- `peer_owner_id` - The AWS account ID of the owner of the peer VPC.
185-
- `peer_vpc_id` - The ID of the VPC with which you are creating the VPC Peering Connection.
186-
- `requester_allow_remote_dns` - Allow requester VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the accepter VPC.
183+
- `accepter_allow_to_remote_classic_link` - Allow a local VPC to communicate with a linked EC2-Classic instance in a peer VPC. This enables an outbound communication from the local VPC to the remote ClassicLink connection.
184+
- `accepter_auto_accept` - Accept the peering (both VPCs need to be in the same AWS account).
185+
- `accepter_owner_id` - The AWS account ID of the owner of the peer VPC.
186+
- `accepter_vpc_id` - The ID of the VPC with which you are creating the VPC Peering Connection.
187+
- `requester_allow_classic_link_to_remote` - Allow a local linked EC2-Classic instance to communicate with instances in a peer VPC. This enables an outbound communication from the local ClassicLink connection to the remote VPC.
188+
- `requester_allow_remote_dns` - Allow accepter VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the requester VPC.
189+
- `requester_allow_to_remote_classic_link` - Allow a local VPC to communicate with a linked EC2-Classic instance in a peer VPC. This enables an outbound communication from the local VPC to the remote ClassicLink connection.
190+
- `requester_vpc_id` - The ID of the requester VPC.
187191
- `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.
188192
- `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.
189-
- `vpc_id` - The ID of the requester VPC.
190193

191194
### Usage
192195

@@ -196,13 +199,13 @@ The usage examples may assume that previous modules in this stack have already b
196199
module "vpc_peer" {
197200
source = "github.com/terraform-aws-vpc?ref=master//peer"
198201

199-
accepter_allow_remote_dns = false
200-
peer_owner_id = "${var.peer_owner_id}"
201-
peer_vpc_id = "${var.peer_vpc_id}"
202-
requester_allow_remote_dns = true
202+
accepter_allow_remote_dns = "false"
203+
accepter_owner_id = "${var.peer_owner_id}"
204+
accepter_vpc_id = "${var.peer_vpc_id}"
205+
requester_allow_remote_dns = "true"
206+
requester_vpc_id = "${var.owner_vpc_id}"
203207
stack_item_fullname = "${var.stack_item_fullname}"
204208
stack_item_label = "${var.stack_item_label}"
205-
vpc_id = "${var.owner_vpc_id}"
206209
}
207210
```
208211

Rakefile

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,4 @@
11
require 'rake'
2-
require 'dotenv'
3-
4-
Dotenv.load(".env")
5-
6-
task :default => :verify
7-
8-
desc "Verify the stack"
9-
task :verify do
10-
11-
%w(basic full_stack).each do |stack|
12-
task_args = {:stack => stack, :tf_img => ENV['TF_IMG'], :tf_cmd => ENV['TF_CMD']}
13-
Rake::Task['clean'].execute(Rake::TaskArguments.new(task_args.keys, task_args.values))
14-
Rake::Task['check_style'].execute(Rake::TaskArguments.new(task_args.keys, task_args.values))
15-
Rake::Task['get'].execute(Rake::TaskArguments.new(task_args.keys, task_args.values))
16-
Rake::Task['plan'].execute(Rake::TaskArguments.new(task_args.keys, task_args.values))
17-
end
18-
end
19-
20-
desc "Remove existing local state if present"
21-
task :clean, [:stack] do |t, args|
22-
sh "cd examples/#{args['stack']} && rm -fr .terraform *.tfstate*"
23-
end
24-
25-
desc "Check style"
26-
task :check_style, [:stack, :tf_img, :tf_cmd] do |t, args|
27-
sh "[ $(#{args['tf_cmd']} -v `pwd`:/data -w /data/examples/#{args['stack']} #{args['tf_img']} fmt -write=false | wc -l) -eq 0 ]"
28-
end
29-
30-
desc "Create execution plan"
31-
task :plan, [:stack, :tf_img, :tf_cmd] do |t, args|
32-
sh "#{args['tf_cmd']} -v `pwd`:/data -w /data/examples/#{args['stack']} #{args['tf_img']} plan -module-depth=-1 -input=false -var-file /data/examples/#{args['stack']}.tfvars"
33-
end
34-
35-
desc "Get modules"
36-
task :get, [:stack, :tf_img, :tf_cmd] do |t, args|
37-
sh "#{args['tf_cmd']} -v `pwd`:/data -w /data/examples/#{args['stack']} #{args['tf_img']} get"
38-
end
39-
40-
desc "Get output"
41-
task :output, [:stack, :tf_img, :tf_cmd, :output] do |t, args|
42-
sh "#{args['tf_cmd']} -v `pwd`:/data -w /data/examples/#{args['stack']} #{args['tf_img']} output #{args['output']}"
43-
end
44-
45-
desc "Apply stack"
46-
task :apply, [:stack, :tf_img, :tf_cmd, :var_file] do |t, args|
47-
sh "#{args['tf_cmd']} -v `pwd`:/data -w /data/examples/#{args['stack']} #{args['tf_img']} apply -var-file /data/examples/#{args['var_file']}"
48-
end
49-
50-
desc "Destroy stack"
51-
task :destroy, [:stack, :tf_img, :tf_cmd, :var_file] do |t, args|
52-
sh "#{args['tf_cmd']} -v `pwd`:/data -w /data/examples/#{args['stack']} #{args['tf_img']} destroy -force -var-file /data/examples/#{args['var_file']}"
53-
end
2+
require 'covalence/environment_tasks'
3+
require 'covalence/packer_tasks'
4+
require 'covalence/spec_tasks'

0 commit comments

Comments
 (0)