Is there a way to have pulumi manage this resource...
# aws
p
Is there a way to have pulumi manage this resource name for me and the name I want in the console be what the tag says?
m
Not sure I understand the question correctly. You can specify your own name, without the auto-generated suffix. https://www.pulumi.com/docs/intro/concepts/resources/names/#autonaming
p
well the name has to be unique
Copy code
this.RTassnA = new aws.ec2.RouteTableAssociation(this.vpc.id + "assnA",{
      subnetId: this.subnet1.id.toString(),
      routeTableId: this.privatertA.id,
    },{parent: this});
I thought I could append the vpcId to it but Im overriding the values in the name tag.
nvm, generated my own UUID for the resource to stop name collision
ok nvm dont add a uuid to your resource name or itll delete your entire stack...like resources you arent even changing
m
Wait what? There must be something else going on.
p
yeah it killed my whole network
replaced my network and made me have to get our network team to reconnect the tgw to it
here is the stack output from the pipeline
Untitled.ts
its cool though...it was just our lab. I have the pipeline require manual intervention for our prod environments so I was able to stop it
but yeah it replaced everything after just adding a uuid to a route table name and association
s
@purple-train-14007 You might find this example code a useful reference for both the infra you're building and the naming stuff you're hitting: https://github.com/pulumi/workshops/tree/main/aws-advanced-networking
This is an example of how I get unique names within components: https://github.com/pulumi/workshops/blob/main/aws-advanced-networking/hub.py#L29-L30
p
Thanks Josh!