Is there a way to add a tag to a stack in config? ...
# general
b
Is there a way to add a tag to a stack in config? I couldn’t find it in the docs, but I want something like the equivalent of
pulumi stack tag set myorg:environment prod
, but be able to put it in
Pulumi.mystack.yaml
in some way.
Related, if there’s a way to access it from the Automation API, that would be good too. My sense from looking at the code is that there is no such way - there’s no equivalent of setting/getting tags, or doing the equivalent of
pulumi stack ls --tag
e
pulumi stack tag set
and
pulumi stack tag ls
will let you set and list tags for a stack. But tags are a service concept, they aren't stored locally and won't work if using the filestate backend. I don't think those commands are exposed directly in the automation api, but if you raise an issue they'd probably be pretty easy to add.
b
you can use the
--path
argument of
pulumi config set
or
pulumi config get
to manipulate config that uses your own namespacing
for instance
pulumi config set --path myorg.environment prod --stack {stackName}
would create a new
myorg
map in your config with a property
environment
and a value of
prod
b
Right, but I can't do filtering when listing stacks based on config.
@echoing-dinner-19531 there already seems to be an issue for over a year now btw 😀 https://github.com/pulumi/pulumi/issues/5681
e
Ah well up vote that then 🙂 I'm not sure where automation api currently is in priority but github votes do influence the roadmap.
b
Yep, I have. 😀 But it seems the only way right now to programmatically interact with tags is through the REST API.