This feels like a really dumb question, but why do...
# aws
b
This feels like a really dumb question, but why does aws.ecs.cluster take a Name parameter if it's then going to stick something random on the end? Is there a way to stop that? I submitted a name of hsnext-prod-east-cluster and got hsnext-prod-east-cluster-1ff9f43. Is that going to change every time? Our Bitbucket pipelines need to reference that, so that'll be a problem. How do I get the exact name I specified?
I don't see that behavior mentioned in the documentation, either
l
It's odd that it does that. Can you confirm that you don't have a resource or stack transformation that clears the name input? All other resources use name as an input specifically to stop Pulumi from generating unique suffices.
b
This is literally the entire code block?
l
That said, it should be feasible to get the actual randomized name from Pulumi for use in your pipelines. You can push the name to somewhere in your CI system, or have your pipeline grab the name from the stack references. I know that well-known, widely-advertised names are often important or even essential, but the random suffix is really useful to allow Pulumi to always-on redeployments.
Stack transformations wouldn't be in the code block, they're be set up elsewhere. They apply to all resources in the stack.
Is that typescript? I've never seen that format before, let me look it up.
b
can you give me a hint as to what I would be looking for then? I'm still very new to this.
yeah, that's TS
ecs.service does the same thing for me
l
The name you're setting is the Cluster settings name, not the Cluster name.
That's a bug.
b
the word transformations is no where in my index.ts, so not doing those based on the docs I just looked up
l
It's not a transformation issue. You're just not setting the name. Try this:
Copy code
const hsnext_prod_east_cluster = new aws.ecs.Cluster("hsnext-prod-east-cluster", {
  name: "hsnext-prod-east-cluster",
 settings: [{
    name: "containerInsights",
    value: "enabled",
}]});
The name parameter is not the name property
b
Ok. Yeah, I literally copied the example in the docs
l
You need to set the name property to get Pulumi to use it literally. The name parameter is used as the prefix of the default name; the name property eliminates the default name and uses what you configure.
b
gotcha. So yeah, that's probably what's wrong with Service as well
l
There are good reasons to let Pulumi do the naming, but if you have better reasons not to allow that, then use the name property.
b
Thanks!