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

great-sunset-355

07/22/2021, 9:41 AM
Hi, I have a question about
name_prefix
- I found several existing issues about this so I'm not sure I should even use it. One of the issues: https://github.com/pulumi/pulumi/issues/6155 With pulumi resource you have to provide
resource_name
and if nothing else is set, this is used in the name of resource. eg. SNS Topic:
Copy code
sns.Topic(
    "my-topic",
)
Results in the resource name
my-topic-1234
. - this at least gives the reference between actual resource and pulumi resource However when I add the
name_prefix
it overrides the resource name completely.
Copy code
sns.Topic(
    "my-topic",
    name_prefix='my-prefix-'
)
Results in the resource name:
my-prefix-20210722092833209300000002
Is there any documentation about this behaviour? I assume this is inherited from terraform provider and may be resoveld with pulumi native provider which I heard about being in development, correct? Is it better for now to use
pulumi resource name
instead of name_prefix?
b

billowy-army-68599

07/22/2021, 5:13 PM
i don't think there's any documentation - name_prefix does indeed come from the terraform provider. I generally recommend not using it, and using pulumi's autonaming
1
g

great-sunset-355

07/23/2021, 7:59 AM
Thank you for the confirmation!