You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-4Lines changed: 54 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -181,6 +181,54 @@ Sometimes it is handy to have public access to Redshift clusters (for example if
181
181
182
182
It is possible to integrate this VPC module with [terraform-aws-transit-gateway module](https://github.com/terraform-aws-modules/terraform-aws-transit-gateway) which handles the creation of TGW resources and VPC attachments. See [complete example there](https://github.com/terraform-aws-modules/terraform-aws-transit-gateway/tree/master/examples/complete).
183
183
184
+
## VPC CIDR from AWS IP Address Manager (IPAM)
185
+
186
+
It is possible to have your VPC CIDR assigned from an [AWS IPAM Pool](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_ipam_pool). However, In order to build subnets within this module Terraform must know subnet CIDRs to properly plan the amount of resources to build. Since CIDR is derived by IPAM by calling CreateVpc this is not possible within a module unless cidr is known ahead of time. You can get around this by "previewing" the CIDR and then using that as the subnet values.
187
+
188
+
_Note: Due to race conditions with `terraform plan`, it is not possible to use `ipv4_netmask_length` or a pools `allocation_default_netmask_length` within this module. You must explicitly set the CIDRs for a pool to use._
189
+
190
+
```hcl
191
+
# Find the pool RAM shared to your account
192
+
# Info on RAM sharing pools: https://docs.aws.amazon.com/vpc/latest/ipam/share-pool-ipam.html
193
+
data "aws_vpc_ipam_pool" "ipv4_example" {
194
+
filter {
195
+
name = "description"
196
+
values = ["*mypool*"]
197
+
}
198
+
199
+
filter {
200
+
name = "address-family"
201
+
values = ["ipv4"]
202
+
}
203
+
}
204
+
205
+
# Preview next CIDR from pool
206
+
data "aws_vpc_ipam_preview_next_cidr" "previewed_cidr" {
| <aname="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 virtual private gateway is created with the current default Amazon ASN. |`string`|`"64512"`| no |
307
356
| <aname="input_assign_ipv6_address_on_creation"></a> [assign\_ipv6\_address\_on\_creation](#input\_assign\_ipv6\_address\_on\_creation)| Assign IPv6 address on subnet, must be disabled to change IPv6 CIDRs. This is the IPv6 equivalent of map\_public\_ip\_on\_launch |`bool`|`false`| no |
308
357
| <aname="input_azs"></a> [azs](#input\_azs)| A list of availability zones names or ids in the region |`list(string)`|`[]`| no |
309
-
| <aname="input_cidr"></a> [cidr](#input\_cidr)| The CIDR block for the VPC. Default value is a valid CIDR, but not acceptable by AWS and should be overridden|`string`|`"0.0.0.0/0"`| no |
358
+
| <aname="input_cidr"></a> [cidr](#input\_cidr)|(Optional) The IPv4 CIDR block for the VPC. |`string`|`"0.0.0.0/0"`| no |
310
359
| <aname="input_create_database_internet_gateway_route"></a> [create\_database\_internet\_gateway\_route](#input\_create\_database\_internet\_gateway\_route)| Controls if an internet gateway route for public database access should be created |`bool`|`false`| no |
311
360
| <aname="input_create_database_nat_gateway_route"></a> [create\_database\_nat\_gateway\_route](#input\_create\_database\_nat\_gateway\_route)| Controls if a nat gateway route should be created to give internet access to the database subnets |`bool`|`false`| no |
312
361
| <aname="input_create_database_subnet_group"></a> [create\_database\_subnet\_group](#input\_create\_database\_subnet\_group)| Controls if database subnet group should be created (n.b. database\_subnets must also be set) |`bool`|`true`| no |
@@ -405,6 +454,7 @@ No modules.
405
454
| <aname="input_intra_subnet_suffix"></a> [intra\_subnet\_suffix](#input\_intra\_subnet\_suffix)| Suffix to append to intra subnets name |`string`|`"intra"`| no |
406
455
| <aname="input_intra_subnet_tags"></a> [intra\_subnet\_tags](#input\_intra\_subnet\_tags)| Additional tags for the intra subnets |`map(string)`|`{}`| no |
407
456
| <aname="input_intra_subnets"></a> [intra\_subnets](#input\_intra\_subnets)| A list of intra subnets |`list(string)`|`[]`| no |
457
+
| <aname="input_ipv4_ipam_pool_id"></a> [ipv4\_ipam\_pool\_id](#input\_ipv4\_ipam\_pool\_id)| (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. |`string`|`null`| no |
408
458
| <aname="input_manage_default_network_acl"></a> [manage\_default\_network\_acl](#input\_manage\_default\_network\_acl)| Should be true to adopt and manage Default Network ACL |`bool`|`false`| no |
409
459
| <aname="input_manage_default_route_table"></a> [manage\_default\_route\_table](#input\_manage\_default\_route\_table)| Should be true to manage default route table |`bool`|`false`| no |
410
460
| <aname="input_manage_default_security_group"></a> [manage\_default\_security\_group](#input\_manage\_default\_security\_group)| Should be true to adopt and manage default security group |`bool`|`false`| no |
@@ -560,7 +610,7 @@ No modules.
560
610
| <aname="output_public_subnets_ipv6_cidr_blocks"></a> [public\_subnets\_ipv6\_cidr\_blocks](#output\_public\_subnets\_ipv6\_cidr\_blocks)| List of IPv6 cidr\_blocks of public subnets in an IPv6 enabled VPC |
561
611
| <aname="output_redshift_network_acl_arn"></a> [redshift\_network\_acl\_arn](#output\_redshift\_network\_acl\_arn)| ARN of the redshift network ACL |
562
612
| <aname="output_redshift_network_acl_id"></a> [redshift\_network\_acl\_id](#output\_redshift\_network\_acl\_id)| ID of the redshift network ACL |
563
-
| <aname="output_redshift_public_route_table_association_ids"></a> [redshift\_public\_route\_table\_association\_ids](#output\_redshift\_public\_route\_table\_association\_ids)| List of IDs of the public redshidt route table association |
613
+
| <aname="output_redshift_public_route_table_association_ids"></a> [redshift\_public\_route\_table\_association\_ids](#output\_redshift\_public\_route\_table\_association\_ids)| List of IDs of the public redshift route table association |
564
614
| <aname="output_redshift_route_table_association_ids"></a> [redshift\_route\_table\_association\_ids](#output\_redshift\_route\_table\_association\_ids)| List of IDs of the redshift route table association |
565
615
| <aname="output_redshift_route_table_ids"></a> [redshift\_route\_table\_ids](#output\_redshift\_route\_table\_ids)| List of IDs of redshift route tables |
566
616
| <aname="output_redshift_subnet_arns"></a> [redshift\_subnet\_arns](#output\_redshift\_subnet\_arns)| List of ARNs of redshift subnets |
| <aname="output_public_subnets_ipv6_cidr_blocks"></a> [public\_subnets\_ipv6\_cidr\_blocks](#output\_public\_subnets\_ipv6\_cidr\_blocks)| List of IPv6 cidr\_blocks of public subnets in an IPv6 enabled VPC |
137
137
| <aname="output_redshift_network_acl_arn"></a> [redshift\_network\_acl\_arn](#output\_redshift\_network\_acl\_arn)| ARN of the redshift network ACL |
138
138
| <aname="output_redshift_network_acl_id"></a> [redshift\_network\_acl\_id](#output\_redshift\_network\_acl\_id)| ID of the redshift network ACL |
139
-
| <aname="output_redshift_public_route_table_association_ids"></a> [redshift\_public\_route\_table\_association\_ids](#output\_redshift\_public\_route\_table\_association\_ids)| List of IDs of the public redshidt route table association |
139
+
| <aname="output_redshift_public_route_table_association_ids"></a> [redshift\_public\_route\_table\_association\_ids](#output\_redshift\_public\_route\_table\_association\_ids)| List of IDs of the public redshift route table association |
140
140
| <aname="output_redshift_route_table_association_ids"></a> [redshift\_route\_table\_association\_ids](#output\_redshift\_route\_table\_association\_ids)| List of IDs of the redshift route table association |
141
141
| <aname="output_redshift_route_table_ids"></a> [redshift\_route\_table\_ids](#output\_redshift\_route\_table\_ids)| List of IDs of redshift route tables |
142
142
| <aname="output_redshift_subnet_arns"></a> [redshift\_subnet\_arns](#output\_redshift\_subnet\_arns)| List of ARNs of redshift subnets |
0 commit comments