From b84f23ae3bab09544ba9cef00c4a392cf900a775 Mon Sep 17 00:00:00 2001 From: Matthew Lemmond Date: Fri, 12 Jul 2024 07:58:06 -0400 Subject: [PATCH] feat: added new outputs `dns_instance_id` and `dns_custom_resolver_id` (#817) --- README.md | 2 ++ examples/hub-spoke-delegated-resolver/outputs.tf | 10 ++++++++++ examples/hub-spoke-manual-resolver/outputs.tf | 10 ++++++++++ outputs.tf | 10 ++++++++++ 4 files changed, 32 insertions(+) diff --git a/README.md b/README.md index 216a9d13..30dbb0a7 100644 --- a/README.md +++ b/README.md @@ -198,8 +198,10 @@ To attach access management tags to resources in this module, you need the follo |------|-------------| | [cidr\_blocks](#output\_cidr\_blocks) | List of CIDR blocks present in VPC stack | | [custom\_resolver\_hub](#output\_custom\_resolver\_hub) | The custom resolver created for the hub vpc. Only set if enable\_hub is set and skip\_custom\_resolver\_hub\_creation is false. | +| [dns\_custom\_resolver\_id](#output\_dns\_custom\_resolver\_id) | The ID of the DNS Custom Resolver. | | [dns\_endpoint\_gateways\_by\_crn](#output\_dns\_endpoint\_gateways\_by\_crn) | The list of VPEs that are made available for DNS resolution in the created VPC. Only set if enable\_hub is false and enable\_hub\_vpc\_id are true. | | [dns\_endpoint\_gateways\_by\_id](#output\_dns\_endpoint\_gateways\_by\_id) | The list of VPEs that are made available for DNS resolution in the created VPC. Only set if enable\_hub is false and enable\_hub\_vpc\_id are true. | +| [dns\_instance\_id](#output\_dns\_instance\_id) | The ID of the DNS instance. | | [network\_acls](#output\_network\_acls) | List of shortnames and IDs of network ACLs | | [public\_gateways](#output\_public\_gateways) | Map of public gateways by zone | | [subnet\_detail\_list](#output\_subnet\_detail\_list) | A list of subnets containing names, CIDR blocks, and zones. | diff --git a/examples/hub-spoke-delegated-resolver/outputs.tf b/examples/hub-spoke-delegated-resolver/outputs.tf index ee6a1401..f28a0abd 100644 --- a/examples/hub-spoke-delegated-resolver/outputs.tf +++ b/examples/hub-spoke-delegated-resolver/outputs.tf @@ -51,3 +51,13 @@ output "dns_endpoint_gateways_by_spoke_vpc_id" { value = module.spoke_vpc.dns_endpoint_gateways_by_id description = "The list of VPEs that are made available for DNS resolution in the created VPC." } + +output "dns_instance_id" { + description = "The ID of the DNS instance." + value = module.hub_vpc.dns_instance_id +} + +output "dns_custom_resolver_id" { + description = "The ID of the DNS Custom Resolver." + value = module.hub_vpc.dns_custom_resolver_id +} diff --git a/examples/hub-spoke-manual-resolver/outputs.tf b/examples/hub-spoke-manual-resolver/outputs.tf index ee6a1401..f28a0abd 100644 --- a/examples/hub-spoke-manual-resolver/outputs.tf +++ b/examples/hub-spoke-manual-resolver/outputs.tf @@ -51,3 +51,13 @@ output "dns_endpoint_gateways_by_spoke_vpc_id" { value = module.spoke_vpc.dns_endpoint_gateways_by_id description = "The list of VPEs that are made available for DNS resolution in the created VPC." } + +output "dns_instance_id" { + description = "The ID of the DNS instance." + value = module.hub_vpc.dns_instance_id +} + +output "dns_custom_resolver_id" { + description = "The ID of the DNS Custom Resolver." + value = module.hub_vpc.dns_custom_resolver_id +} diff --git a/outputs.tf b/outputs.tf index 897d8676..5403ea26 100644 --- a/outputs.tf +++ b/outputs.tf @@ -166,3 +166,13 @@ output "dns_endpoint_gateways_by_crn" { description = "The list of VPEs that are made available for DNS resolution in the created VPC. Only set if enable_hub is false and enable_hub_vpc_id are true." value = length(ibm_is_vpc_dns_resolution_binding.vpc_dns_resolution_binding_crn) == 1 ? ibm_is_vpc_dns_resolution_binding.vpc_dns_resolution_binding_crn[0] : null } + +output "dns_instance_id" { + description = "The ID of the DNS instance." + value = (var.enable_hub && !var.skip_custom_resolver_hub_creation) ? (var.use_existing_dns_instance ? var.existing_dns_instance_id : ibm_resource_instance.dns_instance_hub[0].guid) : null +} + +output "dns_custom_resolver_id" { + description = "The ID of the DNS Custom Resolver." + value = (var.enable_hub && !var.skip_custom_resolver_hub_creation) ? one(ibm_dns_custom_resolver.custom_resolver_hub[*].instance_id) : null +}