|
| 1 | +# oci_dns_zone |
| 2 | + |
| 3 | +## Zone Resource |
| 4 | + |
| 5 | +### Zone Reference |
| 6 | + |
| 7 | +The following attributes are exported: |
| 8 | +* `compartment_id` - The OCID of the compartment containing the zone. |
| 9 | +* `external_masters` - External master servers for the zone. |
| 10 | + * `address` - The server's IP address (IPv4 or IPv6). |
| 11 | + * `port` - The server's port. |
| 12 | + * `tsig` - A TSIG key |
| 13 | + * `algorithm` - TSIG Algorithms are encoded as domain names, but most consist of only one non-empty label, which is not required to be explicitly absolute. For a full list of TSIG algorithms, see [Secret Key Transaction Authentication for DNS (TSIG) Algorithm Names](http://www.iana.org/assignments/tsig-algorithm-names/tsig-algorithm-names.xhtml#tsig-algorithm-names-1) |
| 14 | + * `name` - A domain name identifying the key for a given pair of hosts. |
| 15 | + * `secret` - A base64 string encoding the binary shared secret. |
| 16 | +* `name` - The name of the zone. |
| 17 | +* `self` - The canonical absolute URL of the resource. |
| 18 | +* `serial` - The current serial of the zone. As seen in the zone's SOA record. |
| 19 | +* `state` - The Zone's current state. |
| 20 | +* `time_created` - The date and time the Zone was created, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` |
| 21 | +* `version` - Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. |
| 22 | +* `zone_type` - The type of the zone. Must be either `PRIMARY` or `SECONDARY`. |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +### Create Operation |
| 27 | +Creates a new zone in the specified compartment. |
| 28 | + |
| 29 | + |
| 30 | +The following arguments are supported: |
| 31 | + |
| 32 | +* `compartment_id` - (Required) The OCID of the compartment containing the zone. |
| 33 | +* `external_masters` - (Optional) External master servers for the zone. |
| 34 | + * `address` - (Required) The server's IP address (IPv4 or IPv6). |
| 35 | + * `port` - (Optional) The server's port. |
| 36 | + * `tsig` - (Optional) |
| 37 | + * `algorithm` - (Required) TSIG Algorithms are encoded as domain names, but most consist of only one non-empty label, which is not required to be explicitly absolute. For a full list of TSIG algorithms, see [Secret Key Transaction Authentication for DNS (TSIG) Algorithm Names](http://www.iana.org/assignments/tsig-algorithm-names/tsig-algorithm-names.xhtml#tsig-algorithm-names-1) |
| 38 | + * `name` - (Required) A domain name identifying the key for a given pair of hosts. |
| 39 | + * `secret` - (Required) A base64 string encoding the binary shared secret. |
| 40 | +* `name` - (Required) The name of the zone. |
| 41 | +* `zone_type` - (Required) The type of the zone. Must be either `PRIMARY` or `SECONDARY`. |
| 42 | + |
| 43 | + |
| 44 | +### Update Operation |
| 45 | +Updates the specified secondary zone with your new external master |
| 46 | +server information. For more information about secondary zone, see |
| 47 | +[Manage DNS Service Zone](https://docs.us-phoenix-1.oraclecloud.com/Content/DNS/Tasks/managingdnszones.htm). |
| 48 | + |
| 49 | + |
| 50 | +The following arguments support updates: |
| 51 | +* `external_masters` - External master servers for the zone. |
| 52 | + * `address` - The server's IP address (IPv4 or IPv6). |
| 53 | + * `port` - The server's port. |
| 54 | + * `tsig` - |
| 55 | + * `algorithm` - (Required) TSIG Algorithms are encoded as domain names, but most consist of only one non-empty label, which is not required to be explicitly absolute. For a full list of TSIG algorithms, see [Secret Key Transaction Authentication for DNS (TSIG) Algorithm Names](http://www.iana.org/assignments/tsig-algorithm-names/tsig-algorithm-names.xhtml#tsig-algorithm-names-1) |
| 56 | + * `name` - (Required) A domain name identifying the key for a given pair of hosts. |
| 57 | + * `secret` - (Required) A base64 string encoding the binary shared secret. |
| 58 | + |
| 59 | +** IMPORTANT ** |
| 60 | +Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values |
| 61 | + |
| 62 | +### Example Usage |
| 63 | + |
| 64 | +``` |
| 65 | +resource "oci_dns_zone" "test_zone" { |
| 66 | + #Required |
| 67 | + compartment_id = "${var.compartment_id}" |
| 68 | + name = "${var.zone_name}" |
| 69 | + zone_type = "${var.zone_zone_type}" |
| 70 | +
|
| 71 | + #Optional |
| 72 | + external_masters { |
| 73 | + #Required |
| 74 | + address = "${var.zone_external_masters_address}" |
| 75 | +
|
| 76 | + #Optional |
| 77 | + port = "${var.zone_external_masters_port}" |
| 78 | + tsig { |
| 79 | + #Required |
| 80 | + algorithm = "${var.zone_external_masters_tsig_algorithm}" |
| 81 | + name = "${var.zone_external_masters_tsig_name}" |
| 82 | + secret = "${var.zone_external_masters_tsig_secret}" |
| 83 | + } |
| 84 | + } |
| 85 | +} |
| 86 | +``` |
| 87 | + |
| 88 | +# oci_dns_zones |
| 89 | + |
| 90 | +## Zones DataSource |
| 91 | + |
| 92 | +Gets a list of zones |
| 93 | + |
| 94 | +### Get Operation |
| 95 | +Gets a list of all zones in the specified compartment. The collection |
| 96 | +can be filtered by name, time created, and zone type. |
| 97 | + |
| 98 | +The following arguments are supported: |
| 99 | + |
| 100 | +* `compartment_id` - (Required) The OCID of the compartment the resource belongs to. |
| 101 | +* `name` - (Optional) A case-sensitive filter for zone names. Will match any zone with a name that equals the provided value. |
| 102 | +* `name_contains` - (Optional) Search by zone name. Will match any zone whose name (case-insensitive) contains the provided value. |
| 103 | +* `sort_by` - (Optional) The field by which to sort zones. Allowed values are: name|zoneType|timeCreated |
| 104 | +* `sort_order` - The order to sort the resources. Allowed values are: ASC|DESC |
| 105 | +* `state` - (Optional) The state of a resource. |
| 106 | +* `time_created_greater_than_or_equal_to` - (Optional) An [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp that states all returned resources were created on or after the indicated time. |
| 107 | +* `time_created_less_than` - (Optional) An [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp that states all returned resources were created before the indicated time. |
| 108 | +* `zone_type` - (Optional) Search by zone type, `PRIMARY` or `SECONDARY`. Will match any zone whose type equals the provided value. |
| 109 | + |
| 110 | + |
| 111 | +The following attributes are exported: |
| 112 | + |
| 113 | +* `zones` - A list of DNS zones. |
| 114 | + |
| 115 | +### Example Usage |
| 116 | + |
| 117 | +``` |
| 118 | +data "oci_dns_zones" "test_zones" { |
| 119 | + #Required |
| 120 | + compartment_id = "${var.compartment_id}" |
| 121 | +
|
| 122 | + #Optional |
| 123 | + name = "${var.zone_name}" |
| 124 | + name_contains = "${var.zone_name_contains}" |
| 125 | + state = "${var.zone_state}" |
| 126 | + time_created_greater_than_or_equal_to = "${var.zone_time_created_greater_than_or_equal_to}" |
| 127 | + time_created_less_than = "${var.zone_time_created_less_than}" |
| 128 | + zone_type = "${var.zone_zone_type}" |
| 129 | +} |
| 130 | +``` |
0 commit comments