|
| 1 | +--- |
| 2 | +subcategory: "IPAM" |
| 3 | +page_title: "Scaleway: scaleway_ipam_ip_reverse_dns" |
| 4 | +--- |
| 5 | + |
| 6 | +# Resource: scaleway_ipam_ip_reverse_dns |
| 7 | + |
| 8 | +Manages Scaleway IPAM IP Reverse DNS. |
| 9 | + |
| 10 | +## Example Usage |
| 11 | + |
| 12 | +```terraform |
| 13 | +resource "scaleway_instance_ip" "ip01" { |
| 14 | + type = "routed_ipv6" |
| 15 | +} |
| 16 | +
|
| 17 | +resource "scaleway_instance_server" "srv01" { |
| 18 | + name = "tf-tests-instance-server-ips" |
| 19 | + ip_ids = [scaleway_instance_ip.ip01.id] |
| 20 | + image = "ubuntu_jammy" |
| 21 | + type = "PRO2-XXS" |
| 22 | + state = "stopped" |
| 23 | +} |
| 24 | +
|
| 25 | +data "scaleway_ipam_ip" "ipam01" { |
| 26 | + resource { |
| 27 | + id = scaleway_instance_server.srv01.id |
| 28 | + type = "instance_server" |
| 29 | + } |
| 30 | + type = "ipv6" |
| 31 | +} |
| 32 | +
|
| 33 | +resource "scaleway_domain_record" "tf_AAAA" { |
| 34 | + dns_zone = "example.com" |
| 35 | + name = "" |
| 36 | + type = "AAAA" |
| 37 | + data = cidrhost(data.scaleway_ipam_ip.ipam01.address_cidr, 42) |
| 38 | + ttl = 3600 |
| 39 | + priority = 1 |
| 40 | +} |
| 41 | +
|
| 42 | +resource "scaleway_ipam_ip_reverse_dns" "base" { |
| 43 | + ipam_ip_id = data.scaleway_ipam_ip.ipam01.id |
| 44 | +
|
| 45 | + hostname = "example.com" |
| 46 | + address = cidrhost(data.scaleway_ipam_ip.ipam01.address_cidr, 42) |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +## Argument Reference |
| 51 | + |
| 52 | +The following arguments are supported: |
| 53 | + |
| 54 | +- `ipam_ip_id` - (Required) The IPAM IP ID. |
| 55 | +- `hostname` - (Required) The reverse domain name. |
| 56 | +- `address` - (Required) The IP corresponding to the hostname. |
| 57 | +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) of the IP reverse DNS. |
| 58 | + |
| 59 | +## Attributes Reference |
| 60 | + |
| 61 | +In addition to all arguments above, the following attributes are exported: |
| 62 | + |
| 63 | +- `id` - The ID of the IPAM IP for which the DNS reverse is configured. |
| 64 | + |
| 65 | +~> **Important:** IPAM IPs' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111 |
| 66 | + |
| 67 | +## Import |
| 68 | + |
| 69 | +IPAM IP reverse DNS can be imported using the `{region}/{id}`, e.g. |
| 70 | + |
| 71 | +```bash |
| 72 | +$ terraform import scaleway_ipam_ip_reverse_dns.main fr-par/11111111-1111-1111-1111-111111111111 |
| 73 | +``` |
0 commit comments