https://pulumi.com logo
Title
h

hallowed-australia-10473

01/07/2023, 7:55 AM
I am trying to import a DigitalOcean spaces bucket but am getting an error that mentions the possibility of a bug in the provider. I’ll put the error in a thread — if I should be reporting this to DigitalOcean instead of you folks, please let me know!
Diagnostics:
  digitalocean:index:SpacesBucket (pl-bucket):
    warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `digitalocean` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
    warning: digitalocean:index/spacesBucket:SpacesBucket resource 'pl-bucket' has a problem: expected region to be one of [ams3 fra1 nyc3 sfo2 sfo3 sgp1], got sfo2-zg02. Examine values at 'SpacesBucket.Region'.
I filed a support ticket with DigitalOcean, will update here to see what I learn.
e

echoing-dinner-19531

01/07/2023, 9:45 AM
That looks like a provider bug, but we maintain that provider not DigitalOcean. Raise an issue at https://github.com/pulumi/pulumi-digitalocean/issues
h

hallowed-australia-10473

01/07/2023, 6:24 PM
My work does not let me post issues to GitHub without legal approval. 😞. Any chance you can post it on my behalf?
e

echoing-dinner-19531

01/08/2023, 4:30 PM
I can 🙂
h

hallowed-australia-10473

01/12/2023, 8:03 PM
Okay the issue went the wrong way, haha. There is no sfo2-zg02 — the zg02 is clearly an autonaming error. https://www.pulumi.com/docs/intro/concepts/resources/names/#autonaming
All of DigitalOcean’s regions are xxx# in name. Somewhere along the line Pulumi autonamed a region object, and now that’s stuck.
Sorry for not responding sooner — I’ve been swamped with work and have had little time for personal projects this week.
Oooh, the plot thickens. I remembered that the Pulumi stuff is basically dependent on the Terraform provider, so I set up a test Terraform environment and tried to import the bucket. Here’s what actually got imported:
~/digitalocean-terraform-test ❯❯❯ terraform state show digitalocean_spaces_bucket.foobar
# digitalocean_spaces_bucket.foobar:
resource "digitalocean_spaces_bucket" "foobar" {
    bucket_domain_name = "<http://pl-bucket-prod.sfo2.digitaloceanspaces.com|pl-bucket-prod.sfo2.digitaloceanspaces.com>"
    endpoint           = "<http://sfo2-zg02.digitaloceanspaces.com|sfo2-zg02.digitaloceanspaces.com>"
    id                 = "pl-bucket-prod"
    name               = "pl-bucket-prod"
    region             = "sfo2-zg02"
    urn                = "do:space:pl-bucket-prod"

    versioning {
        enabled = false
    }
}
Check out that region and endpoint! Fascinating! I updated my ticket with DigitalOcean asking them if it’s corrupted or what.
e

echoing-dinner-19531

01/18/2023, 5:21 PM
Looks like it was a DigitalOcean issue, they say they've fixed it now: https://github.com/pulumi/pulumi-digitalocean/issues/353#issuecomment-1387435849
h

hallowed-australia-10473

01/20/2023, 2:52 AM
Just tested it and it works. Yay! Thanks!
e

echoing-dinner-19531

01/21/2023, 1:37 PM
Thanks 🙂 I'll close the issue off