Skip to content

Commit

Permalink
Addressed review comments for Custom resolver docs (#2997)
Browse files Browse the repository at this point in the history
  • Loading branch information
DwitikrDash authored Sep 13, 2021
1 parent 418fe89 commit e24eaa6
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 17 deletions.
34 changes: 23 additions & 11 deletions website/docs/r/dns_custom_resolver.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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`:
Expand All @@ -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:
<custom_resolver_id>:<instance_id>

**Example**
Expand Down
35 changes: 29 additions & 6 deletions website/docs/r/dns_custom_resolver_forwarding_rule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
```

Expand All @@ -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:

```
Expand All @@ -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 <instance_id>/<resolver_id>/<rule_id>
$ terraform import ibm_dns_custom_resolver_forwarding_rule.ibm_dns_custom_resolver_forwarding_rule <instance_id>/<resolver_id>/<rule_id>
```
22 changes: 22 additions & 0 deletions website/docs/r/dns_custom_resolver_location.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e24eaa6

Please sign in to comment.