launching-ec2-instance-with-best-practices
aws/agent-toolkit-for-aws
Launch EC2 instances with secure, cost-efficient defaults including IAM roles, encrypted storage, and hardened security groups.
What is launching-ec2-instance-with-best-practices?
This skill automates EC2 instance deployment following AWS best practices for security and cost optimization. Use it when you need to provision new EC2 instances with sensible defaults for AMI selection, instance sizing, network configuration, and tagging.
- Selects appropriate AMIs with architecture compatibility checks
- Recommends burstable instance types optimized for cost
- Creates least-privilege IAM roles for required AWS service access
- Configures hardened security groups with minimal port exposure
- Provisions encrypted gp3 EBS volumes with environment-appropriate retention
- Applies comprehensive tagging for cost tracking and organization
How to install launching-ec2-instance-with-best-practices
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill launching-ec2-instance-with-best-practices- AWS account with appropriate IAM permissions to create EC2 instances, IAM roles, and security groups
- AWS CLI configured with valid credentials
- VPC and subnet already created or identified for instance placement
How to use launching-ec2-instance-with-best-practices
- 1.Specify your workload type and environment (development, staging, production)
- 2.Provide network configuration details (VPC, subnet, public/private placement preference)
- 3.Indicate required AWS service access needs for IAM role creation
- 4.Review and confirm the recommended instance type, AMI, and security group rules
- 5.Execute the launch procedure which creates all resources with best-practice defaults
- 6.Verify instance connectivity using the provided connection instructions or AWS Systems Manager Session Manager
Use cases
- Deploying new application servers with security and cost controls
- Launching development or staging environments with consistent configuration
- Provisioning instances for workloads requiring encrypted storage and IAM access
- Setting up instances with proper tagging for billing and resource organization
- Automating EC2 deployment while maintaining AWS security best practices
- DevOps engineers
- Cloud infrastructure teams
- AWS solution architects
- Development teams deploying to AWS
launching-ec2-instance-with-best-practices FAQ
The skill recommends burstable instance types (t3, t3a, t4g) optimized for cost-efficiency by default, with options to select different types based on workload requirements.
Yes, the skill creates hardened security groups with minimal port exposure by default, but you can specify additional ports or sources needed for your application.
The skill provides troubleshooting guidance to try different availability zones or alternative instance types (e.g., t3a instead of t3).
The skill provisions gp3 volumes with encryption enabled by default, with retention policies appropriate to your specified environment.
Verify the security group allows SSH from your IP, key file has 400 permissions, and the instance is running. Alternatively, use AWS Systems Manager Session Manager for connection.
Full instructions (SKILL.md)
Source of truth, from aws/agent-toolkit-for-aws.
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.
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.
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.
Related skills
More from aws/agent-toolkit-for-aws and the wider catalog.

managing-amazon-msk
Operate Amazon MSK Provisioned clusters (Standard and Express brokers) with performance, storage, and monitoring expertise.

migrate-to-msk
Migrate self-managed Apache Kafka to Amazon MSK Express with discovery, compatibility assessment, and load-testing.

migrating-to-amazon-redshift
Guide end-to-end Teradata-to-Amazon Redshift data-warehouse migration with schema, SQL, and stored-procedure conversion.

pentesting-with-aws-security-agent
Run AWS Security Agent penetration tests against live web applications to find runtime vulnerabilities.

processing-s3-uploads-with-step-functions
Route S3 uploads to Lambda or Fargate via Step Functions based on file size.

querying-aws-cloudwatch
Query CloudWatch Logs exported as SQL tables in S3 for network, security, and compliance analysis.