ultradns providers and improvements (#9788)
* vendor: update github.com/Ensighten/udnssdk to v1.2.1
* ultradns_tcpool: add
* ultradns.baseurl: set default
* ultradns.record: cleanup test
* ultradns_record: extract common, cleanup
* ultradns: extract common
* ultradns_dirpool: add
* ultradns_dirpool: fix rdata.ip_info.ips to be idempotent
* ultradns_tcpool: add doc
* ultradns_dirpool: fix rdata.geo_codes.codes to be idempotent
* ultradns_dirpool: add doc
* ultradns: cleanup testing
* ultradns_record: rename resource
* ultradns: log username from config, not client
udnssdk.Client is being refactored to use x/oauth2, so don't assume we
can access Username from it
* ultradns_probe_ping: add
* ultradns_probe_http: add
* doc: add ultradns_probe_ping
* doc: add ultradns_probe_http
* ultradns_record: remove duplication from error messages
* doc: cleanup typos in ultradns
* ultradns_probe_ping: add test for pool-level probe
* Clean documentation
* ultradns: pull makeSetFromStrings() up to common.go
* ultradns_dirpool: log hashIPInfoIPs
Log the key and generated hashcode used to index ip_info.ips into a set.
* ultradns: simplify hashLimits()
Limits blocks only have the "name" attribute as their primary key, so
hashLimits() needn't use a buffer to concatenate.
Also changes log level to a more approriate DEBUG.
* ultradns_tcpool: convert rdata to schema.Set
RData blocks have the "host" attribute as their primary key, so it is
used by hashRdatas() to create the hashcode.
Tests are updated to use the new hashcode indexes instead of natural
numbers.
* ultradns_probe_http: convert agents to schema.Set
Also pull the makeSetFromStrings() helper up to common.go
* ultradns: pull hashRdatas() up to common
* ultradns_dirpool: convert rdata to schema.Set
Fixes TF-66
* ultradns_dirpool.conflict_resolve: fix default from response
UltraDNS REST API User Guide claims that "Directional Pool
Profile Fields" have a "conflictResolve" field which "If not
specified, defaults to GEO."
https://portal.ultradns.com/static/docs/REST-API_User_Guide.pdf
But UltraDNS does not actually return a conflictResolve
attribute when it has been updated to "GEO".
We could fix it in udnssdk, but that would require either:
* hide the response by coercing "" to "GEO" for everyone
* use a pointer to allow checking for nil (requires all
users to change if they fix this)
An ideal solution would be to have the UltraDNS API respond
with this attribute for every dirpool's rdata.
So at the risk of foolish consistency in the sdk, we're
going to solve it where it's visible to the user:
by checking and overriding the parsing. I'm sorry.
* ultradns_record: convert rdata to set
UltraDNS does not store the ordering of rdata elements, so we need a way
to identify if changes have been made even it the order changes.
A perfect job for schema.Set.
* ultradns_record: parse double-encoded answers for TXT records
* ultradns: simplify hashLimits()
Limits blocks only have the "name" attribute as their primary key, so
hashLimits() needn't use a buffer to concatenate.
* ultradns_dirpool.description: validate
* ultradns_dirpool.rdata: doc need for set
* ultradns_dirpool.conflict_resolve: validate
2016-12-15 17:28:34 +01:00
|
|
|
---
|
|
|
|
layout: "ultradns"
|
|
|
|
page_title: "UltraDNS: ultradns_dirpool"
|
|
|
|
sidebar_current: "docs-ultradns-resource-dirpool"
|
|
|
|
description: |-
|
|
|
|
Provides an UltraDNS Directional Controller pool resource.
|
|
|
|
---
|
|
|
|
|
|
|
|
# ultradns\_dirpool
|
|
|
|
|
|
|
|
Provides an UltraDNS Directional Controller pool resource.
|
|
|
|
|
|
|
|
## Example Usage
|
2017-04-17 12:17:54 +02:00
|
|
|
|
|
|
|
```hcl
|
ultradns providers and improvements (#9788)
* vendor: update github.com/Ensighten/udnssdk to v1.2.1
* ultradns_tcpool: add
* ultradns.baseurl: set default
* ultradns.record: cleanup test
* ultradns_record: extract common, cleanup
* ultradns: extract common
* ultradns_dirpool: add
* ultradns_dirpool: fix rdata.ip_info.ips to be idempotent
* ultradns_tcpool: add doc
* ultradns_dirpool: fix rdata.geo_codes.codes to be idempotent
* ultradns_dirpool: add doc
* ultradns: cleanup testing
* ultradns_record: rename resource
* ultradns: log username from config, not client
udnssdk.Client is being refactored to use x/oauth2, so don't assume we
can access Username from it
* ultradns_probe_ping: add
* ultradns_probe_http: add
* doc: add ultradns_probe_ping
* doc: add ultradns_probe_http
* ultradns_record: remove duplication from error messages
* doc: cleanup typos in ultradns
* ultradns_probe_ping: add test for pool-level probe
* Clean documentation
* ultradns: pull makeSetFromStrings() up to common.go
* ultradns_dirpool: log hashIPInfoIPs
Log the key and generated hashcode used to index ip_info.ips into a set.
* ultradns: simplify hashLimits()
Limits blocks only have the "name" attribute as their primary key, so
hashLimits() needn't use a buffer to concatenate.
Also changes log level to a more approriate DEBUG.
* ultradns_tcpool: convert rdata to schema.Set
RData blocks have the "host" attribute as their primary key, so it is
used by hashRdatas() to create the hashcode.
Tests are updated to use the new hashcode indexes instead of natural
numbers.
* ultradns_probe_http: convert agents to schema.Set
Also pull the makeSetFromStrings() helper up to common.go
* ultradns: pull hashRdatas() up to common
* ultradns_dirpool: convert rdata to schema.Set
Fixes TF-66
* ultradns_dirpool.conflict_resolve: fix default from response
UltraDNS REST API User Guide claims that "Directional Pool
Profile Fields" have a "conflictResolve" field which "If not
specified, defaults to GEO."
https://portal.ultradns.com/static/docs/REST-API_User_Guide.pdf
But UltraDNS does not actually return a conflictResolve
attribute when it has been updated to "GEO".
We could fix it in udnssdk, but that would require either:
* hide the response by coercing "" to "GEO" for everyone
* use a pointer to allow checking for nil (requires all
users to change if they fix this)
An ideal solution would be to have the UltraDNS API respond
with this attribute for every dirpool's rdata.
So at the risk of foolish consistency in the sdk, we're
going to solve it where it's visible to the user:
by checking and overriding the parsing. I'm sorry.
* ultradns_record: convert rdata to set
UltraDNS does not store the ordering of rdata elements, so we need a way
to identify if changes have been made even it the order changes.
A perfect job for schema.Set.
* ultradns_record: parse double-encoded answers for TXT records
* ultradns: simplify hashLimits()
Limits blocks only have the "name" attribute as their primary key, so
hashLimits() needn't use a buffer to concatenate.
* ultradns_dirpool.description: validate
* ultradns_dirpool.rdata: doc need for set
* ultradns_dirpool.conflict_resolve: validate
2016-12-15 17:28:34 +01:00
|
|
|
# Create a Directional Controller pool
|
|
|
|
resource "ultradns_dirpool" "pool" {
|
|
|
|
zone = "${var.ultradns_domain}"
|
|
|
|
name = "terraform-dirpool"
|
|
|
|
ttl = 300
|
|
|
|
description = "Minimal DirPool"
|
|
|
|
|
|
|
|
rdata {
|
|
|
|
host = "192.168.0.10"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
See [related part of UltraDNS Docs](https://restapi.ultradns.com/v1/docs#post-rrset) for details about valid values.
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `zone` - (Required) The domain to add the record to
|
|
|
|
* `name` - (Required) The name of the record
|
|
|
|
- `type` - (Required) The Record Type of the record
|
|
|
|
* `description` - (Required) Description of the Traffic Controller pool. Valid values are strings less than 256 characters.
|
|
|
|
* `rdata` - (Required) a list of Record Data blocks, one for each member in the pool. Record Data documented below.
|
|
|
|
* `ttl` - (Optional) The TTL of the record. Default: `3600`.
|
|
|
|
* `conflict_resolve` - (Optional) String. Valid: `"GEO"` or `"IP"`. Default: `"GEO"`.
|
|
|
|
* `no_response` - (Optional) a single Record Data block, without any `host` attribute. Record Data documented below.
|
|
|
|
|
|
|
|
Record Data blocks support the following:
|
|
|
|
|
|
|
|
* `host` - (Required in `rdata`, absent in `no_response`) IPv4 address or CNAME for the pool member.
|
|
|
|
- `all_non_configured` - (Optional) Boolean. Default: `false`.
|
|
|
|
- `geo_info` - (Optional) a single Geo Info block. Geo Info documented below.
|
|
|
|
- `ip_info` - (Optional) a single IP Info block. IP Info documented below.
|
|
|
|
|
|
|
|
|
|
|
|
Geo Info blocks support the following:
|
|
|
|
|
|
|
|
- `name` - (Optional) String.
|
|
|
|
- `is_account_level` - (Optional) Boolean. Default: `false`.
|
|
|
|
- `codes` - (Optional) Set of geo code strings. Shorthand codes are expanded.
|
|
|
|
|
|
|
|
IP Info blocks support the following:
|
|
|
|
|
|
|
|
- `name` - (Optional) String.
|
|
|
|
- `is_account_level` - (Optional) Boolean. Default: `false`.
|
|
|
|
- `ips` - (Optional) Set of IP blocks. IP Info documented below.
|
|
|
|
|
|
|
|
IP blocks support the following:
|
|
|
|
- `start` - (Optional) String. IP Address. Must be paired with `end`. Conflicts with `cidr` or `address`.
|
|
|
|
- `end` - (Optional) String. IP Address. Must be paired with `start`.
|
|
|
|
- `cidr` - (Optional) String.
|
|
|
|
- `address` - (Optional) String. IP Address.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The record ID
|
|
|
|
* `hostname` - The FQDN of the record
|