You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling a bit with Pulumi using DO provider trying to import our existing infrastructure to Pulumi.
used (v)env with py3.12 base interpreter:
poetry show | egrep "pulumi|digitalocean"
pulumi 3.145.0 Pulumi's Python SDK
pulumi-digitalocean 4.38.0 A Pulumi package for creating and managing D...
First of all, created API token seems to work just fine, double checked that via your client pydo:
The above prints all 3 resources, projects, domains and droplets.
It starts to get confusing as soon executing pulumi import, however, the error varies by the resource I try to import, e.g.:
Importing "Project":
pulumi import digitalocean:index/project:Project $ProjectName $ProjectUuid
digitalocean:index:Project ($Project):
error: sdk-v2/provider2.go:515: sdk.helper_schema: Error reading Project: GET https://api.digitalocean.com/v2/projects/$ProjectUuid: 401 (request "33678c9e-844d-4ed8-b7f7-b77562268e4e") Unable to authenticate you: provider=digitalocean@4.38.0
error: Preview failed: refreshing urn:pulumi:prod::$ProjectName::digitalocean:index/project:Project::$ProjectName: 1 error occurred:
* Error reading Project: GET https://api.digitalocean.com/v2/projects/$ProjectUuid: 401 (request "33678c9e-844d-4ed8-b7f7-b77562268e4e") Unable to authenticate you
Importing Droplet:
pulumi import digitalocean:index/droplet:Droplet [$DropletName](https://$DropletFqdn) $DropletId
digitalocean:index:Droplet ($DropletFqdn):
error: Preview failed: resource $DropletId does not exist
Importing Domain:
pulumi import digitalocean:index/domain:Domain $Name [$DomainName](https://$DomainName/)
digitalocean:index:Domain ($Name):
error: sdk-v2/provider2.go:515: sdk.helper_schema: Error retrieving domain: GET https://api.digitalocean.com/v2/domains/$DomainName: 401 (request "b385f666-369f-4cbd-ae2d-08426f38ee60") Unable to authenticate you: provider=digitalocean@4.38.0
error: Preview failed: refreshing urn:pulumi:prod::$Project::digitalocean:index/domain:Domain::$Name: 1 error occurred:
* Error retrieving domain: GET https://api.digitalocean.com/v2/domains/$DomainName: 401 (request "b385f666-369f-4cbd-ae2d-08426f38ee60") Unable to authenticate you
Summary:
importing "Project" leads to 401
importing "Droplet" leads to "resourse does not exist" aka 404
importing "Domain" leads to 401
for all imports I've used the same token used by pydo client which finds & resolves the resources I try to import to pulumi.
Thanks for any hint in advance,
Adrian
Sample program
Importing "Project":
pulumi import digitalocean:index/project:Project $ProjectName $ProjectUuid
digitalocean:index:Project ($Project):
error: sdk-v2/provider2.go:515: sdk.helper_schema: Error reading Project: GET https://api.digitalocean.com/v2/projects/$ProjectUuid: 401 (request "33678c9e-844d-4ed8-b7f7-b77562268e4e") Unable to authenticate you: provider=digitalocean@4.38.0
error: Preview failed: refreshing urn:pulumi:prod::$ProjectName::digitalocean:index/project:Project::$ProjectName: 1 error occurred:
* Error reading Project: GET https://api.digitalocean.com/v2/projects/$ProjectUuid: 401 (request "33678c9e-844d-4ed8-b7f7-b77562268e4e") Unable to authenticate you
Importing Droplet:
pulumi import digitalocean:index/droplet:Droplet [$DropletName](https://$DropletFqdn) $DropletId
digitalocean:index:Droplet ($DropletFqdn):
error: Preview failed: resource $DropletId does not exist
Importing Domain:
pulumi import digitalocean:index/domain:Domain $Name [$DomainName](https://$DomainName/)
digitalocean:index:Domain ($Name):
error: sdk-v2/provider2.go:515: sdk.helper_schema: Error retrieving domain: GET https://api.digitalocean.com/v2/domains/$DomainName: 401 (request "b385f666-369f-4cbd-ae2d-08426f38ee60") Unable to authenticate you: provider=digitalocean@4.38.0
error: Preview failed: refreshing urn:pulumi:prod::$Project::digitalocean:index/domain:Domain::$Name: 1 error occurred:
* Error retrieving domain: GET https://api.digitalocean.com/v2/domains/$DomainName: 401 (request "b385f666-369f-4cbd-ae2d-08426f38ee60") Unable to authenticate you
Log output
No response
Affected Resource(s)
No response
Output of pulumi about
CLI
Version 3.130.0
Go Version go1.22.6
Go Compiler gc
Plugins
KIND NAME VERSION
resource digitalocean 4.38.0
language python unknown
Host
OS ubuntu
Version 24.04
Arch x86_64
This project is written in python: executable='.venv/bin/python' version='3.12.3'
Backend
Name g14-2
URL file:local-state
User adrian
Organizations
Token type personal
Dependencies:
NAME VERSION
pulumi_digitalocean 4.38.0
pydo 0.7.0
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered:
Hi @adrpp, thank you for filing this issue. Sorry you're running into trouble!
It seems like there's something in your provider config that's not set up to properly authenticate you.
How are you setting the DIGITALOCEAN_TOKEN? You should be able to either set it in your environment, or on your provider config: https://www.pulumi.com/registry/packages/digitalocean/#configuration-reference.
Possibly related: #836 (that issue seems to say that what you're seeing on Droplet may also be an auth issue in disguise. We should certainly send more helpful error messages here.)
I'm providing DO token via cli stack creation, as input.
Setting as env var for "pulumi import" cli cmd does not make a difference, retrieving same error.
Describe what happened
Hello,
I'm struggling a bit with Pulumi using DO provider trying to import our existing infrastructure to Pulumi.
used (v)env with py3.12 base interpreter:
First of all, created API token seems to work just fine, double checked that via your client
pydo
:The above prints all 3 resources, projects, domains and droplets.
It starts to get confusing as soon executing pulumi import, however, the error varies by the resource I try to import, e.g.:
Importing "Project":
Importing Droplet:
Importing Domain:
Summary:
pydo
client which finds & resolves the resources I try to import to pulumi.Thanks for any hint in advance,
Adrian
Sample program
Importing "Project":
Importing Droplet:
Importing Domain:
Log output
No response
Affected Resource(s)
No response
Output of
pulumi about
CLI
Version 3.130.0
Go Version go1.22.6
Go Compiler gc
Plugins
KIND NAME VERSION
resource digitalocean 4.38.0
language python unknown
Host
OS ubuntu
Version 24.04
Arch x86_64
This project is written in python: executable='.venv/bin/python' version='3.12.3'
Backend
Name g14-2
URL file:local-state
User adrian
Organizations
Token type personal
Dependencies:
NAME VERSION
pulumi_digitalocean 4.38.0
pydo 0.7.0
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: