|
42 | 42 |
|
43 | 43 | [![Cloud Posse][logo]](https://cpco.io/homepage) |
44 | 44 |
|
45 | | -# terraform-aws-dynamic-subnets [](https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d02dad8572be040f879f8ed) [](https://github.com/cloudposse/terraform-aws-dynamic-subnets/releases/latest) [](https://slack.cloudposse.com) |
| 45 | +# terraform-aws-dynamic-subnets [](https://github.com/cloudposse/terraform-aws-dynamic-subnets/releases/latest) [](https://slack.cloudposse.com) |
46 | 46 |
|
47 | 47 |
|
48 | 48 | Terraform module to provision public and private [`subnets`](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) in an existing [`VPC`](https://aws.amazon.com/vpc) |
@@ -191,51 +191,67 @@ Available targets: |
191 | 191 | lint Lint terraform code |
192 | 192 |
|
193 | 193 | ``` |
| 194 | +## Requirements |
| 195 | + |
| 196 | +| Name | Version | |
| 197 | +|------|---------| |
| 198 | +| terraform | ~> 0.12.0 | |
| 199 | +| aws | ~> 2.0 | |
| 200 | +| local | ~> 1.2 | |
| 201 | +| null | ~> 2.0 | |
| 202 | +| template | ~> 2.0 | |
| 203 | + |
| 204 | +## Providers |
| 205 | + |
| 206 | +| Name | Version | |
| 207 | +|------|---------| |
| 208 | +| aws | ~> 2.0 | |
| 209 | + |
194 | 210 | ## Inputs |
195 | 211 |
|
196 | 212 | | Name | Description | Type | Default | Required | |
197 | | -|------|-------------|:----:|:-----:|:-----:| |
198 | | -| additional_tag_map | Additional tags for appending to each tag map | map(string) | `<map>` | no | |
199 | | -| attributes | Any extra attributes for naming these resources | list(string) | `<list>` | no | |
200 | | -| availability_zones | List of Availability Zones where subnets will be created | list(string) | - | yes | |
201 | | -| cidr_block | Base CIDR block which will be divided into subnet CIDR blocks (e.g. `10.0.0.0/16`) | string | - | yes | |
202 | | -| context | Default context to use for passing state between label invocations | object | `<map>` | no | |
203 | | -| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | string | `-` | no | |
204 | | -| environment | The environment name if not using stage | string | `` | no | |
205 | | -| igw_id | Internet Gateway ID the public route table will point to (e.g. `igw-9c26a123`) | string | - | yes | |
206 | | -| label_order | The naming order of the ID output and Name tag | list(string) | `<list>` | no | |
207 | | -| map_public_ip_on_launch | Instances launched into a public subnet should be assigned a public IP address | bool | `true` | no | |
208 | | -| max_subnet_count | Sets the maximum amount of subnets to deploy. 0 will deploy a subnet for every provided availablility zone (in `availability_zones` variable) within the region | string | `0` | no | |
209 | | -| name | Solution name, e.g. 'app' or 'cluster' | string | `` | no | |
210 | | -| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no | |
211 | | -| nat_gateway_enabled | Flag to enable/disable NAT Gateways to allow servers in the private subnets to access the Internet | bool | `true` | no | |
212 | | -| nat_instance_enabled | Flag to enable/disable NAT Instances to allow servers in the private subnets to access the Internet | bool | `false` | no | |
213 | | -| nat_instance_type | NAT Instance type | string | `t3.micro` | no | |
214 | | -| private_network_acl_id | Network ACL ID that will be added to private subnets. If empty, a new ACL will be created | string | `` | no | |
215 | | -| private_subnets_additional_tags | Additional tags to be added to private subnets | map(string) | `<map>` | no | |
216 | | -| public_network_acl_id | Network ACL ID that will be added to public subnets. If empty, a new ACL will be created | string | `` | no | |
217 | | -| public_subnets_additional_tags | Additional tags to be added to public subnets | map(string) | `<map>` | no | |
218 | | -| regex_replace_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed | string | `/[^a-zA-Z0-9-]/` | no | |
219 | | -| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | `` | no | |
220 | | -| subnet_type_tag_key | Key for subnet type tag to provide information about the type of subnets, e.g. `cpco.io/subnet/type=private` or `cpco.io/subnet/type=public` | string | `cpco.io/subnet/type` | no | |
221 | | -| subnet_type_tag_value_format | This is using the format interpolation symbols to allow the value of the subnet_type_tag_key to be modified. | string | `%s` | no | |
222 | | -| tags | Additional tags to apply to all resources that use this label module | map(string) | `<map>` | no | |
223 | | -| vpc_default_route_table_id | Default route table for public subnets. If not set, will be created. (e.g. `rtb-f4f0ce12`) | string | `` | no | |
224 | | -| vpc_id | VPC ID where subnets will be created (e.g. `vpc-aceb2723`) | string | - | yes | |
| 213 | +|------|-------------|------|---------|:--------:| |
| 214 | +| additional\_tag\_map | Additional tags for appending to each tag map | `map(string)` | `{}` | no | |
| 215 | +| attributes | Any extra attributes for naming these resources | `list(string)` | `[]` | no | |
| 216 | +| availability\_zones | List of Availability Zones where subnets will be created | `list(string)` | n/a | yes | |
| 217 | +| cidr\_block | Base CIDR block which will be divided into subnet CIDR blocks (e.g. `10.0.0.0/16`) | `string` | n/a | yes | |
| 218 | +| context | Default context to use for passing state between label invocations | <pre>object({<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> enabled = bool<br> delimiter = string<br> attributes = list(string)<br> label_order = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": "",<br> "enabled": true,<br> "environment": "",<br> "label_order": [],<br> "name": "",<br> "namespace": "",<br> "regex_replace_chars": "",<br> "stage": "",<br> "tags": {}<br>}</pre> | no | |
| 219 | +| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no | |
| 220 | +| environment | The environment name if not using stage | `string` | `""` | no | |
| 221 | +| igw\_id | Internet Gateway ID the public route table will point to (e.g. `igw-9c26a123`) | `string` | n/a | yes | |
| 222 | +| label\_order | The naming order of the ID output and Name tag | `list(string)` | `[]` | no | |
| 223 | +| map\_public\_ip\_on\_launch | Instances launched into a public subnet should be assigned a public IP address | `bool` | `true` | no | |
| 224 | +| max\_subnet\_count | Sets the maximum amount of subnets to deploy. 0 will deploy a subnet for every provided availablility zone (in `availability_zones` variable) within the region | `number` | `0` | no | |
| 225 | +| name | Solution name, e.g. 'app' or 'cluster' | `string` | `""` | no | |
| 226 | +| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `""` | no | |
| 227 | +| nat\_gateway\_enabled | Flag to enable/disable NAT Gateways to allow servers in the private subnets to access the Internet | `bool` | `true` | no | |
| 228 | +| nat\_instance\_enabled | Flag to enable/disable NAT Instances to allow servers in the private subnets to access the Internet | `bool` | `false` | no | |
| 229 | +| nat\_instance\_type | NAT Instance type | `string` | `"t3.micro"` | no | |
| 230 | +| private\_network\_acl\_id | Network ACL ID that will be added to private subnets. If empty, a new ACL will be created | `string` | `""` | no | |
| 231 | +| private\_subnets\_additional\_tags | Additional tags to be added to private subnets | `map(string)` | `{}` | no | |
| 232 | +| public\_network\_acl\_id | Network ACL ID that will be added to public subnets. If empty, a new ACL will be created | `string` | `""` | no | |
| 233 | +| public\_subnets\_additional\_tags | Additional tags to be added to public subnets | `map(string)` | `{}` | no | |
| 234 | +| regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed | `string` | `"/[^a-zA-Z0-9-]/"` | no | |
| 235 | +| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | `string` | `""` | no | |
| 236 | +| subnet\_type\_tag\_key | Key for subnet type tag to provide information about the type of subnets, e.g. `cpco.io/subnet/type=private` or `cpco.io/subnet/type=public` | `string` | `"cpco.io/subnet/type"` | no | |
| 237 | +| subnet\_type\_tag\_value\_format | This is using the format interpolation symbols to allow the value of the subnet\_type\_tag\_key to be modified. | `string` | `"%s"` | no | |
| 238 | +| tags | Additional tags to apply to all resources that use this label module | `map(string)` | `{}` | no | |
| 239 | +| vpc\_default\_route\_table\_id | Default route table for public subnets. If not set, will be created. (e.g. `rtb-f4f0ce12`) | `string` | `""` | no | |
| 240 | +| vpc\_id | VPC ID where subnets will be created (e.g. `vpc-aceb2723`) | `string` | n/a | yes | |
225 | 241 |
|
226 | 242 | ## Outputs |
227 | 243 |
|
228 | 244 | | Name | Description | |
229 | 245 | |------|-------------| |
230 | | -| availability_zones | List of Availability Zones where subnets were created | |
231 | | -| nat_gateway_ids | IDs of the NAT Gateways created | |
232 | | -| nat_instance_ids | IDs of the NAT Instances created | |
233 | | -| private_route_table_ids | IDs of the created private route tables | |
234 | | -| private_subnet_cidrs | CIDR blocks of the created private subnets | |
235 | | -| private_subnet_ids | IDs of the created private subnets | |
236 | | -| public_route_table_ids | IDs of the created public route tables | |
237 | | -| public_subnet_cidrs | CIDR blocks of the created public subnets | |
238 | | -| public_subnet_ids | IDs of the created public subnets | |
| 246 | +| availability\_zones | List of Availability Zones where subnets were created | |
| 247 | +| nat\_gateway\_ids | IDs of the NAT Gateways created | |
| 248 | +| nat\_instance\_ids | IDs of the NAT Instances created | |
| 249 | +| private\_route\_table\_ids | IDs of the created private route tables | |
| 250 | +| private\_subnet\_cidrs | CIDR blocks of the created private subnets | |
| 251 | +| private\_subnet\_ids | IDs of the created private subnets | |
| 252 | +| public\_route\_table\_ids | IDs of the created public route tables | |
| 253 | +| public\_subnet\_cidrs | CIDR blocks of the created public subnets | |
| 254 | +| public\_subnet\_ids | IDs of the created public subnets | |
239 | 255 |
|
240 | 256 |
|
241 | 257 |
|
@@ -292,6 +308,10 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our |
292 | 308 |
|
293 | 309 | Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure. |
294 | 310 |
|
| 311 | +## Discourse Forums |
| 312 | + |
| 313 | +Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account. |
| 314 | + |
295 | 315 | ## Newsletter |
296 | 316 |
|
297 | 317 | Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover. |
@@ -415,6 +435,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply |
415 | 435 | [testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=testimonial |
416 | 436 | [office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=office_hours |
417 | 437 | [newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=newsletter |
| 438 | + [discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=discourse |
418 | 439 | [email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=email |
419 | 440 | [commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=commercial_support |
420 | 441 | [we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-dynamic-subnets&utm_content=we_love_open_source |
|
0 commit comments