[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F3MT2WMXCHK7K360V2B6WY":3,"skill-same:01M6F3MT2WMXCHK7K360V2B6WY":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":31,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":62,"install":63,"resources":76},"01M6F3MT2WMXCHK7K360V2B6WY","aws-ec2",null,"Manage EC2 instances, AMIs, and auto-scaling groups. Configure security groups, key pairs, and instance types. Use when deploying compute resources on AWS.","boisenoise\u002Fskills-collections","boisenoise","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F193180?v=4","01M6CDBDQK6BDN55ZMA6B6PKBM","01M6CDBDVSJ3JPTBYN26FZ7TZK",13,"MIT","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-aws-ec2\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"aws","ec2","aws ec2","2026","license","when","relevant","types","Auto-Scaling","resources","critical","platform","scaling","main","instances","community","manage","configure security","agent-skills","only","auto","use","configure","access","devops-security","2026-11-10 10:12:30",false,"---\nname: aws-ec2\ndescription: Manage EC2 instances, AMIs, and auto-scaling groups. Configure security\n  groups, key pairs, and instance types. Use when deploying compute resources on AWS.\ncategory: devops\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\nsource_repo: BagelHole\u002FDevOps-Security-Agent-Skills\nsource_type: community\ndate_added: '2026-09-20'\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE\ncompatibility: Requires the relevant OS\u002Fplatform tooling and privileged access where\n  noted. Docs-only; helper scripts and templates not bundled.\nmetadata:\n  author: devops-skills\n  version: '1.0'\n---\n\n# AWS EC2\n\nDeploy and manage Amazon EC2 compute instances for production, staging, and development workloads.\n\n## When to Use This Skill\n\n- Launching new compute instances for application hosting\n- Building golden AMIs for consistent deployments\n- Setting up auto-scaling groups behind load balancers\n- Migrating workloads to Spot instances for cost savings\n- Troubleshooting instance connectivity, performance, or launch failures\n- Creating launch templates for repeatable infrastructure\n\n## Prerequisites\n\n- AWS CLI v2 installed and configured (`aws configure`)\n- Least-privilege IAM actions for selected compute, scaling and load-balancer resources; restrict iam:PassRole to the intended instance role\n- An existing VPC with subnets (see aws-vpc (`aws-vpc`))\n- SSH key pair created (`umask 077` before creating a key file in a private directory; prefer approved session access where appropriate)\n\n## Instance Type Selection Guide\n\n| Category | Types | Use Case |\n|---|---|---|\n| General Purpose | t3, t3a, m6i, m7g | Web servers, small databases, dev\u002Ftest |\n| Compute Optimized | c6i, c7g | Batch processing, media encoding, ML inference |\n| Memory Optimized | r6i, r7g, x2idn | In-memory caches, large databases |\n| Storage Optimized | i3, i4i, d3 | Data warehousing, distributed file systems |\n| Accelerated | p4d, g5, inf2 | ML training, GPU rendering, inference |\n| Burstable | t3.micro-t3.2xlarge | Low-steady-state with occasional bursts |\n\n## Launch an Instance\n\n```bash\n# Launch a production web server\naws ec2 run-instances \\\n  --image-id ami-0abcdef1234567890 \\\n  --instance-type t3.medium \\\n  --key-name my-key \\\n  --security-group-ids sg-12345678 \\\n  --subnet-id subnet-12345678 \\\n  --iam-instance-profile Name=EC2AppProfile \\\n  --metadata-options \"HttpTokens=required,HttpEndpoint=enabled\" \\\n  --block-device-mappings '[{\n    \"DeviceName\": \"\u002Fdev\u002Fxvda\",\n    \"Ebs\": {\n      \"VolumeSize\": 30,\n      \"VolumeType\": \"gp3\",\n      \"Iops\": 3000,\n      \"Throughput\": 125,\n      \"Encrypted\": true\n    }\n  }]' \\\n  --tag-specifications 'ResourceType=instance,Tags=[\n    {Key=Name,Value=web-server-01},\n    {Key=Environment,Value=production},\n    {Key=Team,Value=platform}\n  ]' \\\n  --user-data file:\u002F\u002Fuserdata.sh\n\n# Launch with IMDSv2 required (security best practice)\naws ec2 run-instances \\\n  --image-id ami-0abcdef1234567890 \\\n  --instance-type t3.micro \\\n  --metadata-options \"HttpTokens=required,HttpPutResponseHopLimit=1,HttpEndpoint=enabled\" \\\n  --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=secure-instance}]'\n```\n\n## User Data Scripts\n\n```bash\n#!\u002Fbin\u002Fbash\n# userdata.sh - Bootstrap a web server on Amazon Linux 2023\nset -euo pipefail # avoid tracing secrets in user-data logs\n\n# System updates\ndnf update -y\n\n# Install and start web server\ndnf install -y nginx\nsystemctl enable nginx\nsystemctl start nginx\n\n# Install CloudWatch agent\ndnf install -y amazon-cloudwatch-agent\n\u002Fopt\u002Faws\u002Famazon-cloudwatch-agent\u002Fbin\u002Famazon-cloudwatch-agent-ctl \\\n  -a fetch-config -m ec2 \\\n  -s -c ssm:AmazonCloudWatch-linux\n\n# Install CodeDeploy agent\ndnf install -y ruby wget\ncd \u002Fhome\u002Fec2-user\nwget https:\u002F\u002Faws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com\u002Flatest\u002Finstall\n# Verify a reviewed pinned installer and integrity before execution; do not run latest blindly.\n\n# Signal CloudFormation (if launched via CFN)\n# \u002Fopt\u002Faws\u002Fbin\u002Fcfn-signal -e $? --stack ${AWS::StackName} --resource ASG --region ${AWS::Region}\n```\n\n## Launch Templates\n\n```bash\n# Create a launch template with full configuration\naws ec2 create-launch-template \\\n  --launch-template-name web-server-template \\\n  --version-description \"v1 - AL2023 with nginx\" \\\n  --launch-template-data '{\n    \"ImageId\": \"ami-0abcdef1234567890\",\n    \"InstanceType\": \"t3.medium\",\n    \"KeyName\": \"my-key\",\n    \"SecurityGroupIds\": [\"sg-12345678\"],\n    \"IamInstanceProfile\": {\"Name\": \"EC2AppProfile\"},\n    \"MetadataOptions\": {\n      \"HttpTokens\": \"required\",\n      \"HttpEndpoint\": \"enabled\"\n    },\n    \"BlockDeviceMappings\": [{\n      \"DeviceName\": \"\u002Fdev\u002Fxvda\",\n      \"Ebs\": {\n        \"VolumeSize\": 30,\n        \"VolumeType\": \"gp3\",\n        \"Encrypted\": true\n      }\n    }],\n    \"TagSpecifications\": [{\n      \"ResourceType\": \"instance\",\n      \"Tags\": [\n        {\"Key\": \"Environment\", \"Value\": \"production\"},\n        {\"Key\": \"ManagedBy\", \"Value\": \"launch-template\"}\n      ]\n    }],\n    \"Monitoring\": {\"Enabled\": true},\n    \"UserData\": \"'\"$(base64 -w0 userdata.sh)\"'\"\n  }'\n\n# Create a new version of the launch template\naws ec2 create-launch-template-version \\\n  --launch-template-name web-server-template \\\n  --source-version 1 \\\n  --version-description \"v2 - updated AMI\" \\\n  --launch-template-data '{\"ImageId\": \"ami-0newami1234567890\"}'\n\n# Set the default version\naws ec2 modify-launch-template \\\n  --launch-template-name web-server-template \\\n  --default-version 2\n```\n\n## Auto Scaling Group\n\n```bash\n# Create ASG with mixed instances (on-demand + spot)\naws autoscaling create-auto-scaling-group \\\n  --auto-scaling-group-name web-asg \\\n  --mixed-instances-policy '{\n    \"LaunchTemplate\": {\n      \"LaunchTemplateSpecification\": {\n        \"LaunchTemplateName\": \"web-server-template\",\n        \"Version\": \"$Default\"\n      },\n      \"Overrides\": [\n        {\"InstanceType\": \"t3.medium\"},\n        {\"InstanceType\": \"t3a.medium\"},\n        {\"InstanceType\": \"m5.large\"}\n      ]\n    },\n    \"InstancesDistribution\": {\n      \"OnDemandBaseCapacity\": 2,\n      \"OnDemandPercentageAboveBaseCapacity\": 25,\n      \"SpotAllocationStrategy\": \"capacity-optimized\"\n    }\n  }' \\\n  --min-size 2 --max-size 10 --desired-capacity 4 \\\n  --vpc-zone-identifier \"subnet-aaa,subnet-bbb\" \\\n  --target-group-arns \"arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup\u002Fweb-tg\u002Fabc123\" \\\n  --health-check-type ELB \\\n  --health-check-grace-period 300 \\\n  --tags '[\n    {\"Key\":\"Name\",\"Value\":\"web-asg\",\"PropagateAtLaunch\":true},\n    {\"Key\":\"Environment\",\"Value\":\"production\",\"PropagateAtLaunch\":true}\n  ]'\n\n# Create target tracking scaling policy (target 60% CPU)\naws autoscaling put-scaling-policy \\\n  --auto-scaling-group-name web-asg \\\n  --policy-name cpu-target-tracking \\\n  --policy-type TargetTrackingScaling \\\n  --target-tracking-configuration '{\n    \"PredefinedMetricSpecification\": {\n      \"PredefinedMetricType\": \"ASGAverageCPUUtilization\"\n    },\n    \"TargetValue\": 60.0\n  }'\n\n# Create scheduled scaling for known traffic patterns\naws autoscaling put-scheduled-update-group-action \\\n  --auto-scaling-group-name web-asg \\\n  --scheduled-action-name scale-up-morning \\\n  --recurrence \"0 8 * * MON-FRI\" \\\n  --min-size 4 --max-size 20 --desired-capacity 8\n\naws autoscaling put-scheduled-update-group-action \\\n  --auto-scaling-group-name web-asg \\\n  --scheduled-action-name scale-down-evening \\\n  --recurrence \"0 20 * * MON-FRI\" \\\n  --min-size 2 --max-size 10 --desired-capacity 2\n```\n\n## Spot Instances\n\n```bash\n# Request Spot instances\naws ec2 request-spot-instances \\\n  --spot-price \"0.05\" \\\n  --instance-count 3 \\\n  --type \"one-time\" \\\n  --launch-specification '{\n    \"ImageId\": \"ami-0abcdef1234567890\",\n    \"InstanceType\": \"c5.xlarge\",\n    \"KeyName\": \"my-key\",\n    \"SecurityGroupIds\": [\"sg-12345678\"],\n    \"SubnetId\": \"subnet-12345678\"\n  }'\n\n# Check current Spot prices\naws ec2 describe-spot-price-history \\\n  --instance-types t3.medium t3a.medium m5.large \\\n  --availability-zone us-east-1a \\\n  --product-descriptions \"Linux\u002FUNIX\" \\\n  --start-time \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\" \\\n  --query \"SpotPriceHistory[].{Type:InstanceType,Price:SpotPrice,AZ:AvailabilityZone}\" \\\n  --output table\n\n# Create a Spot Fleet request\naws ec2 request-spot-fleet \\\n  --spot-fleet-request-config '{\n    \"IamFleetRole\": \"arn:aws:iam::123456789012:role\u002Faws-ec2-spot-fleet-role\",\n    \"TargetCapacity\": 10,\n    \"SpotPrice\": \"0.10\",\n    \"AllocationStrategy\": \"capacityOptimized\",\n    \"LaunchSpecifications\": [\n      {\"ImageId\": \"ami-xxx\", \"InstanceType\": \"c5.xlarge\", \"SubnetId\": \"subnet-aaa\"},\n      {\"ImageId\": \"ami-xxx\", \"InstanceType\": \"c5a.xlarge\", \"SubnetId\": \"subnet-bbb\"}\n    ]\n  }'\n```\n\n## AMI Management\n\n```bash\n# Create an AMI from a running instance\naws ec2 create-image \\\n  --instance-id i-0abc123def456 \\\n  --name \"web-server-$(date +%Y%m%d)\" \\\n  --description \"Web server golden AMI\" \\\n  --tag-specifications 'ResourceType=image,Tags=[\n    {Key=Name,Value=web-server-golden},\n    {Key=Version,Value=2026.03.24}\n  ]'\n\n# Copy AMI to another region for disaster recovery\naws ec2 copy-image \\\n  --source-image-id ami-0abcdef1234567890 \\\n  --source-region us-east-1 \\\n  --region us-west-2 \\\n  --name \"web-server-dr-copy\"\n\n# Deregister old AMIs and delete associated snapshots\naws ec2 deregister-image --image-id ami-old123\naws ec2 delete-snapshot --snapshot-id snap-old123\n\n# Share AMI with another AWS account\naws ec2 modify-image-attribute \\\n  --image-id ami-0abcdef1234567890 \\\n  --launch-permission \"Add=[{UserId=987654321098}]\"\n```\n\n## Instance Management\n\n```bash\n# List running instances with key details\naws ec2 describe-instances \\\n  --filters \"Name=instance-state-name,Values=running\" \\\n  --query \"Reservations[].Instances[].{ID:InstanceId,Type:InstanceType,IP:PrivateIpAddress,Name:Tags[?Key=='Name']|[0].Value,State:State.Name}\" \\\n  --output table\n\n# Stop and start instances\naws ec2 stop-instances --instance-ids i-0abc123def456\naws ec2 start-instances --instance-ids i-0abc123def456\n\n# Resize an instance (stop first)\naws ec2 stop-instances --instance-ids i-0abc123def456\naws ec2 wait instance-stopped --instance-ids i-0abc123def456\naws ec2 modify-instance-attribute \\\n  --instance-id i-0abc123def456 \\\n  --instance-type '{\"Value\": \"t3.large\"}'\naws ec2 start-instances --instance-ids i-0abc123def456\n\n# Get console output for debugging boot issues\naws ec2 get-console-output --instance-id i-0abc123def456\n\n# Get instance screenshot (helps debug GUI issues)\naws ec2 get-console-screenshot --instance-id i-0abc123def456\n```\n\n## Terraform EC2 with Auto Scaling\n\n```hcl\nresource \"aws_launch_template\" \"web\" {\n  name_prefix   = \"web-\"\n  image_id      = data.aws_ami.amazon_linux.id\n  instance_type = \"t3.medium\"\n\n  iam_instance_profile {\n    name = aws_iam_instance_profile.web.name\n  }\n\n  metadata_options {\n    http_tokens   = \"required\"\n    http_endpoint = \"enabled\"\n  }\n\n  block_device_mappings {\n    device_name = \"\u002Fdev\u002Fxvda\"\n    ebs {\n      volume_size = 30\n      volume_type = \"gp3\"\n      encrypted   = true\n    }\n  }\n\n  user_data = base64encode(file(\"userdata.sh\"))\n\n  tag_specifications {\n    resource_type = \"instance\"\n    tags = {\n      Name        = \"web-server\"\n      Environment = \"production\"\n    }\n  }\n}\n\nresource \"aws_autoscaling_group\" \"web\" {\n  name                = \"web-asg\"\n  min_size            = 2\n  max_size            = 10\n  desired_capacity    = 4\n  vpc_zone_identifier = [aws_subnet.private_a.id, aws_subnet.private_b.id]\n  target_group_arns   = [aws_lb_target_group.web.arn]\n  health_check_type   = \"ELB\"\n\n  launch_template {\n    id      = aws_launch_template.web.id\n    version = \"$Latest\"\n  }\n\n  tag {\n    key                 = \"Name\"\n    value               = \"web-asg\"\n    propagate_at_launch = true\n  }\n}\n\nresource \"aws_autoscaling_policy\" \"cpu\" {\n  name                   = \"cpu-target-tracking\"\n  autoscaling_group_name = aws_autoscaling_group.web.name\n  policy_type            = \"TargetTrackingScaling\"\n\n  target_tracking_configuration {\n    predefined_metric_specification {\n      predefined_metric_type = \"ASGAverageCPUUtilization\"\n    }\n    target_value = 60.0\n  }\n}\n```\n\n## Troubleshooting\n\n| Problem | Cause | Fix |\n|---|---|---|\n| Instance stuck in `pending` | Insufficient capacity | Try a different AZ or instance type |\n| Cannot SSH to instance | Security group or NACL blocks port 22 | Check SG ingress rules and route tables |\n| Instance immediately terminates | EBS volume limit or AMI issue | Check `describe-instances` for StateReason |\n| IMDSv1 deprecation warnings | Metadata options not set | Set `HttpTokens=required` in launch template |\n| User data not running | Script missing shebang or not base64 | Verify `#!\u002Fbin\u002Fbash` header; check `\u002Fvar\u002Flog\u002Fcloud-init-output.log` |\n| Spot instance terminated | Capacity reclaimed by AWS | Use capacity-optimized allocation and diversify types |\n| ASG not replacing unhealthy | Health check grace period too short | Increase grace period to cover app boot time |\n| EBS throughput bottleneck | gp2 volume too small for IOPS | Migrate to gp3 and set explicit IOPS\u002Fthroughput |\n\n## Related Skills\n\n- aws-vpc (`aws-vpc`) - VPC networking, subnets, and security groups\n- aws-iam (`aws-iam`) - Instance profiles and roles\n- aws-cost-optimization (`aws-cost-optimization`) - Rightsizing and Spot strategies\n- terraform-aws (`terraform-aws`) - Infrastructure as Code deployment\n- cloudformation (`cloudformation`) - AWS-native IaC templates\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n\nThe target-tracking example is for EC2 Auto Scaling, whose configuration differs from Application Auto Scaling cooldown fields; configure supported instance warmup separately. AMI IDs, paths, instance families and dates are placeholders\u002Fhistorical choices: verify region, trusted owner and CPU architecture. Creating an image normally reboots; schedule downtime or explicitly quiesce application state before choosing no-reboot. EBS snapshots do not capture instance-store data. Sharing AMIs, deleting snapshots, changing instance types and recurring scaling need exact approved scope\u002Fcost\u002Frollback. User data is retrievable and logged, not secret storage. Changing a launch-template version does not itself replace existing instances; plan a verified refresh. The Terraform fragment omits networking\u002FAMI resources; define security groups and application health routing explicitly. GNU base64 -w0 is not portable to macOS.\n","# AWS EC2\n\nDeploy and manage Amazon EC2 compute instances for production, staging, and development workloads.\n\n## When to Use This Skill\n\n- Launching new compute instances for application hosting\n- Building golden AMIs for consistent deployments\n- Setting up auto-scaling groups behind load balancers\n- Migrating workloads to Spot instances for cost savings\n- Troubleshooting instance connectivity, performance, or launch failures\n- Creating launch templates for repeatable infrastructure\n\n## Prerequisites\n\n- AWS CLI v2 installed and configured (`aws configure`)\n- Least-privilege IAM actions for selected compute, scaling and load-balancer resources; restrict iam:PassRole to the intended instance role\n- An existing VPC with subnets (see aws-vpc (`aws-vpc`))\n- SSH key pair created (`umask 077` before creating a key file in a private directory; prefer approved session access where appropriate)\n\n## Instance Type Selection Guide\n\n| Category | Types | Use Case |\n|---|---|---|\n| General Purpose | t3, t3a, m6i, m7g | Web servers, small databases, dev\u002Ftest |\n| Compute Optimized | c6i, c7g | Batch processing, media encoding, ML inference |\n| Memory Optimized | r6i, r7g, x2idn | In-memory caches, large databases |\n| Storage Optimized | i3, i4i, d3 | Data warehousing, distributed file systems |\n| Accelerated | p4d, g5, inf2 | ML training, GPU rendering, inference |\n| Burstable | t3.micro-t3.2xlarge | Low-steady-state with occasional bursts |\n\n## Launch an Instance\n\n```bash\n# Launch a production web server\naws ec2 run-instances \\\n  --image-id ami-0abcdef1234567890 \\\n  --instance-type t3.medium \\\n  --key-name my-key \\\n  --security-group-ids sg-12345678 \\\n  --subnet-id subnet-12345678 \\\n  --iam-instance-profile Name=EC2AppProfile \\\n  --metadata-options \"HttpTokens=required,HttpEndpoint=enabled\" \\\n  --block-device-mappings '[{\n    \"DeviceName\": \"\u002Fdev\u002Fxvda\",\n    \"Ebs\": {\n      \"VolumeSize\": 30,\n      \"VolumeType\": \"gp3\",\n      \"Iops\": 3000,\n      \"Throughput\": 125,\n      \"Encrypted\": true\n    }\n  }]' \\\n  --tag-specifications 'ResourceType=instance,Tags=[\n    {Key=Name,Value=web-server-01},\n    {Key=Environment,Value=production},\n    {Key=Team,Value=platform}\n  ]' \\\n  --user-data file:\u002F\u002Fuserdata.sh\n\n# Launch with IMDSv2 required (security best practice)\naws ec2 run-instances \\\n  --image-id ami-0abcdef1234567890 \\\n  --instance-type t3.micro \\\n  --metadata-options \"HttpTokens=required,HttpPutResponseHopLimit=1,HttpEndpoint=enabled\" \\\n  --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=secure-instance}]'\n```\n\n## User Data Scripts\n\n```bash\n#!\u002Fbin\u002Fbash\n# userdata.sh - Bootstrap a web server on Amazon Linux 2023\nset -euo pipefail # avoid tracing secrets in user-data logs\n\n# System updates\ndnf update -y\n\n# Install and start web server\ndnf install -y nginx\nsystemctl enable nginx\nsystemctl start nginx\n\n# Install CloudWatch agent\ndnf install -y amazon-cloudwatch-agent\n\u002Fopt\u002Faws\u002Famazon-cloudwatch-agent\u002Fbin\u002Famazon-cloudwatch-agent-ctl \\\n  -a fetch-config -m ec2 \\\n  -s -c ssm:AmazonCloudWatch-linux\n\n# Install CodeDeploy agent\ndnf install -y ruby wget\ncd \u002Fhome\u002Fec2-user\nwget https:\u002F\u002Faws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com\u002Flatest\u002Finstall\n# Verify a reviewed pinned installer and integrity before execution; do not run latest blindly.\n\n# Signal CloudFormation (if launched via CFN)\n# \u002Fopt\u002Faws\u002Fbin\u002Fcfn-signal -e $? --stack ${AWS::StackName} --resource ASG --region ${AWS::Region}\n```\n\n## Launch Templates\n\n```bash\n# Create a launch template with full configuration\naws ec2 create-launch-template \\\n  --launch-template-name web-server-template \\\n  --version-description \"v1 - AL2023 with nginx\" \\\n  --launch-template-data '{\n    \"ImageId\": \"ami-0abcdef1234567890\",\n    \"InstanceType\": \"t3.medium\",\n    \"KeyName\": \"my-key\",\n    \"SecurityGroupIds\": [\"sg-12345678\"],\n    \"IamInstanceProfile\": {\"Name\": \"EC2AppProfile\"},\n    \"MetadataOptions\": {\n      \"HttpTokens\": \"required\",\n      \"HttpEndpoint\": \"enabled\"\n    },\n    \"BlockDeviceMappings\": [{\n      \"DeviceName\": \"\u002Fdev\u002Fxvda\",\n      \"Ebs\": {\n        \"VolumeSize\": 30,\n        \"VolumeType\": \"gp3\",\n        \"Encrypted\": true\n      }\n    }],\n    \"TagSpecifications\": [{\n      \"ResourceType\": \"instance\",\n      \"Tags\": [\n        {\"Key\": \"Environment\", \"Value\": \"production\"},\n        {\"Key\": \"ManagedBy\", \"Value\": \"launch-template\"}\n      ]\n    }],\n    \"Monitoring\": {\"Enabled\": true},\n    \"UserData\": \"'\"$(base64 -w0 userdata.sh)\"'\"\n  }'\n\n# Create a new version of the launch template\naws ec2 create-launch-template-version \\\n  --launch-template-name web-server-template \\\n  --source-version 1 \\\n  --version-description \"v2 - updated AMI\" \\\n  --launch-template-data '{\"ImageId\": \"ami-0newami1234567890\"}'\n\n# Set the default version\naws ec2 modify-launch-template \\\n  --launch-template-name web-server-template \\\n  --default-version 2\n```\n\n## Auto Scaling Group\n\n```bash\n# Create ASG with mixed instances (on-demand + spot)\naws autoscaling create-auto-scaling-group \\\n  --auto-scaling-group-name web-asg \\\n  --mixed-instances-policy '{\n    \"LaunchTemplate\": {\n      \"LaunchTemplateSpecification\": {\n        \"LaunchTemplateName\": \"web-server-template\",\n        \"Version\": \"$Default\"\n      },\n      \"Overrides\": [\n        {\"InstanceType\": \"t3.medium\"},\n        {\"InstanceType\": \"t3a.medium\"},\n        {\"InstanceType\": \"m5.large\"}\n      ]\n    },\n    \"InstancesDistribution\": {\n      \"OnDemandBaseCapacity\": 2,\n      \"OnDemandPercentageAboveBaseCapacity\": 25,\n      \"SpotAllocationStrategy\": \"capacity-optimized\"\n    }\n  }' \\\n  --min-size 2 --max-size 10 --desired-capacity 4 \\\n  --vpc-zone-identifier \"subnet-aaa,subnet-bbb\" \\\n  --target-group-arns \"arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup\u002Fweb-tg\u002Fabc123\" \\\n  --health-check-type ELB \\\n  --health-check-grace-period 300 \\\n  --tags '[\n    {\"Key\":\"Name\",\"Value\":\"web-asg\",\"PropagateAtLaunch\":true},\n    {\"Key\":\"Environment\",\"Value\":\"production\",\"PropagateAtLaunch\":true}\n  ]'\n\n# Create target tracking scaling policy (target 60% CPU)\naws autoscaling put-scaling-policy \\\n  --auto-scaling-group-name web-asg \\\n  --policy-name cpu-target-tracking \\\n  --policy-type TargetTrackingScaling \\\n  --target-tracking-configuration '{\n    \"PredefinedMetricSpecification\": {\n      \"PredefinedMetricType\": \"ASGAverageCPUUtilization\"\n    },\n    \"TargetValue\": 60.0\n  }'\n\n# Create scheduled scaling for known traffic patterns\naws autoscaling put-scheduled-update-group-action \\\n  --auto-scaling-group-name web-asg \\\n  --scheduled-action-name scale-up-morning \\\n  --recurrence \"0 8 * * MON-FRI\" \\\n  --min-size 4 --max-size 20 --desired-capacity 8\n\naws autoscaling put-scheduled-update-group-action \\\n  --auto-scaling-group-name web-asg \\\n  --scheduled-action-name scale-down-evening \\\n  --recurrence \"0 20 * * MON-FRI\" \\\n  --min-size 2 --max-size 10 --desired-capacity 2\n```\n\n## Spot Instances\n\n```bash\n# Request Spot instances\naws ec2 request-spot-instances \\\n  --spot-price \"0.05\" \\\n  --instance-count 3 \\\n  --type \"one-time\" \\\n  --launch-specification '{\n    \"ImageId\": \"ami-0abcdef1234567890\",\n    \"InstanceType\": \"c5.xlarge\",\n    \"KeyName\": \"my-key\",\n    \"SecurityGroupIds\": [\"sg-12345678\"],\n    \"SubnetId\": \"subnet-12345678\"\n  }'\n\n# Check current Spot prices\naws ec2 describe-spot-price-history \\\n  --instance-types t3.medium t3a.medium m5.large \\\n  --availability-zone us-east-1a \\\n  --product-descriptions \"Linux\u002FUNIX\" \\\n  --start-time \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\" \\\n  --query \"SpotPriceHistory[].{Type:InstanceType,Price:SpotPrice,AZ:AvailabilityZone}\" \\\n  --output table\n\n# Create a Spot Fleet request\naws ec2 request-spot-fleet \\\n  --spot-fleet-request-config '{\n    \"IamFleetRole\": \"arn:aws:iam::123456789012:role\u002Faws-ec2-spot-fleet-role\",\n    \"TargetCapacity\": 10,\n    \"SpotPrice\": \"0.10\",\n    \"AllocationStrategy\": \"capacityOptimized\",\n    \"LaunchSpecifications\": [\n      {\"ImageId\": \"ami-xxx\", \"InstanceType\": \"c5.xlarge\", \"SubnetId\": \"subnet-aaa\"},\n      {\"ImageId\": \"ami-xxx\", \"InstanceType\": \"c5a.xlarge\", \"SubnetId\": \"subnet-bbb\"}\n    ]\n  }'\n```\n\n## AMI Management\n\n```bash\n# Create an AMI from a running instance\naws ec2 create-image \\\n  --instance-id i-0abc123def456 \\\n  --name \"web-server-$(date +%Y%m%d)\" \\\n  --description \"Web server golden AMI\" \\\n  --tag-specifications 'ResourceType=image,Tags=[\n    {Key=Name,Value=web-server-golden},\n    {Key=Version,Value=2026.03.24}\n  ]'\n\n# Copy AMI to another region for disaster recovery\naws ec2 copy-image \\\n  --source-image-id ami-0abcdef1234567890 \\\n  --source-region us-east-1 \\\n  --region us-west-2 \\\n  --name \"web-server-dr-copy\"\n\n# Deregister old AMIs and delete associated snapshots\naws ec2 deregister-image --image-id ami-old123\naws ec2 delete-snapshot --snapshot-id snap-old123\n\n# Share AMI with another AWS account\naws ec2 modify-image-attribute \\\n  --image-id ami-0abcdef1234567890 \\\n  --launch-permission \"Add=[{UserId=987654321098}]\"\n```\n\n## Instance Management\n\n```bash\n# List running instances with key details\naws ec2 describe-instances \\\n  --filters \"Name=instance-state-name,Values=running\" \\\n  --query \"Reservations[].Instances[].{ID:InstanceId,Type:InstanceType,IP:PrivateIpAddress,Name:Tags[?Key=='Name']|[0].Value,State:State.Name}\" \\\n  --output table\n\n# Stop and start instances\naws ec2 stop-instances --instance-ids i-0abc123def456\naws ec2 start-instances --instance-ids i-0abc123def456\n\n# Resize an instance (stop first)\naws ec2 stop-instances --instance-ids i-0abc123def456\naws ec2 wait instance-stopped --instance-ids i-0abc123def456\naws ec2 modify-instance-attribute \\\n  --instance-id i-0abc123def456 \\\n  --instance-type '{\"Value\": \"t3.large\"}'\naws ec2 start-instances --instance-ids i-0abc123def456\n\n# Get console output for debugging boot issues\naws ec2 get-console-output --instance-id i-0abc123def456\n\n# Get instance screenshot (helps debug GUI issues)\naws ec2 get-console-screenshot --instance-id i-0abc123def456\n```\n\n## Terraform EC2 with Auto Scaling\n\n```hcl\nresource \"aws_launch_template\" \"web\" {\n  name_prefix   = \"web-\"\n  image_id      = data.aws_ami.amazon_linux.id\n  instance_type = \"t3.medium\"\n\n  iam_instance_profile {\n    name = aws_iam_instance_profile.web.name\n  }\n\n  metadata_options {\n    http_tokens   = \"required\"\n    http_endpoint = \"enabled\"\n  }\n\n  block_device_mappings {\n    device_name = \"\u002Fdev\u002Fxvda\"\n    ebs {\n      volume_size = 30\n      volume_type = \"gp3\"\n      encrypted   = true\n    }\n  }\n\n  user_data = base64encode(file(\"userdata.sh\"))\n\n  tag_specifications {\n    resource_type = \"instance\"\n    tags = {\n      Name        = \"web-server\"\n      Environment = \"production\"\n    }\n  }\n}\n\nresource \"aws_autoscaling_group\" \"web\" {\n  name                = \"web-asg\"\n  min_size            = 2\n  max_size            = 10\n  desired_capacity    = 4\n  vpc_zone_identifier = [aws_subnet.private_a.id, aws_subnet.private_b.id]\n  target_group_arns   = [aws_lb_target_group.web.arn]\n  health_check_type   = \"ELB\"\n\n  launch_template {\n    id      = aws_launch_template.web.id\n    version = \"$Latest\"\n  }\n\n  tag {\n    key                 = \"Name\"\n    value               = \"web-asg\"\n    propagate_at_launch = true\n  }\n}\n\nresource \"aws_autoscaling_policy\" \"cpu\" {\n  name                   = \"cpu-target-tracking\"\n  autoscaling_group_name = aws_autoscaling_group.web.name\n  policy_type            = \"TargetTrackingScaling\"\n\n  target_tracking_configuration {\n    predefined_metric_specification {\n      predefined_metric_type = \"ASGAverageCPUUtilization\"\n    }\n    target_value = 60.0\n  }\n}\n```\n\n## Troubleshooting\n\n| Problem | Cause | Fix |\n|---|---|---|\n| Instance stuck in `pending` | Insufficient capacity | Try a different AZ or instance type |\n| Cannot SSH to instance | Security group or NACL blocks port 22 | Check SG ingress rules and route tables |\n| Instance immediately terminates | EBS volume limit or AMI issue | Check `describe-instances` for StateReason |\n| IMDSv1 deprecation warnings | Metadata options not set | Set `HttpTokens=required` in launch template |\n| User data not running | Script missing shebang or not base64 | Verify `#!\u002Fbin\u002Fbash` header; check `\u002Fvar\u002Flog\u002Fcloud-init-output.log` |\n| Spot instance terminated | Capacity reclaimed by AWS | Use capacity-optimized allocation and diversify types |\n| ASG not replacing unhealthy | Health check grace period too short | Increase grace period to cover app boot time |\n| EBS throughput bottleneck | gp2 volume too small for IOPS | Migrate to gp3 and set explicit IOPS\u002Fthroughput |\n\n## Related Skills\n\n- aws-vpc (`aws-vpc`) - VPC networking, subnets, and security groups\n- aws-iam (`aws-iam`) - Instance profiles and roles\n- aws-cost-optimization (`aws-cost-optimization`) - Rightsizing and Spot strategies\n- terraform-aws (`terraform-aws`) - Infrastructure as Code deployment\n- cloudformation (`cloudformation`) - AWS-native IaC templates\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n\nThe target-tracking example is for EC2 Auto Scaling, whose configuration differs from Application Auto Scaling cooldown fields; configure supported instance warmup separately. AMI IDs, paths, instance families and dates are placeholders\u002Fhistorical choices: verify region, trusted owner and CPU architecture. Creating an image normally reboots; schedule downtime or explicitly quiesce application state before choosing no-reboot. EBS snapshots do not capture instance-store data. Sharing AMIs, deleting snapshots, changing instance types and recurring scaling need exact approved scope\u002Fcost\u002Frollback. User data is retrievable and logged, not secret storage. Changing a launch-template version does not itself replace existing instances; plan a verified refresh. The Terraform fragment omits networking\u002FAMI resources; define security groups and application health routing explicitly. GNU base64 -w0 is not portable to macOS.\n",{"name":5,"risk":28,"source":48,"license":14,"category":49,"metadata":50,"date_added":53,"description":7,"source_repo":54,"source_type":33,"compatibility":55,"license_source":56},"https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills","devops",{"author":51,"version":52},"devops-skills","1.0","2026-09-20","BagelHole\u002FDevOps-Security-Agent-Skills","Requires the relevant OS\u002Fplatform tooling and privileged access where noted. Docs-only; helper scripts and templates not bundled.","https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE","7bf2279c8a65758319526a721d5c4b75683aec9c","skills\u002Fantigravity-aws-ec2",3,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections","https:\u002F\u002Fgithub.com\u002Fboisenoise","2026-11-14 14:18:11",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add boisenoise\u002Fskills-collections --skill aws-ec2",{"tool":69,"command":70},"bunx","bunx skills add boisenoise\u002Fskills-collections --skill aws-ec2",{"tool":72,"command":73},"pnpm","pnpm dlx skills add boisenoise\u002Fskills-collections --skill aws-ec2","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-aws-ec2\u002FSKILL.md",true,[],[78,87,95,104,112,120],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":82,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"01M7B6HREHB53EHGGVZND7DDXN","scrapely-scrape","Collect web data with ready-made Scrape.ly scrapers: Google Maps places, Amazon products, LinkedIn jobs, reviews, social posts. Use when the user wants structured data from a site.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":86},"01M7B6GDNNN4HE662KA6KPF7GW","lumify-odds","Lumify's hosted sports MCP\u002FREST API for sportsbook odds, line-movement history, public betting splits, and player props across MLB, NFL, NBA, NHL, soccer, tennis, NCAAF, NCAAB. Read-only market data.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":99,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":103},"01M743PZMJW2GEKG5J199GPSK7","sync-lipsync","Lip-sync an existing video of a real person to new audio or a typed script with sync. labs through its hosted MCP server, quoting the cost and waiting for approval first.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":103},"01M743MMN3CKTJVNRSZMB684E5","music-for-robots","Optional music-inspired creative exercise for multimodal agents. Ingests an unquantized acoustic MP3 composition by Michael Luchtan (Music For Robots) into a private temporary directory, analyzing microtiming and texture to inspire creative writing, brainstorming, or technical tasks.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":103},"01M743KC2GN5WE11BSTWSSWD8B","imagera-media","Generate or edit images, video clips, voiceovers and music through the hosted Imagera MCP server, quoting the credit cost and getting approval before each paid call.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":124,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":103},"01M743HDJNZQA8A4VT68NWGWQJ","deja-history","Search this machine's past AI coding sessions across Claude Code, Codex, Cursor, Gemini CLI and thirty-nine other agents before editing, debugging, or denying something exists.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FSKILL.md",[],[]]