I’m getting an error with: AWS Subnet update which...
# aws
g
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
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
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
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
Thank you !! that helps !!
As a follow up to above suggestion, is there a way to provide a custom prefix for
resource-name
?
l
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