This message was deleted.
# getting-started
s
This message was deleted.
e
Pulumis default behaviour is to set the resources cloud name to a user set logical name + a pusdorandom suffix. See https://www.pulumi.com/docs/intro/concepts/resources/names/#autonaming for more details.
l
Thanks for the reply. And that pseudorandom suffix (I was aware of that) will automatically change (or be different) when I change pulumi stacks (pulumi stack select)?
e
Yes its recently changed it used to be it was just random bytes from the operating systems crypto services, it's now a hash of stack name, resource name, and a count of how many times this resource has been re-created in this stack.
l
That's helpful. It would still make the environments to which a resource "belongs" opaque (i.e. in the web portal). I'm thinking I still might include an indicator in the resource group (Azure) so we can quickly look at a resource's resource group and know what environment it is. Thanks again.
b
You can typically get the current stack. In Go, it would be
ctx.Stack()
, but I imagine itโ€™s available in other programs.
l
I've looked all over for that in C# - haven't found it yet. But I'm guessing you're right.
b
Copy code
var stack = Deployment.Instance.StackName;
m
you probably don't want to introspect on stacks too much and let the configuration per-stack drive the differences transparently
if you are asking yourself "i want to do something different if it's this stack", and it can't fit in a config, you might want to think about how your project is organized and if you actually need a new project
๐Ÿ‘๏ธ 1
l
The resource names shouldn't have to be unique except in cases where the Cloud service makes that requirement and they're not namespaced appropriately. This happens for S3 buckets, but not a lot of other resources. Generally, Pulumi autonaming is sufficient. If you want the stack to be obvious on a resource, tags are usually the best option.
๐Ÿ‘๏ธ 1