Skip to content

Commit 131ed50

Browse files
authored
feat: Add support for transit gateway CIDR blocks (#69)
1 parent 16ad24e commit 131ed50

File tree

9 files changed

+32
-9
lines changed

9 files changed

+32
-9
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ module "vpc" {
6969
| Name | Version |
7070
|------|---------|
7171
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
72-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.15 |
72+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.4 |
7373

7474
## Providers
7575

7676
| Name | Version |
7777
|------|---------|
78-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.15 |
78+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.4 |
7979

8080
## Modules
8181

@@ -102,7 +102,7 @@ No modules.
102102

103103
| Name | Description | Type | Default | Required |
104104
|------|-------------|------|---------|:--------:|
105-
| <a name="input_amazon_side_asn"></a> [amazon\_side\_asn](#input\_amazon\_side\_asn) | The Autonomous System Number (ASN) for the Amazon side of the gateway. By default the TGW is created with the current default Amazon ASN. | `string` | `"64512"` | no |
105+
| <a name="input_amazon_side_asn"></a> [amazon\_side\_asn](#input\_amazon\_side\_asn) | The Autonomous System Number (ASN) for the Amazon side of the gateway. By default the TGW is created with the current default Amazon ASN. | `string` | `null` | no |
106106
| <a name="input_create_tgw"></a> [create\_tgw](#input\_create\_tgw) | Controls if TGW should be created (it affects almost all resources) | `bool` | `true` | no |
107107
| <a name="input_description"></a> [description](#input\_description) | Description of the EC2 Transit Gateway | `string` | `null` | no |
108108
| <a name="input_enable_auto_accept_shared_attachments"></a> [enable\_auto\_accept\_shared\_attachments](#input\_enable\_auto\_accept\_shared\_attachments) | Whether resource attachment requests are automatically accepted | `bool` | `false` | no |
@@ -122,6 +122,8 @@ No modules.
122122
| <a name="input_tgw_route_table_tags"></a> [tgw\_route\_table\_tags](#input\_tgw\_route\_table\_tags) | Additional tags for the TGW route table | `map(string)` | `{}` | no |
123123
| <a name="input_tgw_tags"></a> [tgw\_tags](#input\_tgw\_tags) | Additional tags for the TGW | `map(string)` | `{}` | no |
124124
| <a name="input_tgw_vpc_attachment_tags"></a> [tgw\_vpc\_attachment\_tags](#input\_tgw\_vpc\_attachment\_tags) | Additional tags for VPC attachments | `map(string)` | `{}` | no |
125+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Create, update, and delete timeout configurations for the transit gateway | `map(string)` | `{}` | no |
126+
| <a name="input_transit_gateway_cidr_blocks"></a> [transit\_gateway\_cidr\_blocks](#input\_transit\_gateway\_cidr\_blocks) | One or more IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size /24 CIDR block or larger for IPv4, or a size /64 CIDR block or larger for IPv6 | `list(string)` | `[]` | no |
125127
| <a name="input_transit_gateway_route_table_id"></a> [transit\_gateway\_route\_table\_id](#input\_transit\_gateway\_route\_table\_id) | Identifier of EC2 Transit Gateway Route Table to use with the Target Gateway when reusing it between multiple TGWs | `string` | `null` | no |
126128
| <a name="input_vpc_attachments"></a> [vpc\_attachments](#input\_vpc\_attachments) | Maps of maps of VPC details to attach to TGW. Type 'any' to disable type validation by Terraform. | `any` | `{}` | no |
127129

examples/complete/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.15 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.4 |
2424

2525
## Providers
2626

examples/complete/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module "tgw" {
2424
description = "My TGW shared with several other AWS accounts"
2525
amazon_side_asn = 64532
2626

27+
transit_gateway_cidr_blocks = ["10.99.0.0/24"]
28+
2729
# When "true" there is no need for RAM resources if using multiple AWS accounts
2830
enable_auto_accept_shared_attachments = true
2931

examples/complete/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.15"
7+
version = ">= 4.4"
88
}
99
}
1010
}

examples/multi-account/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.15 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.4 |
2424

2525
## Providers
2626

examples/multi-account/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.15"
7+
version = ">= 4.4"
88
}
99
}
1010
}

main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ resource "aws_ec2_transit_gateway" "this" {
3434
auto_accept_shared_attachments = var.enable_auto_accept_shared_attachments ? "enable" : "disable"
3535
vpn_ecmp_support = var.enable_vpn_ecmp_support ? "enable" : "disable"
3636
dns_support = var.enable_dns_support ? "enable" : "disable"
37+
transit_gateway_cidr_blocks = var.transit_gateway_cidr_blocks
38+
39+
timeouts {
40+
create = try(var.timeouts.create, null)
41+
update = try(var.timeouts.update, null)
42+
delete = try(var.timeouts.delete, null)
43+
}
3744

3845
tags = merge(
3946
var.tags,

variables.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ variable "description" {
2929
variable "amazon_side_asn" {
3030
description = "The Autonomous System Number (ASN) for the Amazon side of the gateway. By default the TGW is created with the current default Amazon ASN."
3131
type = string
32-
default = "64512"
32+
default = null
3333
}
3434

3535
variable "enable_default_route_table_association" {
@@ -62,6 +62,18 @@ variable "enable_dns_support" {
6262
default = true
6363
}
6464

65+
variable "transit_gateway_cidr_blocks" {
66+
description = "One or more IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size /24 CIDR block or larger for IPv4, or a size /64 CIDR block or larger for IPv6"
67+
type = list(string)
68+
default = []
69+
}
70+
71+
variable "timeouts" {
72+
description = "Create, update, and delete timeout configurations for the transit gateway"
73+
type = map(string)
74+
default = {}
75+
}
76+
6577
variable "tgw_tags" {
6678
description = "Additional tags for the TGW"
6779
type = map(string)

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.15"
7+
version = ">= 4.4"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)