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
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This module creates the following IBM Cloud® Virtual Private Cloud (VPC) net
14
14
- Network ACLs: Create network ACLs with multiple rules. By default, VPC network ACLs can have no more than 25 rules.
15
15
- VPN gateways: Create VPN gateways on your subnets by using the `vpn_gateways` variable. For more information about VPN gateways on VPC, see [About site-to-site VPN gateways](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn) in the IBM Cloud docs.
16
16
- VPN gateway connections: Add connections to a VPN gateway.
17
-
- Hub and spoke DNS-sharing model: Optionally create a hub or spoke VPC, with associated custom resolver and DNS resolution binding. See [About DNS sharing for VPE gateways](https://cloud.ibm.com/docs/vpc?topic=vpc-hub-spoke-model) in the IBM Cloud docs for details.
17
+
- Hub and spoke DNS-sharing model: Optionally create a hub or spoke VPC, with associated custom resolver and DNS resolution binding, as well as a service-to-service authorization policy which supports the hub and spoke VPCs to be in separate accounts. See [About DNS sharing for VPE gateways](https://cloud.ibm.com/docs/vpc?topic=vpc-hub-spoke-model) in the IBM Cloud docs for details.
|[ibm_iam_account_settings.iam_account_settings](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/iam_account_settings)| data source |
135
137
|[ibm_is_subnet.subnet](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/is_subnet)| data source |
136
138
|[ibm_is_vpc.vpc](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/is_vpc)| data source |
137
139
|[ibm_is_vpc_address_prefixes.get_address_prefixes](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/is_vpc_address_prefixes)| data source |
@@ -164,6 +166,7 @@ To attach access management tags to resources in this module, you need the follo
164
166
| <aname="input_existing_storage_bucket_name"></a> [existing\_storage\_bucket\_name](#input\_existing\_storage\_bucket\_name)| Name of the COS bucket to collect VPC flow logs |`string`|`null`| no |
165
167
| <aname="input_existing_subnets"></a> [existing\_subnets](#input\_existing\_subnets)| The detail of the existing subnets and required mappings to other resources. Required if 'create\_subnets' is false. | <pre>list(object({<br> id = string<br> public_gateway = optional(bool, false)<br> }))</pre> |`[]`| no |
166
168
| <aname="input_existing_vpc_id"></a> [existing\_vpc\_id](#input\_existing\_vpc\_id)| The ID of the existing vpc. Required if 'create\_vpc' is false. |`string`|`null`| no |
169
+
| <aname="input_hub_account_id"></a> [hub\_account\_id](#input\_hub\_account\_id)| ID of the hub account for DNS resolution, required if 'skip\_spoke\_auth\_policy' is false. |`string`|`null`| no |
167
170
| <aname="input_hub_vpc_crn"></a> [hub\_vpc\_crn](#input\_hub\_vpc\_crn)| Indicates the crn of the hub VPC for DNS resolution. See https://cloud.ibm.com/docs/vpc?topic=vpc-hub-spoke-model. Mutually exclusive with hub\_vpc\_id. |`string`|`null`| no |
168
171
| <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 |
169
172
| <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 |
@@ -180,6 +183,7 @@ To attach access management tags to resources in this module, you need the follo
180
183
| <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 |
181
184
| <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 |
182
185
| <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 |
186
+
| <aname="input_skip_spoke_auth_policy"></a> [skip\_spoke\_auth\_policy](#input\_skip\_spoke\_auth\_policy)| Set to true to skip the creation of an authorization policy between the DNS resolution spoke and hub, only enable this if a policy already exists between these two VPCs. See https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-dns-sharing-s2s-auth&interface=ui for more details. |`bool`|`false`| no |
183
187
| <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> no_addr_prefix = optional(bool, false) # do not automatically add address prefix for subnet, overrides other conditions if set to true<br> }))<br> zone-2 = optional(list(object({<br> name = string<br> cidr = string<br> public_gateway = optional(bool)<br> acl_name = string<br> no_addr_prefix = optional(bool, false) # do not automatically add address prefix for subnet, overrides other conditions if set to true<br> })))<br> zone-3 = optional(list(object({<br> name = string<br> cidr = string<br> public_gateway = optional(bool)<br> acl_name = string<br> no_addr_prefix = optional(bool, false) # do not automatically add address prefix for subnet, overrides other conditions if set to true<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> "no_addr_prefix": false,<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> "no_addr_prefix": false,<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> "no_addr_prefix": false,<br> "public_gateway": false<br> }<br> ]<br>}</pre> | no |
184
188
| <aname="input_tags"></a> [tags](#input\_tags)| List of Tags for the resource created |`list(string)`|`null`| no |
185
189
| <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 |
Copy file name to clipboardExpand all lines: examples/hub-spoke-delegated-resolver/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ This example demonstrates how to deploy hub and spoke VPCs, inclusive of enablin
4
4
- The 2 VPCs are connected through a transit gateway.
5
5
- The hub VPC is configured with a custom resolver.
6
6
- The spoke VPC is configured with a delegated DNS resolver. DNS requests are resolved by the hub VPC.
7
+
- An authorization policy for the DNS Binding Connector role is created to allow the spoke VPC to use the DNS resolution of the hub VPC, this also allows the hub and spoke VPCs to be in separate accounts.
7
8
- A DNS resolution binding relationship is configured to enable the hub VPC to DNS resolve VPE in the spoke VPC.
Copy file name to clipboardExpand all lines: main.tf
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,9 @@ locals {
37
37
38
38
# tflint-ignore: terraform_unused_declarations
39
39
validate_vpc_flow_logs_inputs=(var.enable_vpc_flow_logs) ? ((var.create_authorization_policy_vpc_to_cos) ? ((var.existing_cos_instance_guid!=null&& var.existing_storage_bucket_name!=null) ?true:tobool("Please provide COS instance & bucket name to create flow logs collector.")) : ((var.existing_storage_bucket_name!=null) ?true:tobool("Please provide COS bucket name to create flow logs collector"))) :false
40
+
41
+
# tflint-ignore: terraform_unused_declarations
42
+
validate_skip_spoke_auth_policy_input=(var.hub_account_id==null&&!var.skip_spoke_auth_policy&&!var.enable_hub&& (var.enable_hub_vpc_id|| var.enable_hub_vpc_crn)) ?tobool("var.hub_account_id must be set when var.skip_spoke_auth_policy is False and either var.enable_hub_vpc_id or var.enable_hub_vpc_crn is true.") :true
Copy file name to clipboardExpand all lines: variables.tf
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -542,6 +542,18 @@ variable "enable_hub" {
542
542
default=false
543
543
}
544
544
545
+
variable"skip_spoke_auth_policy" {
546
+
description="Set to true to skip the creation of an authorization policy between the DNS resolution spoke and hub, only enable this if a policy already exists between these two VPCs. See https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-dns-sharing-s2s-auth&interface=ui for more details."
547
+
type=bool
548
+
default=false
549
+
}
550
+
551
+
variable"hub_account_id" {
552
+
description="ID of the hub account for DNS resolution, required if 'skip_spoke_auth_policy' is false."
553
+
type=string
554
+
default=null
555
+
}
556
+
545
557
variable"enable_hub_vpc_id" {
546
558
description="Indicates whether Hub VPC ID is passed."
0 commit comments