This message was deleted.
s
This message was deleted.
l
Ouch. Nope. Can you create a new subnet and mark it as default?
c
I can't
There's no option for that in the pulumi resource, and it looks like terraform doesn't support it directly either, but they instead choose to rely on an internal mechanism for it.
Read that there
s
Once you delete the default vpc its gone, you cannot recreate. You can switch regions if you deleted one in a different region
k
You should be able to just create a new vpc and deploy to that
I regularly delete the default vpc (as I don't want anything deployed to "default") 🙂
Copy code
// VPC
const vpc = new aws.ec2.Vpc("vpc", {
  cidrBlock: vpc_cidr,
  enableDnsSupport: true,
  enableDnsHostnames: true,
  tags: {
    ...project_tags,
    Name: `${namePrefixUpper}-VPC`,
    type: "network-infrastructure",
  },
});
Copy code
// RDS subnet group
const rds_subnet_group = new aws.rds.SubnetGroup("rds_subnet_group", {
  name: `${project_clean}-rds-subnet-group`,
  subnetIds: [
    private_subnet_az1.id,
    private_subnet_az2.id,
  ],
});
Copy code
//RDS cluster
const rds_cluster = new aws.rds.Cluster("rds_cluster", {
...
  dbSubnetGroupName: rds_subnet_group.name,
...
});
roughly 🙂