From e24eaa6b0bd3b1bac2c8a2956f757d0c70f94b1e Mon Sep 17 00:00:00 2001 From: DwitikrDash <81751773+DwitikrDash@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:02:53 +0530 Subject: [PATCH] Addressed review comments for Custom resolver docs (#2997) --- .../docs/r/dns_custom_resolver.html.markdown | 34 ++++++++++++------ ...tom_resolver_forwarding_rule.html.markdown | 35 +++++++++++++++---- ...dns_custom_resolver_location.html.markdown | 22 ++++++++++++ 3 files changed, 74 insertions(+), 17 deletions(-) diff --git a/website/docs/r/dns_custom_resolver.html.markdown b/website/docs/r/dns_custom_resolver.html.markdown index 001de71bd7..2eabaf7165 100644 --- a/website/docs/r/dns_custom_resolver.html.markdown +++ b/website/docs/r/dns_custom_resolver.html.markdown @@ -14,12 +14,24 @@ Provides a private DNS custom resolver resource. This allows DNS custom resolver ## Example usage ```terraform -resource "ibm_dns_custom_resolver" "example" { - name = "testCR-TF" - instance_id = "instance_id" - description = "new test CR TF desc" +data "ibm_resource_group" "rg" { + name = "default" +} + +resource "ibm_resource_instance" "test-pdns-instance" { + name = "test-pdns" + resource_group_id = data.ibm_resource_group.rg.id + location = "global" + service = "dns-svcs" + plan = "standard-dns" +} + +resource "ibm_dns_custom_resolver" "test" { + name = "testCR-TF" + instance_id = ibm_resource_instance.test-pdns-instance.guid + description = "testdescription-CR" locations { - subnet_crn = "crn:v1:staging:public:is:us-south-1:a/01652b251c3ae2787110a995d8db0135::subnet:0716-03d54d71-b438-4d20-b943-76d3d2a1a590" + subnet_crn = "crn:v1:staging:public:is:us-south-1:a/01652b251c3ae2787110a995d8db0135::subnet:0716-6c3a997d-72b2-47f6-8788-6bd95e1bdb03" enabled = true } } @@ -40,10 +52,10 @@ Review the argument reference that you can specify for your resource. ## Attribute reference In addition to all argument reference list, you can access the following attribute references after your resource is created. -- `created_on` - (Timestamp) The time (created on) of the DNS custom resolver. -- `id` - (String) The unique ID of the private DNS custom resolver. -- `modified_on` - (Timestamp) The time (modified on) of the DNS custom resolver. -- `health`- (String) The status of DNS custom resolver's health. Possible values are `DEGRADED`, `CRITICAL`, `HEALTHY`. +- `created_on` - (Timestamp) The time (created On) of the DNS Custom Resolver. +- `custom_resolver_id` - (String) The unique ID of the private DNS custom resolver. +- `modified_on` - (Timestamp) The time (modified On) of the DNS Custom Resolver. +- `health`- (String) The status of DNS Custom Resolver's health. Possible values are `DEGRADED`, `CRITICAL`, `HEALTHY`. - `locations` - (Set) Locations on which the custom resolver will be running. Nested scheme for `locations`: @@ -53,8 +65,8 @@ In addition to all argument reference list, you can access the following attribu - `location_id`- (String) The location ID. ## Import -The `ibm_dns_custom_resolver` can be imported by using private DNS instance ID, custom resolver ID. -The `id` property can be formed from `custom_resolver_id` and `instance_id` in the following format: +The `ibm_dns_custom_resolver` can be imported by using private DNS instance ID, Custom Resolver ID. +The `id` property can be formed from `custom resolver id` and `instance_id` in the following format: : **Example** diff --git a/website/docs/r/dns_custom_resolver_forwarding_rule.html.markdown b/website/docs/r/dns_custom_resolver_forwarding_rule.html.markdown index d7399b342b..f1bce78dd0 100644 --- a/website/docs/r/dns_custom_resolver_forwarding_rule.html.markdown +++ b/website/docs/r/dns_custom_resolver_forwarding_rule.html.markdown @@ -8,17 +8,40 @@ description: |- # ibm_dns_custom_resolver_forwarding_rule -Provides a resource for DNS custom resolver forwarding rule. This allows forwarding rule to be created, updated and deleted. For more information, about forwarding rules, see [create-forwarding-rule](https://cloud.ibm.com/apidocs/dns-svcs#create-forwarding-rule). +Provides a resource for ibm_dns_custom_resolver_forwarding_rule. This allows Forwarding Rule to be created, updated and deleted.For more information, about Forwarding Rules, see [create-forwarding-rule](https://cloud.ibm.com/apidocs/dns-svcs#create-forwarding-rule). ## Example usage ```terraform -resource "dns_custom_resolver_forwarding_rule" "dns_custom_resolver_forwarding_rule" { +data "ibm_resource_group" "rg" { + name = "default" +} + +resource "ibm_resource_instance" "test-pdns-instance" { + name = "test-pdns" + resource_group_id = data.ibm_resource_group.rg.id + location = "global" + service = "dns-svcs" + plan = "standard-dns" +} + +resource "ibm_dns_custom_resolver" "test" { + name = "testCR-TF" + instance_id = ibm_resource_instance.test-pdns-instance.guid + description = "testdescription-CR" + locations { + subnet_crn = "crn:v1:staging:public:is:us-south-1:a/01652b251c3ae2787110a995d8db0135::subnet:0716-6c3a997d-72b2-47f6-8788-6bd95e1bdb03" + enabled = true + } +} + +resource "ibm_dns_custom_resolver_forwarding_rule" "dns_custom_resolver_forwarding_rule" { instance_id = ibm_resource_instance.test-pdns-instance.guid resolver_id = ibm_dns_custom_resolver.test.custom_resolver_id - description = "forwarding rule" + description = "test forward rule" type = "zone" - match = "example.com" + match = "test.example.com" + forward_to = ["168.20.22.122"] } ``` @@ -44,7 +67,7 @@ In addition to all argument reference list, you can access the following attribu ## Import -You can import the `dns_custom_resolver_forwarding_rule` resource by using `id`. +You can import the `ibm_dns_custom_resolver_forwarding_rule` resource by using `id`. The `id` property can be formed from `instance_id`, `resolver_id`, and `rule_id` in the following format: ``` @@ -55,5 +78,5 @@ The `id` property can be formed from `instance_id`, `resolver_id`, and `rule_id` * `rule_id`: A String. The unique identifier of a forwarding rule. ``` -$ terraform import dns_custom_resolver_forwarding_rule.dns_custom_resolver_forwarding_rule // +$ terraform import ibm_dns_custom_resolver_forwarding_rule.ibm_dns_custom_resolver_forwarding_rule // ``` diff --git a/website/docs/r/dns_custom_resolver_location.html.markdown b/website/docs/r/dns_custom_resolver_location.html.markdown index 83dbd7b312..d620e6b17c 100644 --- a/website/docs/r/dns_custom_resolver_location.html.markdown +++ b/website/docs/r/dns_custom_resolver_location.html.markdown @@ -14,6 +14,28 @@ Provides a private DNS custom resolver locations resource. This allows DNS custo ## Example usage ```terraform +data "ibm_resource_group" "rg" { + name = "default" +} + +resource "ibm_resource_instance" "test-pdns-instance" { + name = "test-pdns" + resource_group_id = data.ibm_resource_group.rg.id + location = "global" + service = "dns-svcs" + plan = "standard-dns" +} + +resource "ibm_dns_custom_resolver" "test" { + name = "testCR-TF" + instance_id = ibm_resource_instance.test-pdns-instance.guid + description = "testdescription-CR" + locations { + subnet_crn = "crn:v1:staging:public:is:us-south-1:a/01652b251c3ae2787110a995d8db0135::subnet:0716-6c3a997d-72b2-47f6-8788-6bd95e1bdb03" + enabled = true + } +} + resource "ibm_dns_custom_resolver_location" "test" { instance_id = ibm_resource_instance.test-pdns-instance.guid resolver_id = ibm_dns_custom_resolver.test.custom_resolver_id