Hi! Does anyone have any idea on how I can clean t...
# aws
c
Hi! Does anyone have any idea on how I can clean this up? This happens during a
pulumi destroy
. Do I have to resolve things manually in the AWS Console (e.g. by mapping the VPC to a different route table, or something)?
Copy code
aws:ec2:RouteTable (development-vpc-route-table-public):
    error: deleting urn:pulumi:development::playground-infrastructure::aws:ec2/routeTable:RouteTable::development-vpc-route-table-public: 1 error occurred:
        * InvalidParameterValue: cannot disassociate the main route table association rtbassoc-035832433d2a099be
        status code: 400, request id: c0f480d9-abe5-472d-96f2-27c71a837aff
b
you will unfortunately, yes. Do you know where this route table came from? generally you'll need to set up your own route table in the Pulumi state to avoid this
c
Got it, thanks. Pretty sure this route table in fact is defined in Pulumi, which I've assigned to the VPC using a
MainRouteTableAssociation
. Not sure what's gone wrong here...
b
any chance you can share some code?
c
Yeah, nothing too fancy in this part 🤷
Copy code
var vpcRouteTable = new RouteTable($"{stack}-vpc-route-table-public", new RouteTableArgs
            {
                VpcId = vpc.Id,
                Routes = new []
                {
                    new RouteTableRouteArgs
                    {
                        CidrBlock = "0.0.0.0/0",
                        GatewayId = igw.Id,
                    }
                }
            });

            var vpcRouteTableAssociation = new MainRouteTableAssociation($"{stack}-vpc-route-table-association",
                new MainRouteTableAssociationArgs
                {
                    VpcId = vpc.Id,
                    RouteTableId = vpcRouteTable.Id
                });
b
When I create VPCs, I generally never use the main route table association because it creates some weird dependency/ordering issues which it seems like you're seeing
c
Thanks again, I will steer away from it going forward 😄