oci_dns_rrset

This resource provides the Rrset resource in Oracle Cloud Infrastructure DNS service. Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/dns/latest/Rrset

Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/dns

Updates records in the specified RRSet.

When the zone name is provided as a path parameter and PRIVATE is used for the scope query parameter then the viewId query parameter is required.

RRSet identity and records

An RRSet is the collection of records with the same domain name and record type in one zone. The top-level zone_name_or_id, domain and rtype select that RRSet. Each items block describes one record in it: repeat the selected domain and type, and provide that record’s rdata and ttl. Multiple A record values therefore belong in multiple items blocks of one resource, rather than separate resources managing the same RRSet. Use a consistent TTL for all records in a set.

Example Usage

These examples use a zone resource named example and documentation IP addresses. The zone can be created with oci_dns_zone using compartment_id, name and zone_type = "PRIMARY". See the public RRSet example and private RRSet example for complete configurations. The public directory also includes other DNS examples.

One A record

resource "oci_dns_rrset" "single_record" {
  zone_name_or_id = oci_dns_zone.example.id
  domain          = "www.${oci_dns_zone.example.name}"
  rtype           = "A"

  items {
    domain = "www.${oci_dns_zone.example.name}"
    rtype  = "A"
    rdata  = "192.0.2.10"
    ttl    = 300
  }
}

Multiple A records in one RRSet

resource "oci_dns_rrset" "multiple_records" {
  zone_name_or_id = oci_dns_zone.example.id
  domain          = "api.${oci_dns_zone.example.name}"
  rtype           = "A"

  items {
    domain = "api.${oci_dns_zone.example.name}"
    rtype  = "A"
    rdata  = "192.0.2.20"
    ttl    = 300
  }

  items {
    domain = "api.${oci_dns_zone.example.name}"
    rtype  = "A"
    rdata  = "192.0.2.21"
    ttl    = 300
  }
}

For private zones, see the private RRSet example. When identifying a private zone by name, provide its view_id as well.

Behavior

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Rrset * update - (Defaults to 20 minutes), when updating the Rrset * delete - (Defaults to 20 minutes), when destroying the Rrset

Import

For Rrsets created using scope and view_id, these Rrsets can be imported using the id, e.g.

$ terraform import oci_dns_rrset.test_rrset "zoneNameOrId/{zoneNameOrId}/domain/{domain}/rtype/{rtype}/scope/{scope}/viewId/{viewId}"

skip adding {view_id} at the end if Rrset was created without view_id.