home / skills / shipshitdev / library / aws-infrastructure

This skill helps you design and deploy AWS infrastructure including VPCs, EC2, ALB, Route53, and ACM with best practices.

npx playbooks add skill shipshitdev/library --skill aws-infrastructure

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
3.8 KB
---
name: aws-infrastructure
description: Expert in AWS infrastructure setup including EC2, VPC, security groups, Application Load Balancers, Route53 DNS, and SSL/TLS certificates. Use this skill for AWS infrastructure configuration and deployment.
---

# AWS Infrastructure Expert

## Overview

This skill enables AI assistants to help set up and configure AWS infrastructure for micro startups, including EC2 instances, VPCs, security groups, load balancers, DNS, and SSL certificates.

## When to Use This Skill

This skill activates when users need:

- EC2 instance setup and configuration
- VPC and networking setup
- Security group configuration
- Application Load Balancer setup
- Route53 DNS configuration
- SSL/TLS certificate management (ACM)
- Auto-scaling groups
- CloudWatch monitoring

## EC2 Setup

### Instance Types

- **Development:** t3.medium (2 vCPU, 4GB RAM)
- **Production (small):** t3.large (2 vCPU, 8GB RAM)
- **Production (medium):** m5.large (2 vCPU, 8GB RAM)

### Storage

- Use gp3 SSD volumes
- Development: 20GB minimum
- Production: 100GB+ based on needs
- Enable EBS snapshots for backups

### Key Pairs

- Generate or import SSH key pairs
- Store private keys securely
- Use IAM roles instead of access keys when possible

## VPC Configuration

### Basic Setup

- Create VPC with CIDR block (e.g., 10.0.0.0/16)
- Create public and private subnets
- Set up Internet Gateway
- Configure route tables
- Set up NAT Gateway for private subnets (if needed)

### Subnets

- Public subnets: For load balancers, bastion hosts
- Private subnets: For application servers, databases
- Multi-AZ for high availability

## Security Groups

### Application Security Group

```
Inbound:
- HTTP (80) from ALB security group
- HTTPS (443) from ALB security group
- SSH (22) from bastion/your IP only

Outbound:
- All traffic (0.0.0.0/0)
```

### Database Security Group

```
Inbound:
- MongoDB (27017) from application security group only
- Redis (6379) from application security group only
- SSH (22) from bastion/your IP only

Outbound:
- All traffic (0.0.0.0/0)
```

### Load Balancer Security Group

```
Inbound:
- HTTP (80) from 0.0.0.0/0
- HTTPS (443) from 0.0.0.0/0

Outbound:
- HTTP (80) to application security group
- HTTPS (443) to application security group
```

## Application Load Balancer

### Setup

1. Create ALB in public subnets
2. Configure target groups (EC2 instances)
3. Set up health checks
4. Configure listeners (HTTP → HTTPS redirect)
5. Attach SSL certificate from ACM

### Health Checks

- Path: `/health` or `/api/health`
- Protocol: HTTP
- Port: 3001 (backend) or 3000 (frontend)
- Healthy threshold: 2
- Unhealthy threshold: 2
- Timeout: 5 seconds
- Interval: 30 seconds

## Route53 DNS

### Domain Setup

1. Create hosted zone for domain
2. Create A record (alias) pointing to ALB
3. Create CNAME for www subdomain
4. Update nameservers at domain registrar

### SSL/TLS (ACM)

1. Request certificate in ACM (us-east-1 for CloudFront/ALB)
2. Validate via DNS (add CNAME records)
3. Attach certificate to ALB listener
4. Certificate auto-renews

## CloudWatch Monitoring

### Metrics

- EC2: CPU, Memory, Disk, Network
- ALB: Request count, Target response time, HTTP errors
- Custom metrics for application-specific data

### Alarms

- High CPU utilization
- Low disk space
- Application errors (via CloudWatch Logs)
- Unhealthy target instances

## Best Practices

- Use IAM roles instead of access keys
- Enable CloudTrail for audit logging
- Use VPC endpoints for AWS service access
- Implement least privilege security groups
- Use private subnets for databases
- Enable encryption at rest for EBS volumes
- Set up automated backups (EBS snapshots)
- Monitor costs with AWS Cost Explorer

## Integration

This skill integrates with `/db-setup` for MongoDB on EC2 and `/deploy` for deployment workflows.

Overview

This skill helps configure and deploy AWS infrastructure for small teams and micro-startups. It focuses on EC2 instances, VPC networking, security groups, Application Load Balancers, Route53 DNS, and ACM SSL/TLS certificates. Use it to build resilient, secure, and scalable environments with sensible defaults and AWS best practices.

How this skill works

The skill provides guided configuration patterns and recommended defaults for EC2 sizing, storage, and key management, then lays out network topology with public and private subnets, NAT gateways, and route tables. It defines security group rules for application, database, and load balancer tiers, configures ALB listeners and health checks, and automates DNS and certificate setup in Route53 and ACM. It also covers CloudWatch metrics and alarms and recommends IAM and backup practices.

When to use it

  • Deploying a web application with EC2 instances behind an Application Load Balancer
  • Designing VPCs with public and private subnets, NAT, and multi-AZ availability
  • Configuring security groups for application and database tiers with least privilege
  • Setting up Route53 DNS and attaching ACM certificates to an ALB
  • Enabling monitoring and alarms for EC2, ALB, and custom application metrics

Best practices

  • Prefer IAM roles over long-lived access keys for EC2 and automation
  • Keep databases in private subnets and restrict access via security groups
  • Use gp3 EBS volumes and enable regular snapshots for backups
  • Request ACM certificates and validate via DNS; attach to ALB listeners
  • Enable CloudTrail, CloudWatch alarms, and VPC endpoints for security and observability

Example use cases

  • Launch a production web tier: ALB in public subnets, EC2 auto-scaling in private subnets, and Route53 alias records
  • Create a development environment with smaller EC2 types and 20GB gp3 volumes
  • Configure secure database access: DB SG allowing only app SG traffic on MongoDB/Redis ports
  • Add HTTPS: request ACM certificate, validate DNS, and configure ALB HTTPS listener with HTTP→HTTPS redirect
  • Implement monitoring: CloudWatch dashboards for EC2 CPU, ALB error rates, and alarms for unhealthy targets

FAQ

Which region should I request ACM certificates in?

Request certificates in the region where your load balancer or CloudFront distribution requires them; for CloudFront use us-east-1.

How should I secure SSH access to instances?

Use a bastion host in a public subnet, restrict SSH to your IP via the bastion SG, and prefer SSH key pairs and IAM roles instead of embedding credentials.