Skip to content

Commit

Permalink
Merge pull request #25 from unifio/covalence-update
Browse files Browse the repository at this point in the history
Documentation & Examples updates
  • Loading branch information
blakeneyops authored May 16, 2017
2 parents f4f994b + 4cfbbda commit fd3c29d
Show file tree
Hide file tree
Showing 18 changed files with 202 additions and 140 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
#### Consider Implementing:
* ipv6 support

## 0.3.2 (May 16, 2017)

#### BACKWARDS INCOMPATIBILITIES / NOTES:
* The following output variables have been changed:
* az module
* `dmz_cidrs (string)` -> `dmz_cidrs (list)`
* `dmz_ids (string)` -> `dmz_ids (list)`
* `eip_nat_ids (string)` -> `eip_nat_ids (list)`
* `eip_nat_ips (string)` -> `eip_nat_ips (list)`
* `lan_ids (string)` -> `lan_ids (list)`
* `lan_cidrs (string)` -> `lan_cidrs (list)`
* `nat_ids (string)` -> `nat_ids (list)`
* `rt_lan_ids (string)` -> `rt_lan_ids (list)`
* The following input variable have been changed:
* az module
* `stack_item_fullname` now defaults to a value of `VPC Quick Start`
* `stack_item_label` now defaults to a value of `exmpl`

## 0.3.1 (April 23, 2017)

#### IMPROVEMENTS / NEW FEATURES:
Expand Down
202 changes: 119 additions & 83 deletions README.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions az/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@

## Returns Subnet IDs
output "dmz_ids" {
value = "${join(",",aws_subnet.dmz.*.id)}"
value = ["${aws_subnet.dmz.*.id}"]
}

output "lan_ids" {
value = "${join(",",aws_subnet.lan.*.id)}"
value = ["${aws_subnet.lan.*.id}"]
}

## Returns Subnet CIDR blocks
output "dmz_cidrs" {
value = "${join(",",aws_subnet.dmz.*.cidr_block)}"
value = ["${aws_subnet.dmz.*.cidr_block}"]
}

output "lan_cidrs" {
value = "${join(",",aws_subnet.lan.*.cidr_block)}"
value = ["${aws_subnet.lan.*.cidr_block}"]
}

## Returns information about the NATs
output "eip_nat_ids" {
value = "${join(",",aws_eip.eip_nat.*.id)}"
value = ["${aws_eip.eip_nat.*.id}"]
}

output "eip_nat_ips" {
value = "${join(",",aws_eip.eip_nat.*.public_ip)}"
value = ["${aws_eip.eip_nat.*.public_ip}"]
}

output "nat_ids" {
value = "${coalesce(join(",",aws_instance.nat.*.id),join(",",aws_nat_gateway.nat.*.id))}"
value = ["${compact(concat(aws_instance.nat.*.id,aws_nat_gateway.nat.*.id))}"]
}

## Returns the routing table ID
output "rt_lan_ids" {
value = "${join(",",aws_route_table.rt_lan.*.id)}"
value = ["${aws_route_table.rt_lan.*.id}"]
}
2 changes: 2 additions & 0 deletions az/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
variable "stack_item_fullname" {
type = "string"
description = "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."
default = "VPC Quick Start"
}

variable "stack_item_label" {
type = "string"
description = "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."
default = "qckstrt"
}

## VPC parameters
Expand Down
3 changes: 3 additions & 0 deletions base/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
variable "stack_item_fullname" {
type = "string"
description = "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."
default = "VPC Quick Start"
}

variable "stack_item_label" {
type = "string"
description = "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."
default = "qckstrt"
}

## VPC parameters
Expand Down Expand Up @@ -39,6 +41,7 @@ variable "instance_tenancy" {
variable "vpc_cidr" {
type = "string"
description = "The CIDR block for the VPC."
default = "172.16.0.0/21"
}

## Flow log parameters
Expand Down
13 changes: 10 additions & 3 deletions data/stacks/overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ examples::complete::vars:
enable_classiclink: 'true'
instance_tenacy: 'dedicated'
lans_per_az: '2'
name_servers: '172.16.0.2,172.16.1.2,172.16.2.2'
name_servers:
- '172.16.0.2'
- '172.16.1.2'
- '172.16.2.2'
nat_gateways_enabled: 'true'
netbios_name_servers: '172.16.0.2,172.16.1.2,172.16.2.2'
ntp_servers: '127.0.0.1'
netbios_name_servers:
- '172.16.0.2'
- '172.16.1.2'
- '172.16.2.2'
ntp_servers:
- '127.0.0.1'
stack_item_label: 'cmpl'
vpc_cidr: '172.16.0.0/21'
8 changes: 4 additions & 4 deletions data/stacks/peer-connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ examples::peering::vars:
accepter_rt_lan_ids:
type: 's3.state'
bucket: "%{hiera('tf_state_bucket')}"
document: "terraform-aws-vpc/complete/peer/terraform.tfstate"
document: 'terraform-aws-vpc/complete/peer/terraform.tfstate'
key: 'lan_rt_ids'
accepter_vpc_cidr: '172.17.0.0/21'
accepter_vpc_id:
type: 's3.state'
bucket: "%{hiera('tf_state_bucket')}"
document: "terraform-aws-vpc/complete/peer/terraform.tfstate"
document: 'terraform-aws-vpc/complete/peer/terraform.tfstate'
key: 'vpc_id'
requester_rt_lan_ids:
type: 's3.state'
bucket: "%{hiera('tf_state_bucket')}"
document: "terraform-aws-vpc/complete/terraform.tfstate"
document: 'terraform-aws-vpc/complete/terraform.tfstate'
key: 'lan_rt_ids'
requester_vpc_cidr: '172.16.0.0/21'
requester_vpc_id:
type: 's3.state'
bucket: "%{hiera('tf_state_bucket')}"
document: "terraform-aws-vpc/complete/terraform.tfstate"
document: 'terraform-aws-vpc/complete/terraform.tfstate'
key: 'vpc_id'
stack_item_label: 'cmpl'
13 changes: 10 additions & 3 deletions data/stacks/peer-vpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ peer-vpc::state:
examples::complete::vars:
domain_name: 'complete.example'
enable_hostnames: 'true'
name_servers: '172.17.0.2,172.17.1.2,172.17.2.2'
netbios_name_servers: '172.17.0.2,172.17.1.2,172.17.2.2'
ntp_servers: '127.0.0.1'
name_servers:
- '172.17.0.2'
- '172.17.1.2'
- '172.17.2.2'
netbios_name_servers:
- '172.17.0.2'
- '172.17.1.2'
- '172.17.2.2'
ntp_servers:
- '127.0.0.1'
stack_item_label: 'cmpl-peer'
vpc_cidr: '172.17.0.0/21'
4 changes: 0 additions & 4 deletions examples/basic.tfvars

This file was deleted.

4 changes: 2 additions & 2 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ resource "aws_route" "lan-to-nat" {
count = "${var.azs_provisioned * var.lans_per_az}"

destination_cidr_block = "0.0.0.0/0"
instance_id = "${element(split(",",module.vpc_az.nat_ids),count.index)}"
route_table_id = "${element(split(",",module.vpc_az.rt_lan_ids),count.index)}"
instance_id = "${element(module.vpc_az.nat_ids,count.index)}"
route_table_id = "${element(module.vpc_az.rt_lan_ids,count.index)}"
}
6 changes: 3 additions & 3 deletions examples/basic/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ output "vpc_id" {
}

output "dmz_subnet_ids" {
value = "${join(",",module.vpc_az.dmz_ids)}"
value = "${module.vpc_az.dmz_ids}"
}

output "lan_subnet_ids" {
value = "${join(",",module.vpc_az.lan_ids)}"
value = "${module.vpc_az.lan_ids}"
}

output "lan_rt_ids" {
value = "${join(",",module.vpc_az.rt_lan_ids)}"
value = "${module.vpc_az.rt_lan_ids}"
}
18 changes: 9 additions & 9 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ module "vpc_dhcp" {
source = "../../dhcp"

domain_name = "${var.domain_name}"
name_servers = ["${split(",",var.name_servers)}"]
netbios_name_servers = ["${split(",",var.netbios_name_servers)}"]
name_servers = ["${var.name_servers}"]
netbios_name_servers = ["${var.netbios_name_servers}"]
netbios_node_type = "${var.netbios_node_type}"
ntp_servers = ["${split(",",var.ntp_servers)}"]
ntp_servers = ["${var.ntp_servers}"]
stack_item_fullname = "${var.stack_item_fullname}"
stack_item_label = "${var.stack_item_label}"
vpc_id = "${module.vpc_base.vpc_id}"
Expand All @@ -38,7 +38,7 @@ module "vpc_dhcp" {
## Configures ACLs
resource "aws_network_acl" "acl" {
vpc_id = "${module.vpc_base.vpc_id}"
subnet_ids = ["${concat(split(",",module.vpc_az.lan_ids),split(",",module.vpc_az.dmz_ids))}"]
subnet_ids = ["${concat(module.vpc_az.lan_ids,module.vpc_az.dmz_ids)}"]

tags {
application = "${var.stack_item_fullname}"
Expand Down Expand Up @@ -103,20 +103,20 @@ resource "aws_route" "lan-to-nat-gw" {
count = "${length(var.azs_provisioned_override) * (length(var.lans_per_az) > 0 ? var.lans_per_az : "1") * signum(var.nat_gateways_enabled == "true" ? "1" : "0")}"

destination_cidr_block = "0.0.0.0/0"
nat_gateway_id = "${element(split(",",module.vpc_az.nat_ids),count.index)}"
route_table_id = "${element(split(",",module.vpc_az.rt_lan_ids),count.index)}"
nat_gateway_id = "${element(module.vpc_az.nat_ids,count.index)}"
route_table_id = "${element(module.vpc_az.rt_lan_ids,count.index)}"
}

resource "aws_route" "lan-to-nat" {
count = "${length(var.azs_provisioned_override) * (length(var.lans_per_az) > 0 ? var.lans_per_az : "1") * signum(var.nat_gateways_enabled == "true" ? "0" : "1")}"

destination_cidr_block = "0.0.0.0/0"
instance_id = "${element(split(",",module.vpc_az.nat_ids),count.index)}"
route_table_id = "${element(split(",",module.vpc_az.rt_lan_ids),count.index)}"
instance_id = "${element(module.vpc_az.nat_ids,count.index)}"
route_table_id = "${element(module.vpc_az.rt_lan_ids,count.index)}"
}

resource "aws_vpc_endpoint" "s3-ep" {
route_table_ids = ["${split(",",module.vpc_az.rt_lan_ids)}"]
route_table_ids = ["${module.vpc_az.rt_lan_ids}"]
service_name = "com.amazonaws.${var.region}.s3"
vpc_id = "${module.vpc_base.vpc_id}"
}
12 changes: 6 additions & 6 deletions examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ variable "domain_name" {
}

variable "name_servers" {
type = "string"
default = ""
type = "list"
default = []
}

variable "netbios_name_servers" {
type = "string"
default = ""
type = "list"
default = []
}

variable "netbios_node_type" {
Expand All @@ -70,6 +70,6 @@ variable "netbios_node_type" {
}

variable "ntp_servers" {
type = "string"
default = ""
type = "list"
default = []
}
4 changes: 0 additions & 4 deletions examples/full_stack.tfvars

This file was deleted.

4 changes: 0 additions & 4 deletions examples/peering.tfvars

This file was deleted.

8 changes: 4 additions & 4 deletions examples/peering/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ module "vpc_peer" {
}

resource "aws_route" "requester-to-accepter" {
count = "${length(split(",",var.requester_rt_lan_ids))}"
count = "${length(var.requester_rt_lan_ids)}"

destination_cidr_block = "${var.accepter_vpc_cidr}"
route_table_id = "${element(split(",",var.requester_rt_lan_ids),count.index)}"
route_table_id = "${element(var.requester_rt_lan_ids,count.index)}"
vpc_peering_connection_id = "${module.vpc_peer.peer_connection_id}"
}

resource "aws_route" "accepter-to-requester" {
count = "${length(split(",",var.accepter_rt_lan_ids))}"
count = "${length(var.accepter_rt_lan_ids)}"

destination_cidr_block = "${var.requester_vpc_cidr}"
route_table_id = "${element(split(",",var.accepter_rt_lan_ids),count.index)}"
route_table_id = "${element(var.accepter_rt_lan_ids,count.index)}"
vpc_peering_connection_id = "${module.vpc_peer.peer_connection_id}"
}
4 changes: 2 additions & 2 deletions examples/peering/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ variable "stack_item_label" {

## Peering Parameters
variable "accepter_rt_lan_ids" {
type = "string"
type = "list"
description = "The IDs of the peer VPC routing tables."
}

Expand All @@ -32,7 +32,7 @@ variable "region" {
}

variable "requester_rt_lan_ids" {
type = "string"
type = "list"
description = "The IDs of the requesting VPC routing tables."
}

Expand Down
3 changes: 2 additions & 1 deletion peer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ variable "accepter_vpc_id" {
variable "requester_allow_classic_link_to_remote" {
type = "string"
description = "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."
default = "false"
default = ""
}

variable "requester_allow_remote_dns" {
type = "string"
description = "Allow requester VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the accepter VPC."
default = "false"
}

variable "requester_allow_to_remote_classic_link" {
Expand Down

0 comments on commit fd3c29d

Please sign in to comment.