https://pulumi.com logo
#general
Title
# general
i

icy-controller-6092

01/16/2024, 12:40 AM
How do I set a map with
pulumi config set
? I got the command to work but running the program failed:
Copy code
> pulumi config set --path 'aws:defaultTags.tags' '{"user:Project": "my_project"}'
error: pulumi:providers:aws resource 'default_6_9_0' has a problem: could not validate provider configuration: Attribute must be a map. Check `pulumi config get --path aws:defaultTags.tags`
other things I've tried:
Copy code
> pulumi config set --path 'aws:defaultTags.tags.["user:Project"]' my_project
error: invalid configuration key: could not parse aws:defaultTags.tags.["user:Project"] as a configuration key (configuration keys should be of the form `<namespace>:<name>`)
--
Copy code
> pulumi config set --path 'aws:defaultTags.tags.user:Project' my_project
# same error as above
--
Copy code
> pulumi config set --path 'aws:defaultTags.tags.test' true
error: defaultTags.tags: expected a map
l

limited-rainbow-51650

01/16/2024, 7:46 AM
Hello @icy-controller-6092, the following commands:
Copy code
$ pulumi config set --path 'aws:defaultTags.tags.key' value
$ pulumi config set --path 'aws:defaultTags.tags.otherkey' othervalue
give me the following stack config:
Copy code
config:
  aws:defaultTags:
    tags:
      key: value
      otherkey: othervalue
The problem for you is that your
key
contains a colon (
user:Project
). This seems to confuse our argument parsing. Can you file an issue for this? https://github.com/pulumi/pulumi/issues
i

icy-controller-6092

01/16/2024, 8:09 AM
Hey Ringo, that’s the same format I used for the last command, but I still got the error. This was with a blank yaml so that might be the difference