How do I get the Pulumi stack name (in Python) so ...
# getting-started
s
How do I get the Pulumi stack name (in Python) so I can use it in resource names? I have seen reference to something like
pulumi.getStack()
, but I cannot figure out how to invoke it in python:
Copy code
import pulumi
pulumi_stack_name = pulumi.getStack()
print( "pulumi_stack_name: ", pulumi_stack_name )
results in:
Copy code
AttributeError: module 'pulumi' has no attribute 'getStack'
q
It's
pulumi.get_stack()