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
feat: added new input variables to give full flexibility over VPC resource naming. New variables include: vpc_flow_logs_name, public_gateway_name, routing_table_name, dns_custom_resolver_name, dns_instance_name, and dns_binding_name. (#697)
Copy file name to clipboardExpand all lines: README.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,10 @@ module vpc {
58
58
}
59
59
```
60
60
61
+
### Resource naming
62
+
63
+
The module automatically generates names for the all provisioned VPC resources using the `var.prefix` input variable. You can selectively override this behavior by giving explicit names through the following input variables: `name` (for VPC name), `dns_binding_name`, `dns_instance_name`, `dns_custom_resolver_name`, `routing_table_name`, `public_gateway_name`, and `vpc_flow_logs_name`.
64
+
61
65
### Subnets
62
66
63
67
You can create a maximum of three zones in the [subnet.tf](subnet.tf) file. The zones are defined as lists in the file, and then are converted to objects before the resources are provisioned. The conversion ensures that the addition or deletion of subnets affects only the added or deleted subnets, as shown in the following example.
@@ -142,6 +146,9 @@ To attach access management tags to resources in this module, you need the follo
142
146
| <aname="input_default_network_acl_name"></a> [default\_network\_acl\_name](#input\_default\_network\_acl\_name)| OPTIONAL - Name of the Default ACL. If null, a name will be automatically generated |`string`|`null`| no |
143
147
| <aname="input_default_routing_table_name"></a> [default\_routing\_table\_name](#input\_default\_routing\_table\_name)| OPTIONAL - Name of the Default Routing Table. If null, a name will be automatically generated |`string`|`null`| no |
144
148
| <aname="input_default_security_group_name"></a> [default\_security\_group\_name](#input\_default\_security\_group\_name)| OPTIONAL - Name of the Default Security Group. If null, a name will be automatically generated |`string`|`null`| no |
149
+
| <aname="input_dns_binding_name"></a> [dns\_binding\_name](#input\_dns\_binding\_name)| The name to give the provisioned VPC DNS resolution binding. If not set, the module generates a name based on the `prefix` and `name` variables. |`string`|`null`| no |
150
+
| <aname="input_dns_custom_resolver_name"></a> [dns\_custom\_resolver\_name](#input\_dns\_custom\_resolver\_name)| The name to give the provisioned DNS custom resolver instance. If not set, the module generates a name based on the `prefix` and `name` variables. |`string`|`null`| no |
151
+
| <aname="input_dns_instance_name"></a> [dns\_instance\_name](#input\_dns\_instance\_name)| The name to give the provisioned DNS instance. If not set, the module generates a name based on the `prefix` and `name` variables. |`string`|`null`| no |
145
152
| <aname="input_dns_location"></a> [dns\_location](#input\_dns\_location)| The target location or environment for the DNS instance created to host the custom resolver in a hub-spoke DNS resolution topology. Only used if enable\_hub is true and skip\_custom\_resolver\_hub\_creation is false (defaults). |`string`|`"global"`| no |
146
153
| <aname="input_dns_plan"></a> [dns\_plan](#input\_dns\_plan)| The plan for the DNS resource instance created to host the custom resolver in a hub-spoke DNS resolution topology. Only used if enable\_hub is true and skip\_custom\_resolver\_hub\_creation is false (defaults). |`string`|`"standard-dns"`| no |
147
154
| <aname="input_enable_hub"></a> [enable\_hub](#input\_enable\_hub)| Indicates whether this VPC is enabled as a DNS name resolution hub. |`bool`|`false`| no |
@@ -157,21 +164,24 @@ To attach access management tags to resources in this module, you need the follo
157
164
| <aname="input_hub_vpc_id"></a> [hub\_vpc\_id](#input\_hub\_vpc\_id)| Indicates the id of the hub VPC for DNS resolution. See https://cloud.ibm.com/docs/vpc?topic=vpc-hub-spoke-model. Mutually exclusive with hub\_vpc\_crn. |`string`|`null`| no |
158
165
| <aname="input_is_flow_log_collector_active"></a> [is\_flow\_log\_collector\_active](#input\_is\_flow\_log\_collector\_active)| Indicates whether the collector is active. If false, this collector is created in inactive mode. |`bool`|`true`| no |
159
166
| <aname="input_manual_servers"></a> [manual\_servers](#input\_manual\_servers)| The DNS server addresses to use for the VPC, replacing any existing servers. All the entries must either have a unique zone\_affinity, or not have a zone\_affinity. | <pre>list(object({<br> address = string<br> zone_affinity = optional(string)<br> }))</pre> |`[]`| no |
160
-
| <aname="input_name"></a> [name](#input\_name)|The name to give the newly provisioned VPC. Only used if 'create\_vpc' is true. |`string`|`"dev"`|no|
167
+
| <aname="input_name"></a> [name](#input\_name)|Used for the naming of the VPC (if create\_vpc is set to true), as well as in the naming for any resources created inside the VPC (unless using one of the optional variables for explicit control over naming). |`string`|n/a|yes|
161
168
| <a name="input_network_acls"></a> [network\_acls](#input\_network\_acls) | The list of ACLs to create. Provide at least one rule for each ACL. | <pre>list(<br> object({<br> name = string<br> add_ibm_cloud_internal_rules = optional(bool)<br> add_vpc_connectivity_rules = optional(bool)<br> prepend_ibm_rules = optional(bool)<br> rules = list(<br> object({<br> name = string<br> action = string<br> destination = string<br> direction = string<br> source = string<br> tcp = optional(<br> object({<br> port_max = optional(number)<br> port_min = optional(number)<br> source_port_max = optional(number)<br> source_port_min = optional(number)<br> })<br> )<br> udp = optional(<br> object({<br> port_max = optional(number)<br> port_min = optional(number)<br> source_port_max = optional(number)<br> source_port_min = optional(number)<br> })<br> )<br> icmp = optional(<br> object({<br> type = optional(number)<br> code = optional(number)<br> })<br> )<br> })<br> )<br> })<br> )</pre> | <pre>[<br> {<br> "add_ibm_cloud_internal_rules": true,<br> "add_vpc_connectivity_rules": true,<br> "name": "vpc-acl",<br> "prepend_ibm_rules": true,<br> "rules": []<br> }<br>]</pre> | no |
162
169
| <aname="input_network_cidrs"></a> [network\_cidrs](#input\_network\_cidrs)| List of Network CIDRs for the VPC. This is used to manage network ACL rules for cluster provisioning. |`list(string)`| <pre>[<br> "10.0.0.0/8"<br>]</pre> | no |
163
-
| <aname="input_prefix"></a> [prefix](#input\_prefix)| The value that you would like to prefix to the name of the resources provisioned by this module. Explicitly set to null if you do not wish to use a prefix. |`string`|`null`| no |
170
+
| <aname="input_prefix"></a> [prefix](#input\_prefix)| The value that you would like to prefix to the name of the resources provisioned by this module. Explicitly set to null if you do not wish to use a prefix. This value is ignored if using one of the optional variables for explicit control over naming. |`string`|`null`| no |
171
+
| <aname="input_public_gateway_name"></a> [public\_gateway\_name](#input\_public\_gateway\_name)| The name to give the provisioned VPC public gateways. If not set, the module generates a name based on the `prefix` and `name` variables. |`string`|`null`| no |
164
172
| <aname="input_region"></a> [region](#input\_region)| The region to which to deploy the VPC |`string`| n/a | yes |
165
173
| <aname="input_resolver_type"></a> [resolver\_type](#input\_resolver\_type)| Resolver type. Can be system or manual. For delegated resolver type, see the update\_delegated\_resolver variable instead. |`string`|`null`| no |
166
174
| <aname="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id)| The resource group ID where the VPC to be created |`string`| n/a | yes |
167
175
| <aname="input_routes"></a> [routes](#input\_routes)| OPTIONAL - Allows you to specify the next hop for packets based on their destination address | <pre>list(<br> object({<br> name = string<br> route_direct_link_ingress = optional(bool)<br> route_transit_gateway_ingress = optional(bool)<br> route_vpc_zone_ingress = optional(bool)<br> routes = optional(<br> list(<br> object({<br> action = optional(string)<br> zone = number<br> destination = string<br> next_hop = string<br> })<br> ))<br> })<br> )</pre> |`[]`| no |
176
+
| <aname="input_routing_table_name"></a> [routing\_table\_name](#input\_routing\_table\_name)| The name to give the provisioned routing tables. If not set, the module generates a name based on the `prefix` and `name` variables. |`string`|`null`| no |
168
177
| <aname="input_security_group_rules"></a> [security\_group\_rules](#input\_security\_group\_rules)| A list of security group rules to be added to the default vpc security group (default empty) | <pre>list(<br> object({<br> name = string<br> direction = string<br> remote = string<br> tcp = optional(<br> object({<br> port_max = optional(number)<br> port_min = optional(number)<br> })<br> )<br> udp = optional(<br> object({<br> port_max = optional(number)<br> port_min = optional(number)<br> })<br> )<br> icmp = optional(<br> object({<br> type = optional(number)<br> code = optional(number)<br> })<br> )<br> })<br> )</pre> |`[]`| no |
169
178
| <aname="input_skip_custom_resolver_hub_creation"></a> [skip\_custom\_resolver\_hub\_creation](#input\_skip\_custom\_resolver\_hub\_creation)| Indicates whether to skip the configuration of a custom resolver in the hub VPC. Only relevant if enable\_hub is set to true. |`bool`|`false`| no |
170
179
| <a name="input_subnets"></a> [subnets](#input\_subnets) | List of subnets for the vpc. For each item in each array, a subnet will be created. Items can be either CIDR blocks or total ipv4 addressess. Public gateways will be enabled only in zones where a gateway has been created | <pre>object({<br> zone-1 = list(object({<br> name = string<br> cidr = string<br> public_gateway = optional(bool)<br> acl_name = string<br> }))<br> zone-2 = optional(list(object({<br> name = string<br> cidr = string<br> public_gateway = optional(bool)<br> acl_name = string<br> })))<br> zone-3 = optional(list(object({<br> name = string<br> cidr = string<br> public_gateway = optional(bool)<br> acl_name = string<br> })))<br> })</pre> | <pre>{<br> "zone-1": [<br> {<br> "acl_name": "vpc-acl",<br> "cidr": "10.10.10.0/24",<br> "name": "subnet-a",<br> "public_gateway": true<br> }<br> ],<br> "zone-2": [<br> {<br> "acl_name": "vpc-acl",<br> "cidr": "10.20.10.0/24",<br> "name": "subnet-b",<br> "public_gateway": true<br> }<br> ],<br> "zone-3": [<br> {<br> "acl_name": "vpc-acl",<br> "cidr": "10.30.10.0/24",<br> "name": "subnet-c",<br> "public_gateway": false<br> }<br> ]<br>}</pre> | no |
171
180
| <aname="input_tags"></a> [tags](#input\_tags)| List of Tags for the resource created |`list(string)`|`null`| no |
172
181
| <aname="input_update_delegated_resolver"></a> [update\_delegated\_resolver](#input\_update\_delegated\_resolver)| If set to true, and if the vpc is configured to be a spoke for DNS resolution (enable\_hub\_vpc\_crn or enable\_hub\_vpc\_id set), then the spoke VPC resolver will be updated to a delegated resolver. |`bool`|`false`| no |
173
182
| <aname="input_use_existing_dns_instance"></a> [use\_existing\_dns\_instance](#input\_use\_existing\_dns\_instance)| Whether to use an existing dns instance. If true, existing\_dns\_instance\_id must be set. |`bool`|`false`| no |
174
183
| <aname="input_use_public_gateways"></a> [use\_public\_gateways](#input\_use\_public\_gateways)| Create a public gateway in any of the three zones with `true`. | <pre>object({<br> zone-1 = optional(bool)<br> zone-2 = optional(bool)<br> zone-3 = optional(bool)<br> })</pre> | <pre>{<br> "zone-1": true,<br> "zone-2": false,<br> "zone-3": false<br>}</pre> | no |
184
+
| <aname="input_vpc_flow_logs_name"></a> [vpc\_flow\_logs\_name](#input\_vpc\_flow\_logs\_name)| The name to give the provisioned VPC flow logs. If not set, the module generates a name based on the `prefix` and `name` variables. |`string`|`null`| no |
0 commit comments