{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "PrivateRouteTableUSWEST2A": {
            "Type": "AWS::EC2::RouteTable",
            "Properties": {
                "Tags": [
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/PrivateRouteTableUSWEST2A"
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "PrivateRouteTableUSWEST2B": {
            "Type": "AWS::EC2::RouteTable",
            "Properties": {
                "Tags": [
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/PrivateRouteTableUSWEST2B"
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "PrivateRouteTableUSWEST2C": {
            "Type": "AWS::EC2::RouteTable",
            "Properties": {
                "Tags": [
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/PrivateRouteTableUSWEST2C"
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "PrivateRouteTableUSWEST2D": {
            "Type": "AWS::EC2::RouteTable",
            "Properties": {
                "Tags": [
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/PrivateRouteTableUSWEST2D"
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "RouteTableAssociationPrivateUSWEST2A": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "RouteTableId": {
                    "Ref": "PrivateRouteTableUSWEST2A"
                },
                "SubnetId": {
                    "Ref": "SubnetPrivateUSWEST2A"
                }
            }
        },
        "RouteTableAssociationPrivateUSWEST2B": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "RouteTableId": {
                    "Ref": "PrivateRouteTableUSWEST2B"
                },
                "SubnetId": {
                    "Ref": "SubnetPrivateUSWEST2B"
                }
            }
        },
        "RouteTableAssociationPrivateUSWEST2C": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "RouteTableId": {
                    "Ref": "PrivateRouteTableUSWEST2C"
                },
                "SubnetId": {
                    "Ref": "SubnetPrivateUSWEST2C"
                }
            }
        },
        "RouteTableAssociationPrivateUSWEST2D": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "RouteTableId": {
                    "Ref": "PrivateRouteTableUSWEST2D"
                },
                "SubnetId": {
                    "Ref": "SubnetPrivateUSWEST2D"
                }
            }
        },
        "SubnetPrivateUSWEST2A": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "AvailabilityZone": "us-west-2a",
                "CidrBlock": "192.168.128.0/19",
                "Tags": [
                    {
                        "Key": "kubernetes.io/role/internal-elb",
                        "Value": "1"
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/SubnetPrivateUSWEST2A"
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "SubnetPrivateUSWEST2B": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "AvailabilityZone": "us-west-2b",
                "CidrBlock": "192.168.160.0/19",
                "Tags": [
                    {
                        "Key": "kubernetes.io/role/internal-elb",
                        "Value": "1"
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/SubnetPrivateUSWEST2B"
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "SubnetPrivateUSWEST2C": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "AvailabilityZone": "us-west-2c",
                "CidrBlock": "192.168.192.0/19",
                "Tags": [
                    {
                        "Key": "kubernetes.io/role/internal-elb",
                        "Value": "1"
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/SubnetPrivateUSWEST2C"
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "SubnetPrivateUSWEST2D": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "AvailabilityZone": "us-west-2d",
                "CidrBlock": "192.168.224.0/19",
                "Tags": [
                    {
                        "Key": "kubernetes.io/role/internal-elb",
                        "Value": "1"
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/SubnetPrivateUSWEST2D"
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "VPC": {
            "Type": "AWS::EC2::VPC",
            "Properties": {
                "CidrBlock": "192.168.0.0/16",
                "EnableDnsHostnames": true,
                "EnableDnsSupport": true,
                "Tags": [
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Sub": "${AWS::StackName}/VPC"
                        }
                    }
                ]
            }
        },
        "VPCEndpointEC2": {
            "Type": "AWS::EC2::VPCEndpoint",
            "Properties": {
                "PrivateDnsEnabled": true,
                "SecurityGroupIds": [
                    "sg-test"
                ],
                "ServiceName": "com.amazonaws.us-west-2.ec2",
                "SubnetIds": [
                    {
                        "Ref": "SubnetPrivateUSWEST2A"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2B"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2C"
                    }
                ],
                "VpcEndpointType": "Interface",
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "VPCEndpointECRAPI": {
            "Type": "AWS::EC2::VPCEndpoint",
            "Properties": {
                "PrivateDnsEnabled": true,
                "SecurityGroupIds": [
                    "sg-test"
                ],
                "ServiceName": "com.amazonaws.us-west-2.ecr.api",
                "SubnetIds": [
                    {
                        "Ref": "SubnetPrivateUSWEST2A"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2B"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2C"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2D"
                    }
                ],
                "VpcEndpointType": "Interface",
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "VPCEndpointECRDKR": {
            "Type": "AWS::EC2::VPCEndpoint",
            "Properties": {
                "PrivateDnsEnabled": true,
                "SecurityGroupIds": [
                    "sg-test"
                ],
                "ServiceName": "com.amazonaws.us-west-2.ecr.dkr",
                "SubnetIds": [
                    {
                        "Ref": "SubnetPrivateUSWEST2A"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2B"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2C"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2D"
                    }
                ],
                "VpcEndpointType": "Interface",
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "VPCEndpointS3": {
            "Type": "AWS::EC2::VPCEndpoint",
            "Properties": {
                "RouteTableIds": [
                    {
                        "Ref": "PrivateRouteTableUSWEST2A"
                    },
                    {
                        "Ref": "PrivateRouteTableUSWEST2B"
                    },
                    {
                        "Ref": "PrivateRouteTableUSWEST2C"
                    },
                    {
                        "Ref": "PrivateRouteTableUSWEST2D"
                    }
                ],
                "ServiceName": "com.amazonaws.us-west-2.s3",
                "VpcEndpointType": "Gateway",
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "VPCEndpointSTS": {
            "Type": "AWS::EC2::VPCEndpoint",
            "Properties": {
                "PrivateDnsEnabled": true,
                "SecurityGroupIds": [
                    "sg-test"
                ],
                "ServiceName": "com.amazonaws.us-west-2.sts",
                "SubnetIds": [
                    {
                        "Ref": "SubnetPrivateUSWEST2A"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2B"
                    },
                    {
                        "Ref": "SubnetPrivateUSWEST2C"
                    }
                ],
                "VpcEndpointType": "Interface",
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        }
    }
}
