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

gentle-account-13294

01/12/2021, 1:14 AM
Iā€™m getting an error with: AWS Subnet update which results in a
replace
for the Subnet. Actually it is shown as a
delete
and a
create
Separately. This results in an error when running
up
as the
create
is getting executed before the
delete
. Thoughts on what to do here would be great !!
l

little-cartoon-10569

01/12/2021, 1:20 AM
If you're ok with deleting the subnet this once, I'd consider removing the name from the subnet. You'll get this sort of problem if you name your resources.
You could use namePrefix, or nothing (let Pulumi generate the name). If Pulumi can generate the name or name suffix, then this problem doesn't occur.
g

gentle-account-13294

01/12/2021, 6:46 PM
hmm.. we are specifying the
resource-name
quite a few places. In general would u consider that to be a bad practice then ? Also tagging a colleague @gifted-vase-28337
l

little-cartoon-10569

01/12/2021, 8:01 PM
Yes, I think so. Give Pulumi the broadest scope to "do its thing", including naming. https://www.pulumi.com/docs/intro/concepts/programming-model/#autonaming
g

gentle-account-13294

01/12/2021, 10:11 PM
Thank you !! that helps !!
As a follow up to above suggestion, is there a way to provide a custom prefix for
resource-name
?
l

little-cartoon-10569

01/12/2021, 11:34 PM
Depends on the resource. Many resources have a
namePrefix
input.
Which resource are you looking at?
Looks like
subnet
doesn't have a name or namePrefix, just tags... šŸ˜ž
But resources including IAM Roles, RDS SubnetGroups and ALB TargetGroups all support namePrefix.
āœ… 1