-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from unifio/vgw-prop-support
VGW route propagation support
- Loading branch information
Showing
16 changed files
with
159 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Route table | ||
|
||
resource "aws_route_table" "rt" { | ||
count = "${(var.vgw_prop + 1 % 2) * var.rt_count}" | ||
vpc_id = "${var.vpc_id}" | ||
|
||
tags { | ||
Name = "${var.stack_item_label}-${count.index}" | ||
application = "${var.stack_item_fullname}" | ||
managed_by = "terraform" | ||
} | ||
} | ||
|
||
resource "aws_route_table" "rt_vgw_prop" { | ||
count = "${var.vgw_prop * var.rt_count}" | ||
vpc_id = "${var.vpc_id}" | ||
propagating_vgws = ["${split(",",var.vgw_ids)}"] | ||
|
||
tags { | ||
Name = "${var.stack_item_label}-${count.index}" | ||
application = "${var.stack_item_fullname}" | ||
managed_by = "terraform" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Outputs | ||
|
||
output "rt_id" { | ||
value = "${coalesce(join(",",aws_route_table.rt.*.id),join(",",aws_route_table.rt_vgw_prop.*.id))}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Input Variables | ||
|
||
## Resource Tags | ||
variable "stack_item_label" { | ||
type = "string" | ||
} | ||
|
||
variable "stack_item_fullname" { | ||
type = "string" | ||
} | ||
|
||
## VPC parameters | ||
variable "vpc_id" { | ||
type = "string" | ||
} | ||
|
||
variable "vgw_prop" { | ||
type = "string" | ||
} | ||
|
||
variable "vgw_ids" { | ||
type = "string" | ||
} | ||
|
||
variable "rt_count" { | ||
type = "string" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
# Input Variables | ||
|
||
## Resource tags | ||
variable "stack_item_label" {} | ||
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." | ||
} | ||
|
||
variable "stack_item_fullname" {} | ||
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." | ||
} | ||
|
||
## VPC parameters | ||
variable "vpc_id" {} | ||
variable "vpc_id" { | ||
type = "string" | ||
description = "The ID of the VPC" | ||
default = "" | ||
} | ||
|
||
variable "vpc_attach" { | ||
type = "string" | ||
description = "Specifies whether the VPG should be associated with a VPC." | ||
default = 0 | ||
} |