https://pulumi.com logo
#typescript
Title
# typescript
m

millions-branch-13617

11/13/2023, 3:02 AM
can anyone point me in the right direction for reading the current stacks tags?
l

little-cartoon-10569

11/13/2023, 3:19 AM
Try
pulumi stack tag ls
m

millions-branch-13617

11/13/2023, 3:49 AM
ah yeah I've seen that one, but I'm trying to read the tags from within typescript
l

little-cartoon-10569

11/13/2023, 3:51 AM
You're using the automation-api?
If you're using automation-api, then you can use
automation.Stack.listTags()
.
Else you'll have to invoke
pulumi stack tag ls
.
b

brave-planet-10645

11/13/2023, 8:49 AM
If you’re not using automation api you could make a call to the REST API: https://www.pulumi.com/docs/pulumi-cloud/cloud-rest-api/#get-stack-tags
m

millions-branch-13617

11/13/2023, 7:11 PM
ok thanks I'll take a look at the automation api
is there a reason why I wouldnt want to use it?
l

little-cartoon-10569

11/13/2023, 9:17 PM
No, it just requires a slight change to your project. Your entrypoint moves from being the Pulumi CLI to a normal node program, which invokes via automation-api.
m

millions-branch-13617

11/13/2023, 9:39 PM
ah, thanks!