https://pulumi.com logo
#general
Title
# general
b

brainy-magician-83981

01/23/2019, 4:42 AM
how do we prevent the random number?
w

white-balloon-205

01/23/2019, 4:46 AM
You can pass
name:
to force the name to a specific value - else Pulumi generates an auto name by default. The auto name is quite useful, it ensures that you can replace the resource without downtime by creating a new one before destroying the old one. For many/most resources this is very useful. If you provide and explicit name, it may be necessary to delete the resource before replacing it in case of changes (because AWS won’t let you have two resources with the same name). It also helps ensure you can multi-instantiate a stack without fear of collision. But if you do want to get a specific name for your resource,
name:
should work.
b

brainy-magician-83981

01/23/2019, 4:49 AM
So if I do this:
Copy code
let table = new aws.dynamodb.Tabl('mytable', {...})
Pulumi will generate a resource name with a random number. But if I do this:
Copy code
let table = new aws.dynamodb.Table('mytable', {
  name: 'mytable',
  ...
})
Pulumi will create the table as just: mytable
w

white-balloon-205

01/23/2019, 4:52 AM
Exactly. The first example will autoname the resource using the Pulumi resource name as a prefix and a random suffix to ensure uniqueness.
b

brainy-magician-83981

01/23/2019, 4:52 AM
Thank u again!
2 Views