https://pulumi.com logo
Title
b

brave-motorcycle-67487

03/15/2023, 7:12 PM
Is there a way to pass a namespace to
pulumi config set
? I named one of my projects "aws" and that turns out to conflict with the aws module, so I need to use a different namespace, which is fine. I can do that directly in the yaml file, but it would be convenient to be able to do that via the cli as well - but I don't see anything in the
--help
that says I can override that. (I am guessing I'll especially want to know that when I get to setting secrets in configs)
f

fast-vr-6049

03/15/2023, 7:13 PM
I believe you can use
--path
for this, like so:
pulumi config set --path namespace.key
b

brave-motorcycle-67487

03/15/2023, 7:15 PM
I thought so maybe, but it does not;
pulumi config set --path winnie.twingate.name jolly-porpoise
creates this:
aws:winnie:
  twingate:
    name: jolly-porpoise
(that is, it just nests it underneath)
f

fast-vr-6049

03/15/2023, 7:18 PM
Oh, I think I see what you're saying. I'm not aware of the existence of
namespace
as a concept in Pulumi configs; I'm under the impression that the top-most level of config directives are the Pulumi project name
b

brave-motorcycle-67487

03/15/2023, 7:20 PM
they talk about it a little here: https://www.pulumi.com/docs/intro/concepts/config/#code Basically you pass in a parameter to
pulumi.Config()
and that separates out everything. I learned that if you set random things in the
aws
namespace, the aws provider tries to validate them against its own rules and then throws an error 🙂
f

fast-vr-6049

03/15/2023, 7:21 PM
TIL! I must have glossed over that part when I was reading the docs
b

brave-motorcycle-67487

03/15/2023, 7:21 PM
it could be that I should go through the process of renaming (can I do that? it might be recreating) the project now that I understand the project naming better, to save myself future trouble
f

fast-vr-6049

03/15/2023, 7:25 PM
Looking closer at the doc you linked, it seems like you can create a new namespace by doing a
pulumi config set <new namespace>:aKey
I don't know if that'd work with
--path
, but I'd try
pulumi config set --path 'winnie:twingate.name'
b

brave-motorcycle-67487

03/15/2023, 7:27 PM
ah! you're right, that works
thank you - sometimes you just need an extra set of eyes
f

fast-vr-6049

03/15/2023, 7:29 PM
Happy to help 😄