Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: digitalocean/terraform-provider-digitalocean
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.49.1
Choose a base ref
...
head repository: digitalocean/terraform-provider-digitalocean
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.49.2
Choose a head ref
  • 6 commits
  • 22 files changed
  • 3 contributors

Commits on Feb 28, 2025

  1. docs: fix typo in error codes that are retried (#1332)

    andrewsomething authored Feb 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    bf2f4d7 View commit details
  2. partner interconnect operations support (#1329)

    * add partner interconnect attachment data source and resource
    
    * update provider
    
    * added partner interconnect attachment documentation
    
    * fix name conventions
    
    * remove unneccesary local_router_asn field
    
    * update godo version
    
    * lint fix
    
    * lint fix
    
    * address feedback
    
    * update godo version
    
    * address feedback
    
    * VPC-3920: remove retry on create
    
    ---------
    
    Co-authored-by: danaelhe <42972711+danaelhe@users.noreply.github.com>
    apinonformoso and danaelhe authored Feb 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c5768ff View commit details

Commits on Mar 13, 2025

  1. docs: link to API docs for finding image IDs. (#1336)

    andrewsomething authored Mar 13, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7acb1ec View commit details
  2. docs: update links to API reference (#1337)

    andrewsomething authored Mar 13, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dfc7038 View commit details

Commits on Mar 18, 2025

  1. load balancers: fix importing global LBs (#1340)

    * load balancers: fix importing global LBs
    
    * Clean up error messages.
    
    * make terrafmt
    andrewsomething authored Mar 18, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    af27b8f View commit details
  2. Revert "partner interconnect operations support (#1329)" (#1341)

    This reverts commit c5768ff.
    andrewsomething authored Mar 18, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6441aa2 View commit details
4 changes: 4 additions & 0 deletions digitalocean/loadbalancer/datasource_loadbalancer.go
Original file line number Diff line number Diff line change
@@ -67,6 +67,10 @@ func DataSourceDigitalOceanLoadbalancer() *schema.Resource {
Computed: true,
Description: "current state of the Load Balancer",
},
"ipv6": {
Type: schema.TypeString,
Computed: true,
},
"forwarding_rule": {
Type: schema.TypeSet,
Computed: true,
15 changes: 7 additions & 8 deletions digitalocean/loadbalancer/datasource_loadbalancer_test.go
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ data "digitalocean_loadbalancer" "foobar" {
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "size_unit", "1"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "type", ""),
"data.digitalocean_loadbalancer.foobar", "type", "REGIONAL"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "forwarding_rule.#", "1"),
resource.TestCheckTypeSetElemNestedAttrs(
@@ -112,7 +112,7 @@ data "digitalocean_loadbalancer" "foobar" {
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "size_unit", "1"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "type", ""),
"data.digitalocean_loadbalancer.foobar", "type", "REGIONAL"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "forwarding_rule.#", "1"),
resource.TestCheckTypeSetElemNestedAttrs(
@@ -178,7 +178,7 @@ data "digitalocean_loadbalancer" "foobar" {
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "size_unit", "6"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "type", ""),
"data.digitalocean_loadbalancer.foobar", "type", "REGIONAL"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "forwarding_rule.#", "1"),
resource.TestCheckTypeSetElemNestedAttrs(
@@ -242,7 +242,7 @@ data "digitalocean_loadbalancer" "foobar" {
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "size_unit", "6"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "type", ""),
"data.digitalocean_loadbalancer.foobar", "type", "REGIONAL"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "forwarding_rule.#", "1"),
resource.TestCheckTypeSetElemNestedAttrs(
@@ -645,7 +645,7 @@ data "digitalocean_loadbalancer" "foobar" {
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "type", "GLOBAL"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "glb_settings.0.target_protocol", "HTTP"),
"data.digitalocean_loadbalancer.foobar", "glb_settings.0.target_protocol", "http"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "glb_settings.0.target_port", "80"),
resource.TestCheckResourceAttr(
@@ -791,9 +791,8 @@ resource "digitalocean_droplet" "foobar" {
}
resource "digitalocean_loadbalancer" "lorem" {
name = "%s"
type = "GLOBAL"
network = "EXTERNAL"
name = "%s"
type = "GLOBAL"
healthcheck {
port = 80
22 changes: 22 additions & 0 deletions digitalocean/loadbalancer/import_loadbalancer_test.go
Original file line number Diff line number Diff line change
@@ -28,3 +28,25 @@ func TestAccDigitalOceanLoadBalancer_importBasic(t *testing.T) {
},
})
}

func TestAccDigitalOceanLoadBalancer_importGLB(t *testing.T) {
resourceName := "digitalocean_loadbalancer.foobar"
name := acceptance.RandomTestName()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acceptance.TestAccPreCheck(t) },
ProviderFactories: acceptance.TestAccProviderFactories,
CheckDestroy: testAccCheckDigitalOceanLoadbalancerDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckDigitalOceanGlobalLoadbalancerConfig_basic(name),
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
5 changes: 3 additions & 2 deletions digitalocean/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
@@ -324,11 +324,12 @@ func flattenDomains(client *godo.Client, domains []*godo.LBDomain) ([]map[string

r["name"] = (*domain).Name
r["is_managed"] = (*domain).IsManaged
r["certificate_id"] = (*domain).CertificateID
r["verification_error_reasons"] = (*domain).VerificationErrorReasons
r["ssl_validation_error_reasons"] = (*domain).SSLValidationErrorReasons

if domain.CertificateID != "" {
r["certificate_id"] = (*domain).CertificateID

// When the certificate type is lets_encrypt, the certificate
// ID will change when it's renewed, so we have to rely on the
// certificate name as the primary identifier instead.
@@ -350,7 +351,7 @@ func flattenGLBSettings(settings *godo.GLBSettings) []map[string]interface{} {
if settings != nil {
r := make(map[string]interface{})

r["target_protocol"] = (*settings).TargetProtocol
r["target_protocol"] = strings.ToLower((*settings).TargetProtocol)
r["target_port"] = (*settings).TargetPort

if settings.CDN != nil {
31 changes: 25 additions & 6 deletions digitalocean/loadbalancer/resource_loadbalancer.go
Original file line number Diff line number Diff line change
@@ -442,6 +442,7 @@ func resourceDigitalOceanLoadBalancerV0() *schema.Resource {
"type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"REGIONAL", "GLOBAL", "REGIONAL_NETWORK"}, true),
Description: "the type of the load balancer (GLOBAL, REGIONAL, or REGIONAL_NETWORK)",
@@ -758,6 +759,7 @@ func resourceDigitalOceanLoadbalancerRead(ctx context.Context, d *schema.Resourc
d.Set("vpc_uuid", loadbalancer.VPCUUID)
d.Set("http_idle_timeout_seconds", loadbalancer.HTTPIdleTimeoutSeconds)
d.Set("project_id", loadbalancer.ProjectID)
d.Set("type", loadbalancer.Type)

if loadbalancer.IPv6 != "" {
d.Set("ipv6", loadbalancer.IPv6)
@@ -776,28 +778,45 @@ func resourceDigitalOceanLoadbalancerRead(ctx context.Context, d *schema.Resourc
d.Set("disable_lets_encrypt_dns_records", loadbalancer.DisableLetsEncryptDNSRecords)

if err := d.Set("droplet_ids", flattenDropletIds(loadbalancer.DropletIDs)); err != nil {
return diag.Errorf("[DEBUG] Error setting Load Balancer droplet_ids - error: %#v", err)
return diag.Errorf("Error setting load balancer droplet_ids: %#v", err)
}

if err := d.Set("sticky_sessions", flattenStickySessions(loadbalancer.StickySessions)); err != nil {
return diag.Errorf("[DEBUG] Error setting Load Balancer sticky_sessions - error: %#v", err)
return diag.Errorf("Error setting load balancer sticky_sessions: %#v", err)
}

if err := d.Set("healthcheck", flattenHealthChecks(loadbalancer.HealthCheck)); err != nil {
return diag.Errorf("[DEBUG] Error setting Load Balancer healthcheck - error: %#v", err)
return diag.Errorf("Error setting load balancer healthcheck: %#v", err)
}

forwardingRules, err := flattenForwardingRules(client, loadbalancer.ForwardingRules)
if err != nil {
return diag.Errorf("[DEBUG] Error building Load Balancer forwarding rules - error: %#v", err)
return diag.Errorf("Error building load balancer forwarding rules: %#v", err)
}

if err := d.Set("forwarding_rule", forwardingRules); err != nil {
return diag.Errorf("[DEBUG] Error setting Load Balancer forwarding_rule - error: %#v", err)
return diag.Errorf("Error setting load balancer forwarding_rule: %#v", err)
}

if err := d.Set("firewall", flattenLBFirewall(loadbalancer.Firewall)); err != nil {
return diag.Errorf("[DEBUG] Error setting Load Balancer firewall - error: %#v", err)
return diag.Errorf("Error setting load balancer firewall: %#v", err)
}

domains, err := flattenDomains(client, loadbalancer.Domains)
if err != nil {
return diag.Errorf("Error building load balancer domains: %#v", err)
}

if err := d.Set("domains", domains); err != nil {
return diag.Errorf("Error setting load balancer domains: %#v", err)
}

if err := d.Set("glb_settings", flattenGLBSettings(loadbalancer.GLBSettings)); err != nil {
return diag.Errorf("Error setting load balancer glb_settings: %#v", err)
}

if err := d.Set("target_load_balancer_ids", flattenLoadBalancerIds(loadbalancer.TargetLoadBalancerIDs)); err != nil {
return diag.Errorf("Error setting target load balancer IDs: %#v", err)
}

return nil
12 changes: 3 additions & 9 deletions digitalocean/loadbalancer/resource_loadbalancer_test.go
Original file line number Diff line number Diff line change
@@ -874,8 +874,6 @@ func TestAccDigitalOceanGlobalLoadbalancer(t *testing.T) {
"digitalocean_loadbalancer.lorem", "domains.1.name", "test.github.io"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "domains.0.name", "test-2.github.io"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "droplet_ids.#", "1"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "target_load_balancer_ids.#", "1"),
),
@@ -895,19 +893,17 @@ func TestAccDigitalOceanGlobalLoadbalancer(t *testing.T) {
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "glb_settings.0.cdn.0.is_enabled", "false"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "glb_settings.0.region_priorities.%", "2"),
"digitalocean_loadbalancer.lorem", "glb_settings.0.region_priorities.%", "2"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "glb_settings.0.region_priorities.nyc1", "1"),
"digitalocean_loadbalancer.lorem", "glb_settings.0.region_priorities.nyc1", "1"),
resource.TestCheckResourceAttr(
"data.digitalocean_loadbalancer.foobar", "glb_settings.0.region_priorities.nyc2", "2"),
"digitalocean_loadbalancer.lorem", "glb_settings.0.region_priorities.nyc2", "2"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "domains.#", "2"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "domains.1.name", "test-updated.github.io"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "domains.0.name", "test-updated-2.github.io"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "droplet_ids.#", "1"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.lorem", "target_load_balancer_ids.#", "1"),
),
@@ -1402,7 +1398,6 @@ resource "digitalocean_loadbalancer" "lorem" {
is_managed = false
}
droplet_ids = [digitalocean_droplet.foobar.id]
target_load_balancer_ids = [digitalocean_loadbalancer.foobar.id]
}`, name, name, name)
}
@@ -1474,7 +1469,6 @@ resource "digitalocean_loadbalancer" "lorem" {
is_managed = false
}
droplet_ids = [digitalocean_droplet.foobar.id]
target_load_balancer_ids = [digitalocean_loadbalancer.foobar.id]
}`, name, name, name)
}
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ The following arguments are supported:
to `0.0` (Defaults to the value of the `DIGITALOCEAN_REQUESTS_PER_SECOND` environment
variable or `0.0` if unset).
* `http_retry_max` - (Optional) This can be used to override the maximum number
of retries on a failed API request (client errors, 422, 500, 502...), the exponential
of retries on a failed API request (client errors, 429, 500, 502...), the exponential
backoff can be configured by the `http_retry_wait_min` and `http_retry_wait_max` arguments
(Defaults to the value of the `DIGITALOCEAN_HTTP_RETRY_MAX` environment variable or
`4` if unset).
6 changes: 3 additions & 3 deletions docs/resources/app.md
Original file line number Diff line number Diff line change
@@ -248,7 +248,7 @@ A `service` can contain:
- `source_dir` - An optional path to the working directory to use for the build.
- `run_command` - An optional run command to override the component's default.
- `environment_slug` - An environment slug describing the type of this app.
- `instance_size_slug` - The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/api-reference/#operation/list_instance_sizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
- `instance_size_slug` - The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Apps/operation/apps_list_instanceSizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
- `instance_count` - The amount of instances that this component should be scaled to.
- `http_port` - The internal port on which this service's run command will listen.
- `internal_ports` - A list of ports on which this service will listen for internal traffic.
@@ -369,7 +369,7 @@ A `worker` can contain:
- `source_dir` - An optional path to the working directory to use for the build.
- `run_command` - An optional run command to override the component's default.
- `environment_slug` - An environment slug describing the type of this app.
- `instance_size_slug` - The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/api-reference/#operation/list_instance_sizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
- `instance_size_slug` - The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Apps/operation/apps_list_instanceSizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
- `instance_count` - The amount of instances that this component should be scaled to.
- `git` - A Git repo to use as the component's source. The repository must be able to be cloned without authentication. Only one of `git`, `github` or `gitlab` may be set
- `repo_clone_url` - The clone URL of the repo.
@@ -444,7 +444,7 @@ A `job` can contain:
- `source_dir` - An optional path to the working directory to use for the build.
- `run_command` - An optional run command to override the component's default.
- `environment_slug` - An environment slug describing the type of this app.
- `instance_size_slug` - The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/api-reference/#operation/list_instance_sizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
- `instance_size_slug` - The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Apps/operation/apps_list_instanceSizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
- `instance_count` - The amount of instances that this component should be scaled to.
- `git` - A Git repo to use as the component's source. The repository must be able to be cloned without authentication. Only one of `git`, `github` or `gitlab` may be set
- `repo_clone_url` - The clone URL of the repo.
2 changes: 1 addition & 1 deletion docs/resources/custom_image.md
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ The following arguments are supported:
* `url` - (Required) A URL from which the custom Linux virtual machine image may be retrieved.
* `regions` - (Required) A list of regions. (Currently only one is supported).
* `description` - An optional description for the image.
* `distribution` - An optional distribution name for the image. Valid values are documented [here](https://docs.digitalocean.com/reference/api/api-reference/#operation/create_custom_image)
* `distribution` - An optional distribution name for the image. Valid values are documented [here](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Images/operation/images_create_custom)
* `tags` - A list of optional tags for the image.

## Attributes Reference
4 changes: 2 additions & 2 deletions docs/resources/database_cluster.md
Original file line number Diff line number Diff line change
@@ -118,11 +118,11 @@ The following arguments are supported:

* `name` - (Required) The name of the database cluster.
* `engine` - (Required) Database engine used by the cluster (ex. `pg` for PostreSQL, `mysql` for MySQL, `redis` for Redis, `mongodb` for MongoDB, or `kafka` for Kafka).
* `size` - (Required) Database Droplet size associated with the cluster (ex. `db-s-1vcpu-1gb`). See here for a [list of valid size slugs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Databases).
* `size` - (Required) Database Droplet size associated with the cluster (ex. `db-s-1vcpu-1gb`). See the DigitalOcean API for a [list of valid size slugs](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Databases/operation/databases_list_options).
* `region` - (Required) DigitalOcean region where the cluster will reside.
* `node_count` - (Required) Number of nodes that will be included in the cluster. For `kafka` clusters, this must be 3.
* `version` - (Required) Engine version used by the cluster (ex. `14` for PostgreSQL 14).
When this value is changed, a call to the [Upgrade major Version for a Database](https://docs.digitalocean.com/reference/api/api-reference/#operation/databases_update_major_version) API operation is made with the new version.
When this value is changed, a call to the [Upgrade major Version for a Database](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Databases/operation/databases_update_major_version) API operation is made with the new version.
* `tags` - (Optional) A list of tag names to be applied to the database cluster.
* `private_network_uuid` - (Optional) The ID of the VPC where the database cluster will be located.
* `project_id` - (Optional) The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.
2 changes: 1 addition & 1 deletion docs/resources/database_kafka_config.md
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ resource "digitalocean_database_cluster" "example" {

## Argument Reference

The following arguments are supported. See the [DigitalOcean API documentation](https://docs.digitalocean.com/reference/api/api-reference/#operation/databases_patch_config)
The following arguments are supported. See the [DigitalOcean API documentation](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Databases/operation/databases_patch_config)
for additional details on each option.

* `cluster_id` - (Required) The ID of the target Kafka cluster.
2 changes: 1 addition & 1 deletion docs/resources/database_mongodb_config.md
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ resource "digitalocean_database_cluster" "example" {

## Argument Reference

The following arguments are supported. See the [DigitalOcean API documentation](https://docs.digitalocean.com/reference/api/api-reference/#operation/databases_patch_config)
The following arguments are supported. See the [DigitalOcean API documentation](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Databases/operation/databases_patch_config)
for additional details on each option.

* `cluster_id` - (Required) The ID of the target MongoDB cluster.
2 changes: 1 addition & 1 deletion docs/resources/database_mysql_config.md
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ resource "digitalocean_database_cluster" "example" {

## Argument Reference

The following arguments are supported. See the [DigitalOcean API documentation](https://docs.digitalocean.com/reference/api/api-reference/#operation/databases_patch_config)
The following arguments are supported. See the [DigitalOcean API documentation](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Databases/operation/databases_patch_config)
for additional details on each option.

* `cluster_id` - (Required) The ID of the target MySQL cluster.
Loading