Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides AWS CloudFormation patterns for VPC foundations, including subnets, route tables, internet and NAT gateways, endpoints, and reusable outputs. Use when creating a new network baseline, segmenting public and private workloads, or preparing CloudFormation networking stacks for application deployments.
.claude/skills/giuseppe-trisciuoglio-aws-cloudformation-vpc/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 132% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 93% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 91% | 0% |
Build a VPC foundation with CloudFormation that stays readable, reusable, and safe to evolve. Provides a clear subnet and routing model with predictable connectivity for public and private workloads, plus outputs that downstream stacks can consume without duplicating network logic.
Use the references/ files for larger templates and extended service combinations.
Before writing resources, define:
This prevents route-table sprawl and painful subnet replacement later.
Create the stack in this order:
Keep each layer easy to inspect in the template and avoid mixing unrelated application resources into the same stack.
Useful parameters include:
Do not parameterize every route or tag unless it meaningfully changes between environments.
Typical outputs:
Stable outputs make application stacks easier to compose and migrate.
Run these commands to validate the template and verify routing:
bash# Validate CloudFormation template syntax aws cloudformation validate-template --template-body file://vpc.yaml # Review change set before applying aws cloudformation create-change-set \ --stack-name my-vpc \ --template-body file://vpc.yaml \ --change-set-type CREATE # Verify route table associations aws ec2 describe-route-tables \ --filters "Name=vpc-id,Values=<vpc-id>" # Check subnet to route table mappings aws ec2 describe-route-tables \ --filters "Name=association.subnet-id,Values=<subnet-id>" # Verify internet gateway attachment aws ec2 describe-internet-gateways \ --filters "Name=attachment.vpc-id,Values=<vpc-id>"
This template creates a VPC with public and private subnets, internet gateway, NAT gateway, and properly configured route tables.
yamlAWSTemplateFormatVersion: "2010-09-09" Description: "Two-tier VPC with public and private subnets" Resources: # VPC MainVpc: Type: AWS::EC2::VPC Properties: CidrBlock: 10.0.0.0/16 EnableDnsHostnames: true EnableDnsSupport: true Tags: - Key: Name Value: !Sub "${AWS::StackName}-main" # Internet Gateway InternetGateway: Type: AWS::EC2::InternetGateway Properties: Tags: - Key: Name Value: !Sub "${AWS::StackName}-igw" # Attach IGW to VPC GatewayToInternet: Type: AWS::EC2::VPCGatewayAttachment Properties: VpcId: !Ref MainVpc InternetGatewayId: !Ref InternetGateway # Public Subnet (AZ 1) PublicSubnetA: Type: AWS::EC2::Subnet Properties: VpcId: !Ref MainVpc CidrBlock: 10.0.1.0/24 AvailabilityZone: !Select [0, !GetAZs ""] MapPublicIpOnLaunch: true Tags: - Key: Name Value: !Sub "${AWS::StackName}-public-a" # Private Subnet (AZ 1) PrivateSubnetA: Type: AWS::EC2::Subnet Properties: VpcId: !Ref MainVpc CidrBlock: 10.0.11.0/24 AvailabilityZone: !Select [0, !GetAZs ""] Tags: - Key: Name Value: !Sub "${AWS::StackName}-private-a" # Elastic IP for NAT Gateway NatEip: Type: AWS::EC2::EIP DependsOn: GatewayToInternet Properties: Domain: vpc # NAT Gateway NatGateway: Type: AWS::EC2::NatGateway Properties: SubnetId: !Ref PublicSubnetA AllocationId: !GetAtt NatEip.AllocationId # Public Route Table PublicRouteTable: Type: AWS::EC2::RouteTable Properties: VpcId: !Ref MainVpc Tags: - Key: Name Value: !Sub "${AWS::StackName}-public-rt" # Default route to IGW PublicDefaultRoute: Type: AWS::EC2::Route DependsOn: GatewayToInternet Properties: RouteTableId: !Ref PublicRouteTable DestinationCidrBlock: 0.0.0.0/0 GatewayId: !Ref InternetGateway # Associate public subnet PublicSubnetARouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: SubnetId: !Ref PublicSubnetA RouteTableId: !Ref PublicRouteTable # Private Route Table PrivateRouteTable: Type: AWS::EC2::RouteTable Properties: VpcId: !Ref MainVpc Tags: - Key: Name Value: !Sub "${AWS::StackName}-private-rt" # Default route via NAT Gateway PrivateDefaultRoute: Type: AWS::EC2::Route Properties: RouteTableId: !Ref PrivateRouteTable DestinationCidrBlock: 0.0.0.0/0 NatGatewayId: !Ref NatGateway # Associate private subnet PrivateSubnetARouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: SubnetId: !Ref PrivateSubnetA RouteTableId: !Ref PrivateRouteTable Outputs: VpcId: Description: VPC ID Value: !Ref MainVpc Export: Name: !Sub "${AWS::StackName}-VpcId" PublicSubnetA: Description: Public subnet AZ1 Value: !Ref PublicSubnetA Export: Name: !Sub "${AWS::StackName}-PublicSubnetA" PrivateSubnetA: Description: Private subnet AZ1 Value: !Ref PrivateSubnetA Export: Name: !Sub "${AWS::StackName}-PrivateSubnetA" PublicRouteTableId: Description: Public route table ID Value: !Ref PublicRouteTable Export: Name: !Sub "${AWS::StackName}-PublicRouteTableId" PrivateRouteTableId: Description: Private route table ID Value: !Ref PrivateRouteTable Export: Name: !Sub "${AWS::StackName}-PrivateRouteTableId"
yamlResources: # S3 VPC Endpoint S3Endpoint: Type: AWS::EC2::VPCEndpoint Properties: VpcId: !Ref MainVpc ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" RouteTableIds: - !Ref PrivateRouteTable VpcEndpointType: Gateway
references/examples.mdreferences/examples.mdreferences/reference.md| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | pass→pass | 8,041 | 6,241 | -22% | 1 | 1 | 0% | 1,412 | 3,271 | +132% | 0 | 0 | — |
case-04 | fail→pass | 14,124 | 10,109 | -28% | 1 | 1 | 0% | 2,413 | 3,907 | +62% | 0 | 0 | — |
case-05 | pass→pass | 10,391 | 8,730 | -16% | 1 | 1 | 0% | 1,987 | 3,838 | +93% | 0 | 0 | — |
case-01 | fail→pass | 17,324 | 12,912 | -25% | 1 | 1 | 0% | 2,959 | 4,345 | +47% | 0 | 0 | — |
case-02 | pass→pass | 17,933 | 16,631 | -7% | 1 | 1 | 0% | 3,054 | 5,847 | +91% | 0 | 0 | — |
case-06 | pass→pass | 8,640 | 7,267 | -16% | 1 | 1 | 0% | 1,729 | 3,702 | +114% | 0 | 0 | — |
case-07 | pass→pass | 13,253 | 11,814 | -11% | 1 | 1 | 0% | 2,225 | 4,186 | +88% | 0 | 0 | — |
case-08 | pass→pass | 17,875 | 12,636 | -29% | 1 | 1 | 0% | 3,240 | 4,367 | +35% | 0 | 0 | — |
case-09 | pass→pass | 16,292 | 8,314 | -49% | 1 | 1 | 0% | 2,671 | 3,516 | +32% | 0 | 0 | — |
case-10 | pass→pass | 9,528 | 9,070 | -5% | 1 | 1 | 0% | 1,574 | 3,860 | +145% | 0 | 0 | — |
case-11 | pass→pass | 11,228 | 7,874 | -30% | 1 | 1 | 0% | 1,931 | 3,560 | +84% | 0 | 0 | — |
case-12 | pass→pass | 3,142 | 2,608 | -17% | 1 | 1 | 0% | 424 | 2,584 | +509% | 0 | 0 | — |
case-13 | pass→pass | 6,878 | 4,642 | -33% | 1 | 1 | 0% | 1,204 | 2,951 | +145% | 0 | 0 | — |
case-14 | pass→pass | 3,687 | 2,860 | -22% | 1 | 1 | 0% | 602 | 2,587 | +330% | 0 | 0 | — |
case-15 | pass→pass | 5,031 | 5,188 | +3% | 1 | 1 | 0% | 914 | 3,156 | +245% | 0 | 0 | — |
case-16 | pass→pass | 11,139 | 11,277 | +1% | 1 | 1 | 0% | 1,934 | 4,299 | +122% | 0 | 0 | — |
case-17 | pass→pass | 14,738 | 12,247 | -17% | 1 | 1 | 0% | 2,622 | 4,487 | +71% | 0 | 0 | — |
case-18 | pass→pass | 2,034 | 2,359 | +16% | 1 | 1 | 0% | 353 | 2,542 | +620% | 0 | 0 | — |
case-19 | pass→pass | 16,515 | 11,579 | -30% | 1 | 1 | 0% | 2,419 | 3,893 | +61% | 0 | 0 | — |
case-20 | fail→fail | 18,121 | 6,508 | -64% | 1 | 1 | 0% | 1,784 | 3,418 | +92% | 0 | 0 | — |
case-21 | fail→fail | 10,186 | 12,917 | +27% | 1 | 1 | 0% | 2,013 | 4,740 | +135% | 0 | 0 | — |
case-22 | fail→fail | 4,941 | 6,343 | +28% | 1 | 1 | 0% | 969 | 3,453 | +256% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.