Skip to main content
skill CX Codex

launching-ec2-instance-with-best-practices — Claude Code skill

This skill launches EC2 instances with security and cost controls in place. Use it when deploying a new AWS instance and checking its setup after launch.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aws/agent-toolkit-for-aws --skill launching-ec2-instance-with-best-practices -a claude-code
Open on GitHub

What launching-ec2-instance-with-best-practices does

The skill guides an EC2 launch from AMI and instance type selection through post-launch checks. It considers workload and environment, validates the VPC, subnet, and public or private placement, then checks AMI and architecture compatibility.

The procedure covers least-privilege IAM roles, security groups with limited port exposure, encrypted gp3 storage, and tags for cost tracking. It also provides connection instructions after launch. Because the AMI must match the instance type, check the architecture before starting the instance.

For capacity errors, the procedure suggests another Availability Zone or instance type. SSH troubleshooting includes checking access from your IP, 400 permissions on the key file, and the instance state; AWS Systems Manager Session Manager is offered as an alternative. Console output can be retrieved with aws ec2 get-console-output.

What it helps with

  • launch an EC2 instance with security defaults
  • choose a compatible AMI and instance type
  • create least-privilege IAM roles
  • limit inbound ports with a security group
  • encrypt gp3 storage and add cost tags

Example prompts for the agent

  • Launch a new EC2 instance for this environment and choose a compatible AMI and instance type.
  • Validate the VPC, subnet, and public or private placement before launching the EC2 instance.
  • After launch, verify the instance and prepare SSH connection instructions.

How to install launching-ec2-instance-with-best-practices

1Skills CLI (Vercel)

npx skills add aws/agent-toolkit-for-aws --skill launching-ec2-instance-with-best-practices -a claude-code

2Manually: put the files in place

~/.claude/skills/launching-ec2-instance-with-best-practices/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/launching-ec2-instance-with-best-practices/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about launching-ec2-instance-with-best-practices

How do I install launching-ec2-instance-with-best-practices in Claude Code?

Run npx skills add aws/agent-toolkit-for-aws --skill launching-ec2-instance-with-best-practices -a claude-code, then run the same command again. Open ~/.claude/skills/launching-ec2-instance-with-best-practices/SKILL.md afterward.

What does launching-ec2-instance-with-best-practices do?

The skill guides an EC2 launch with AMI selection, network checks, IAM setup, security group hardening, encrypted gp3 storage, and tagging. It also verifies the instance after launch and provides connection guidance.

What should I check when SSH access to EC2 fails?

Check that the security group allows SSH from your IP, the key file has 400 permissions, and the instance is running. AWS Systems Manager Session Manager is another connection option.

Source text

SKILL.md · Apache-2.0
---
name: launching-ec2-instance-with-best-practices
description: Launches an EC2 instance with secure, cost-efficient defaults including AMI selection, burstable instance sizing, least-privilege IAM roles, hardened security groups, encrypted EBS volumes, and comprehensive tagging. Use when deploying new EC2 instances following AWS best practices for security and cost optimization.
version: 1
---

# Launching EC2 Instances with Best Practices

## Overview

Domain expertise for launching EC2 instances with sensible defaults optimized for security, cost-efficiency, and operational best practices. Covers AMI selection, instance type recommendation, network configuration, IAM role creation, security group hardening, storage configuration, tagging strategy, and post-launch verification.

## Launch an EC2 instance

To launch a fully configured EC2 instance with best-practice defaults, follow the procedure exactly.
See [EC2 instance launch procedure](references/launch-ec2-instance-with-best-practices.md).

The procedure handles:

- Intelligent defaults based on workload type and environment
- Network validation (VPC, subnet, public/private placement)
- AMI selection with architecture compatibility checks
- Least-privilege IAM roles for required AWS service access
- Hardened security groups with minimal port exposure
- Encrypted gp3 storage with environment-appropriate retention
- Comprehensive tagging for cost tracking and organization
- Post-launch verification and connection instructions

## Troubleshooting

### Insufficient instance capacity

Try a different availability zone or instance type (e.g., t3a instead of t3). See the full troubleshooting guide in the [launch procedure](references/launch-ec2-instance-with-best-practices.md).

### Instance immediately terminates

Check console output with `aws ec2 get-console-output`. Verify EBS volume size is sufficient and AMI is compatible with the instance type.

### Cannot connect via SSH

Verify the security group allows SSH from your IP, key file permissions are `400`, and the instance is running. Consider AWS Systems Manager Session Manager as an alternative.

© aws · Apache-2.0 · aws/agent-toolkit-for-aws

Similar skills

Everything for Cloud: AWS, Azure, GCP →

From the same set133

connecting-lambda-to-api-gateway A skill that walks the agent through wiring an existing Lambda function into Amazon API Gateway: resources, methods, proxy integration, permissions and deploy. CX Codex +1 6,600installs troubleshooting-application-failures A skill that traces application failures through CloudWatch logs: it locates log groups, pulls error patterns and stack traces, then ranks fixes by priority. CX Codex +1 6,400installs connecting-lambda-to-dynamodb Connects AWS Lambda functions to DynamoDB tables. Guides IAM execution roles, DynamoDB stream event mappings, and troubleshooting. CX Codex +1 6,500installs troubleshooting-s3-files Diagnoses Amazon S3 Files issues, from mount timeouts and IAM permission errors to sync delays and file conflicts. CX Codex +1 6,300installs setting-up-cloudwatch-alarm-notifications Wires CloudWatch alarms to notification channels through SNS: encrypted topics, subscriptions, access policies and alarm actions. CX Codex +1 6,300installs debugging-lambda-timeouts Investigates AWS Lambda timeout failures by inspecting CloudWatch logs, metrics, and configurations. Use it when function runs hit or approach execution limits. CX Codex +1 6,400installs configuring-vpc-endpoints-for-private-aws-service-access A skill that walks the agent through VPC endpoint setup with AWS PrivateLink, so AWS services stay reachable without an internet gateway or public IPs. CX Codex +1 6,400installs setting-up-ec2-instance-profiles Configures EC2 instance profiles and IAM roles so applications call AWS services without hardcoded credentials. Useful when an instance needs temporary access to S3, DynamoDB, or SQS. CX Codex +1 6,200installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor