Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digitalocean_cdn fails with "inconsistent final plan" when renaming origin bucket #994

Open
adborden opened this issue May 14, 2023 · 1 comment
Labels

Comments

@adborden
Copy link

Bug Report


Describe the bug

When renaming the spaces bucket name for an CDN origin, terraform fails with "Error: Provider produced inconsistent final plan".

You can retry the apply and it will succeed once the bucket is renamed.

Affected Resource(s)

  • digitalocean_cdn
  • digitalocean_spaces_bucket

Expected Behavior

Rename is applied, and terraform succeeds, configuring the CDN with the new bucket name.

Actual Behavior

Terraform fails with:

╷
│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for digitalocean_cdn.test to include new values learned so far during apply, provider "registry.terraform.io/digitalocean/digitalocean" produced an invalid new
│ value for .origin: was cty.StringVal("test.example.com.sfo3.digitaloceanspaces.com"), but now cty.StringVal("test-example-com.sfo3.digitaloceanspaces.com").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to Reproduce

  1. Configure spaces bucket with initial name
  2. terraform apply
  3. Edit the bucket name, e.g append the bucket name with -2
  4. terraform apply

Terraform Configuration Files
Initial configuration:

resource "digitalocean_spaces_bucket" "test" {
  name   = "test-example-com-1"
  region = "sfo3"
  acl    = "public-read"
}

resource "digitalocean_cdn" "test" {
  origin = digitalocean_spaces_bucket.test.bucket_domain_name
  custom_domain    = "test.example.com"
  certificate_name = digitalocean_certificate.test.name
  ttl = 600
}

resource "digitalocean_certificate" "test" {
  name    = "test.example.com"
  type    = "lets_encrypt"
  domains = [
    "test.example.com",
  ]
}

Terraform version

Terraform v1.3.9
on linux_amd64
+ provider registry.terraform.io/digitalocean/digitalocean v2.28.1

Debug Output
https://gist.github.com/adborden/36a0871651438ad76f3aba8b3ca91d25

Panic Output

Additional context

Important Factoids

References

@adborden adborden added the bug label May 14, 2023
@iainsproat
Copy link

I've been able to replicate, but with digitalocean_project_resources as the downstream dependent resource instead of digitalocean_cdn.

The issue seems to be that the name of the Spaces bucket is allowed to be changed by the digitalocean_spaces_bucket resource. It is my understanding from the DigitalOcean documentation that a Spaces name cannot be changed after being created, so this presumably should result in an error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants