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

stale-answer-34162

10/26/2023, 2:53 PM
I am getting blocked by a ghost resource in pulumi.
Copy code
error: Duplicate resource URN 'urn:pulumi:testeks::testeks::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::eks-vpc-private-1'; try giving it a unique name
it turns out it doesn't like my idea of duplicating the subnet type names here for an eks cluster, is this approach naive? is there a better way?
Copy code
// Create a VPC. availability zones to which the subnets defaults to the first 3 AZs in the current region.
let vpc = new awsx.ec2.Vpc('eks-vpc', {
  cidrBlock: "10.0.0.0/16",
  subnetSpecs: [
    { type: "Public", cidrMask: 20 },
  //  { type: "Public", cidrMask: 20 },
    { type: "Private", cidrMask: 20 },
 //   { type: "Private", cidrMask: 20 },
],
});
s

stocky-restaurant-98004

10/26/2023, 10:31 PM
Did you create the VPC and then attempt to change the
subnetSpecs
? If so, and if it's practical, just tear it down and start over. You're also probably better off with the default options here since you probably want a smaller public subnet than private.