Previewing update (dev)
View Live: https://app.pulumi.com/jkodroff/awsx-subnet-resize/dev/previews/80f1d146-f2aa-4ecd-97ef-17fb0d035d88
Type Name Plan Info
+ pulumi:pulumi:Stack awsx-subnet-resize-dev create 1 error
+ └─ awsx:ec2:Vpc my-vpc create
+ └─ aws:ec2:Vpc my-vpc create
+ ├─ aws:ec2:Subnet my-vpc-isolated-2 create 1 error
+ └─ aws:ec2:Subnet my-vpc-isolated-3 create
Diagnostics:
aws:ec2:Subnet (my-vpc-isolated-2):
error: Duplicate resource URN 'urn:pulumi:dev::awsx-subnet-resize::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::my-vpc-isolated-2'; try giving it a unique name
pulumi:pulumi:Stack (awsx-subnet-resize-dev):
error: Resource monitor has terminated, shutting down
It would be reasonable IMO to close this as "by design", but it might be better to either attempt to auto-name the subnet resources better or to provide an immediate validation error.
Thinking about this some more, it might be a better design to do subnets as a map rather than an array. Make the name (the key) required, and make the key subnetSpec minus the name. Just an idea.
If we create multiple instances of the same subnet type (public, private, isolated) without specifying a name, we get an exception.
The following program:
Results in the following error:
It would be reasonable IMO to close this as "by design", but it might be better to either attempt to auto-name the subnet resources better or to provide an immediate validation error.