Skip to content

Commit

Permalink
Merge branch 'main' of github.com:digitalocean/terraform-provider-dig…
Browse files Browse the repository at this point in the history
…italocean
  • Loading branch information
loosla committed Feb 26, 2025
2 parents 4695b47 + f5763d1 commit 34ddb13
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/data-sources/reserved_ipv6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
page_title: "DigitalOcean: digitalocean_reserved_ipv6"
subcategory: "Networking"
---

# digitalocean_reserved_ipv6

Get information on a reserved IPv6. This data source provides the region_slug and droplet id as configured on your DigitalOcean account. This is useful if the reserved IPv6 in question is not managed by Terraform or you need to find the Droplet the IP is
attached to.

An error is triggered if the provided reserved IPv6 does not exist.

## Example Usage

Get the reserved IPv6:

```hcl
resource "digitalocean_reserved_ipv6" "foo" {
region_slug = "nyc3"
}
data "digitalocean_reserved_ipv6" "foobar" {
ip = digitalocean_reserved_ipv6.foo.ip
}
```

## Argument Reference

The following arguments are supported:

* `ip` - (Required) The allocated IPv6 address of the specific reserved IPv6 to retrieve.

## Attributes Reference

The following attributes are exported:

* `region_slug`: The region that the reserved IPv6 is reserved to.
* `urn`: The uniform resource name of the reserved IPv6.
* `droplet_id`: The Droplet id that the reserved IP has been assigned to.
35 changes: 35 additions & 0 deletions docs/resources/reserved_ipv6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
page_title: "DigitalOcean: digitalocean_reserved_ipv6"
subcategory: "Networking"
---

# digitalocean\_reserved_ipv6

Provides a DigitalOcean reserved IPv6 to represent a publicly-accessible static IPv6 addresses that can be mapped to one of your Droplets.

~> **NOTE:** Reserved IPv6s can be assigned to a Droplet using
`digitalocean_reserved_ipv6_assignment` resource only.

## Example Usage

```hcl
resource "digitalocean_reserved_ipv6" "foobar" {
region_slug = "nyc3"
}
```

## Argument Reference

The following arguments are supported:

* `region_slug` - (Required) The region that the reserved IPv6 needs to be reserved to.


## Import

Reserved IPv6s can be imported using the `ip`, e.g.

```
terraform import digitalocean_reserved_ipv6.myip
2409:40d0:fa:27dd:9b24:7074:7b85:eee6
```
50 changes: 50 additions & 0 deletions docs/resources/reserved_ipv6_assignment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
page_title: "DigitalOcean: digitalocean_reserved_ipv6_assignment"
subcategory: "Networking"
---

# digitalocean\_reserved_ipv6_assignment

Provides a resource for assigning an existing DigitalOcean reserved IPv6 to a Droplet. This
makes it easy to provision reserved IPv6 addresses that are not tied to the lifecycle of your Droplet.

## Example Usage

```hcl
resource "digitalocean_reserved_ipv6" "foobar" {
region_slug = "nyc3"
}
resource "digitalocean_droplet" "foobar" {
image = "ubuntu-22-04-x64"
name = "tf-acc-test-01"
region = "nyc3"
size = "s-1vcpu-1gb"
ipv6 = true
}
resource "digitalocean_reserved_ipv6_assignment" "foobar" {
ip = digitalocean_reserved_ipv6.foobar.ip
droplet_id = digitalocean_droplet.foobar.id
lifecycle {
create_before_destroy = true
}
}
```

## Argument Reference

The following arguments are supported:

* `ip` - (Required) The reserved IPv6 to assign to the Droplet.
* `droplet_id` - (Required) The ID of Droplet that the reserved IPv6 will be assigned to.

## Import

Reserved IPv6 assignments can be imported using the reserved IPv6 itself and the `id` of
the Droplet joined with a comma. For example:

```
terraform import digitalocean_reserved_ipv6_assignment.foobar 2409:40d0:fa:27dd:9b24:7074:7b85:eee6,123456
```

0 comments on commit 34ddb13

Please sign in to comment.