aws-cloudformation-vpc — Claude Code skill: VPC and routing patterns
aws-cloudformation-vpc is a Claude Code skill with CloudFormation templates for setting up VPC infrastructure on AWS.
MIT ★ 372 updated 2026-09-10
/plugin marketplace add giuseppe-trisciuoglio/developer-kit
/plugin install developer-kit-aws@developer-kitWhat aws-cloudformation-vpc does
The skill includes CloudFormation patterns for VPC foundations: public and private subnets across availability zones, internet gateways for inbound and outbound traffic, NAT gateways for private subnet egress, and VPC endpoints for private access to AWS services.
Templates are structured in layers: VPC and subnets first, then gateways, then route tables and associations. The skill guides address planning before resource creation, parameterizes only environment-dependent values (stack name, CIDR ranges, AZ count), and exports VPC ID, subnet IDs, and route table IDs for downstream stacks to consume.
Includes validation commands: aws cloudformation validate-template checks syntax, aws cloudformation create-change-set previews changes, and aws ec2 describe-route-tables and aws ec2 describe-internet-gateways verify connectivity after deployment.
What it helps with
- build a VPC with subnets and routing tables in CloudFormation
- deploy a network for public and private workloads
- configure internet ingress and NAT egress for private subnets
- export network parameters for use by other stacks
- create a reusable template for ECS, EKS, or Lambda
Example prompts for the agent
- Generate a VPC stack with two availability zones, public and private subnets, using CIDR 10.0.0.0/16
- Add VPC endpoints for S3 and DynamoDB in private subnets
- Export subnet and route table IDs so another stack can reference them
How to install aws-cloudformation-vpc
1Plugin marketplace
/plugin marketplace add giuseppe-trisciuoglio/developer-kit/plugin install developer-kit-aws@developer-kitThis installs the whole developer-kit-aws plugin with all its skills
2Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-cloudformation-vpc -a claude-code3Manually: put the files in place
~/.claude/skills/aws-cloudformation-vpc/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/aws-cloudformation-vpc/
1Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-cloudformation-vpc -a codex2Manually: put the files in place
.agents/skills/aws-cloudformation-vpc/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-cloudformation-vpc -a cursor2Manually: put the files in place
.cursor/skills/aws-cloudformation-vpc/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install giuseppe-trisciuoglio/developer-kit plugins/developer-kit-aws/skills/aws-cloudformation/aws-cloudformation-vpc2Manually: put the files in place
.github/skills/aws-cloudformation-vpc/SKILL.md1Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-cloudformation-vpc -a gemini-cli2Platform CLI
gemini skills install https://github.com/giuseppe-trisciuoglio/developer-kit --path plugins/developer-kit-aws/skills/aws-cloudformation/aws-cloudformation-vpcManually: put the files in place
.devin/skills/aws-cloudformation-vpc/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about aws-cloudformation-vpc
How do I install aws-cloudformation-vpc in Claude Code?
Run /plugin marketplace add giuseppe-trisciuoglio/developer-kit, then /plugin install developer-kit-aws@developer-kit, then npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-cloudformation-vpc -a claude-code. The skill will be available at ~/.claude/skills/aws-cloudformation-vpc/SKILL.md.
What does aws-cloudformation-vpc do?
It provides ready-made CloudFormation templates for VPC setup: public and private subnets, internet and NAT gateways, route tables, and exports for other stacks. Helps plan your address space and validate the network before deployment.
What resources are included in the skill?
VPC, subnets, internet gateways, NAT gateways, route tables, subnet associations, and validation commands. The example includes a complete two-tier stack with routing across zones.
Source text
SKILL.md · MIT
---
name: aws-cloudformation-vpc
description: 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.
allowed-tools: Read, Write, Bash
---
# AWS CloudFormation VPC Infrastructure
## Overview
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.
## When to Use
- Creating a new VPC stack for an application or shared platform
- Adding public and private subnets across one or more Availability Zones
- Wiring internet access, NAT egress, or private endpoints
- Exporting VPC, subnet, route table, and security-group-adjacent identifiers for other stacks
- Preparing reusable infrastructure for ECS, EKS, Lambda, EC2, or RDS stacks
## Instructions
### 1. Start with the address plan
Before writing resources, define:
- VPC CIDR range
- Number of Availability Zones
- Public, private, and isolated subnet ranges
- Which workloads need internet ingress, NAT egress, or only private AWS service access
This prevents route-table sprawl and painful subnet replacement later.
### 2. Build the core network resources in layers
Create the stack in this order:
1. VPC and subnets
2. Internet Gateway for public ingress and egress
3. NAT gateways if private subnets need outbound internet access
4. Route tables and subnet associations
5. Optional VPC endpoints for private access to AWS services
Keep each layer easy to inspect in the template and avoid mixing unrelated application resources into the same stack.
### 3. Parameterize only the environment-dependent values
Useful parameters include:
- Environment name
- VPC CIDR and subnet CIDRs
- Number of AZs or explicit subnet IDs in nested-stack scenarios
- Flags for optional endpoints or NAT layout
Do not parameterize every route or tag unless it meaningfully changes between environments.
### 4. Export only what consumers really need
Typical outputs:
- VPC ID
- Public, private, and isolated subnet IDs
- Route table IDs when downstream stacks must attach routes
- Security boundaries or prefix-list references only when another stack consumes them
Stable outputs make application stacks easier to compose and migrate.
### 5. Validate before deployment
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>"
```
## Examples
### Example 1: Complete two-tier VPC with routing
This template creates a VPC with public and private subnets, internet gateway, NAT gateway, and properly configured route tables.
```yaml
AWSTemplateFormatVersion: "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"
```
### Example 2: VPC endpoint for private S3 access
```yaml
Resources:
# S3 VPC Endpoint
S3Endpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
VpcId: !Ref MainVpc
ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3"
RouteTableIds:
- !Ref PrivateRouteTable
VpcEndpointType: Gateway
```
## Best Practices
- Keep public, private, and isolated subnet purposes explicit in names and tags
- Prefer one NAT gateway per AZ for resilient production environments when budget allows
- Use VPC endpoints to reduce unnecessary NAT traffic for AWS service access
- Export VPC and subnet identifiers from the network stack instead of recreating network assumptions elsewhere
- Review network changes with dependency stacks because route and subnet changes can have broad blast radius
- Keep the root skill focused and move larger networking variants to `references/examples.md`
## Constraints and Warnings
- NAT gateways incur hourly costs and data transfer charges—consider VPC endpoints for AWS service access
- CIDR overlap blocks peering, transit, and future network expansion
- Route-table or subnet replacements can interrupt traffic even when the template is valid
- Endpoint quotas, AZ availability, and service-specific subnet requirements vary by region
- Hardcoding Availability Zones can reduce portability across accounts and regions
## References
- `references/examples.md`
- `references/reference.md`
© Giuseppe Trisciuoglio · MIT · giuseppe-trisciuoglio/developer-kit