https://pulumi.com logo
Title
c

cool-wall-66940

12/16/2021, 9:31 AM
Hi, I am a newbie, who started learning Pulumi. I use DigitalOcean as my cloud provider. I have successfully created Droplets, Project spaces and moved a droplet into a project space, however I am stuck creating an equivalent of an S3 bucket (SpacesBucket). I googled for the error but I can't find a solution. I tried to set the ACCESS keys in pulumi as well as on the DO admin site but without success. Obviously, I am missing something, did somebody have a similar issue/error? Thank you 🙂 For the following code :
import pulumi
import pulumi_digitalocean as digitalocean

foobar = digitalocean.SpacesBucket("foobarrandom615243", region="nyc3")
I get the following error:
Diagnostics:
  pulumi:pulumi:Stack (pulumispacecreate-dev):
    error: update failed
 
  digitalocean:index:SpacesBucket (foobarrandom615243):
    error: 1 error occurred:
        * Error creating bucket: Spaces credentials not configured
b

billowy-army-68599

12/16/2021, 9:37 AM
hey @cool-wall-66940! welcome! as per the docs, you need additional credentials to create a space bucket: https://www.pulumi.com/registry/packages/digitalocean/api-docs/spacesbucket/ You'll need to create a spaces access key from here: https://cloud.digitalocean.com/account/api/tokens Then set it in your provider like so:
pulumi config set spaces_access_id <my access_id>
pulumi config set spaces_secret_key <my_secret_key> --secret
c

cool-wall-66940

12/16/2021, 9:49 AM
Hey @billowy-army-68599, thanks a lot for your warm welcoming and fast response. I tried to set spaces access keys with the following two variables:
SPACES_ACCESS_KEY_ID SPACES_SECRET_ACCESS_KEY
then I tried with
spaces_access_id
spaces_secret_key
I copied the two values starting with M and T, was I copying the wrong tokens? I tried with the commands above you wrote but I get the same error:
Error creating bucket: Spaces credentials not configured
b

billowy-army-68599

12/16/2021, 9:52 AM
give me a few minutes, I'll try repro
1
l

limited-rainbow-51650

12/16/2021, 9:53 AM
Hello @cool-wall-66940, how did you set
spaces_access_id
and
spaces_secret_key
? These keys should prefixed with the
digitalocean
namespace:
$ pulumi config set digitalocean:spaces_access_id <YOUR_ACCESS_KEY_HERE>
$ pulumi config set digitalocean:spaces_secret_key <YOUR_SECRET_KEY_HERE> --secret
1
c

cool-wall-66940

12/16/2021, 9:54 AM
Just as @billowy-army-68599 told me: I will try with your example as well @limited-rainbow-51650, btw. thanks a lot for your reply
b

billowy-army-68599

12/16/2021, 9:58 AM
yep, @limited-rainbow-51650 is right, I forgot to add the key prefix. your
Pulumi.dev.yaml
should look like this:
config:
  digitalocean:spaces_access_id: FQFYFUXOEWEF7GYVUPPB
  digitalocean:spaces_secret_key:
    secure: AAABACcw7Bh1kmEVZwedBFXJkqudxX7PaHorF7FHDz3J76MFkA3D1N/pgRQKWfHlSQFUvN7LcJKJE7edpT7nJcUF2TdfrUIvE6ZT
which results in:
Updating (dev)

View Live: <https://app.pulumi.com/jaxxstorm/spaces/dev/updates/1>

     Type                                Name        Status
 +   pulumi:pulumi:Stack                 spaces-dev  created
 +   └─ digitalocean:index:SpacesBucket  example     created

Resources:
    + 2 created

Duration: 33s
c

cool-wall-66940

12/16/2021, 9:58 AM
Hey @billowy-army-68599 and @limited-rainbow-51650, this did the trick, adding the namespace:
digitalocean
in front of the variable names. This did the trick and it created the space. Let me try to do it with
digitalocean:SPACES_ACCESS_KEY_ID
b

billowy-army-68599

12/16/2021, 9:59 AM
that won't work for the env vars
@cool-wall-66940 I've confirmed the env vars aren't working, that must be a bug in the provider
c

cool-wall-66940

12/16/2021, 10:00 AM
Ohh, ok, thanks a lot to both of you, for your help and for resolving this issue for me.
I hope our discussion will help somebody and the bug will be resolved. Thanks once again @billowy-army-68599 and @limited-rainbow-51650
b

billowy-army-68599

12/16/2021, 10:03 AM
l

limited-rainbow-51650

12/16/2021, 10:04 AM
@billowy-army-68599 it might also help other people if the section on
Configuring Credentials
is extended with Spaces specific settings https://www.pulumi.com/registry/packages/digitalocean/installation-configuration/#configuring-credentials
👍 1
b

billowy-army-68599

12/16/2021, 10:05 AM
agrred
👍 1
@cool-wall-66940 I just had it pointed out to me by @broad-dog-22463 that I had misspelled my env var, if I spell them correctly, it works as expected:
export SPACES_ACCESS_KEY_ID=<key>
export SPACES_SECRET_ACCESS_KEY=<key>
👍 1
c

cool-wall-66940

12/16/2021, 10:08 AM
So let me try it, I will delete the two vars set earlier
Thanks. Just to confirm this works:
export SPACES_ACCESS_KEY_ID=<key>
export SPACES_SECRET_ACCESS_KEY=<key>
this didn't work what I tried, and which was obviously wrong:
pulumi config set SPACES_ACCESS_KEY_ID <key>
pulumi config set SPACES_SECRET_ACCESS_KEY <key>
❤️ 1
b

brainy-church-78120

12/16/2021, 1:59 PM
if anyone would be up for opening a pr for improving the credentials section, we would super appreciate it! https://github.com/pulumi/registry/edit/master/themes/default/content/registry/packages/digitalocean/installation-configuration.md