一键导入
codedeploy
Manage AWS CodeDeploy applications, deployment groups, deployments, and rollbacks via AWS CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage AWS CodeDeploy applications, deployment groups, deployments, and rollbacks via AWS CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Manage AWS Certificate Manager certificates, validation, renewal, and import for ALB, CloudFront, and API Gateway via AWS CLI.
Manage Amazon API Gateway REST APIs, HTTP APIs, WebSocket APIs, stages, and deployments via AWS CLI.
Manage EC2 Auto Scaling groups, launch templates, scaling policies, and scheduled actions via AWS CLI.
Manage Elastic Load Balancers (ALB, NLB, CLB), target groups, listeners, and health checks via AWS CLI.
Manage AWS Organizations accounts, OUs, SCPs, and delegated administration via AWS CLI.
Manage Amazon SageMaker notebooks, training jobs, models, endpoints, and pipelines via AWS CLI.
| name | codedeploy |
| description | Manage AWS CodeDeploy applications, deployment groups, deployments, and rollbacks via AWS CLI. |
| metadata | {"openclaw":{"emoji":"🚀","requires":{"bins":["aws"]}}} |
Use this skill for deployment automation: managing applications and deployment groups, triggering and monitoring deployments, configuring rollback and deployment strategies, and managing on-premises instances.
codedeploy:* for full access, or scoped policies# List applications
aws deploy list-applications --output table
# Get application details
aws deploy get-application --application-name <app-name>
# List deployment groups for an application
aws deploy list-deployment-groups --application-name <app-name> --output table
# Get deployment group details
aws deploy get-deployment-group \
--application-name <app-name> \
--deployment-group-name <group-name>
# List deployments
aws deploy list-deployments \
--application-name <app-name> \
--deployment-group-name <group-name> \
--query 'deployments[:10]' --output table
# Get deployment details
aws deploy get-deployment --deployment-id <deployment-id>
# Get deployment target status
aws deploy list-deployment-targets --deployment-id <deployment-id>
# Get target details (instance-level status)
aws deploy get-deployment-target \
--deployment-id <deployment-id> \
--target-id <target-id>
# List deployment configs
aws deploy list-deployment-configs --output table
# Get deployment config details
aws deploy get-deployment-config --deployment-config-name <config-name>
# List on-premises instances
aws deploy list-on-premises-instances --output table
⚠️ Cost note: CodeDeploy to EC2/Lambda is free. CodeDeploy to on-premises instances: $0.02 per instance update.
# Create an application (EC2/On-premises)
aws deploy create-application \
--application-name <app-name> \
--compute-platform Server
# Create an application (Lambda)
aws deploy create-application \
--application-name <app-name> \
--compute-platform Lambda
# Create an application (ECS)
aws deploy create-application \
--application-name <app-name> \
--compute-platform ECS
# Create a deployment group (EC2 with tags)
aws deploy create-deployment-group \
--application-name <app-name> \
--deployment-group-name <group-name> \
--service-role-arn <role-arn> \
--ec2-tag-filters Key=Environment,Value=production,Type=KEY_AND_VALUE \
--deployment-config-name CodeDeployDefault.OneAtATime \
--auto-rollback-configuration enabled=true,events=DEPLOYMENT_FAILURE
# Create a deployment group with Auto Scaling
aws deploy create-deployment-group \
--application-name <app-name> \
--deployment-group-name <group-name> \
--service-role-arn <role-arn> \
--auto-scaling-groups <asg-name> \
--deployment-style deploymentType=IN_PLACE,deploymentOption=WITH_TRAFFIC_CONTROL \
--load-balancer-info targetGroupInfoList=[{name=<target-group-name>}]
# Create a custom deployment config
aws deploy create-deployment-config \
--deployment-config-name MyConfig \
--minimum-healthy-hosts type=FLEET_PERCENT,value=75
# Create a deployment from S3
aws deploy create-deployment \
--application-name <app-name> \
--deployment-group-name <group-name> \
--s3-location bucket=<bucket>,key=<key>,bundleType=zip
# Create a deployment from GitHub
aws deploy create-deployment \
--application-name <app-name> \
--deployment-group-name <group-name> \
--github-location repository=<owner/repo>,commitId=<commit-sha>
# Create a deployment with description
aws deploy create-deployment \
--application-name <app-name> \
--deployment-group-name <group-name> \
--s3-location bucket=<bucket>,key=<key>,bundleType=zip \
--description "Release v1.2.3" \
--file-exists-behavior OVERWRITE
# Register a revision
aws deploy register-application-revision \
--application-name <app-name> \
--s3-location bucket=<bucket>,key=<key>,bundleType=zip \
--description "Version 1.2.3"
# Stop a deployment
aws deploy stop-deployment --deployment-id <deployment-id>
# Continue a blue/green deployment (switch traffic)
aws deploy continue-deployment --deployment-id <deployment-id>
# Rollback is automatic if auto-rollback is configured
# Manual rollback: redeploy a previous revision
aws deploy create-deployment \
--application-name <app-name> \
--deployment-group-name <group-name> \
--revision revisionType=S3,s3Location='{bucket=<bucket>,key=<previous-version-key>,bundleType=zip}' \
--description "Rollback to previous version"
🛑 DESTRUCTIVE — Always confirm with the user before executing any of these commands.
# Delete a deployment group
aws deploy delete-deployment-group \
--application-name <app-name> \
--deployment-group-name <group-name>
# Delete an application (deletes all deployment groups too)
aws deploy delete-application --application-name <app-name>
# Delete a deployment config
aws deploy delete-deployment-config --deployment-config-name <config-name>
ValidateService lifecycle hook to verify the deployment succeeded.CodeDeployDefault.OneAtATime for production; AllAtOnce only for dev.# Watch deployment progress
DEPLOY_ID="<deployment-id>"
while true; do
STATUS=$(aws deploy get-deployment --deployment-id $DEPLOY_ID \
--query 'deploymentInfo.status' --output text)
echo "$(date): $STATUS"
[ "$STATUS" = "Succeeded" ] || [ "$STATUS" = "Failed" ] || [ "$STATUS" = "Stopped" ] && break
sleep 10
done
# Get per-instance status
aws deploy list-deployment-targets --deployment-id $DEPLOY_ID \
--query 'targetIds' --output text | tr '\t' '\n' | while read tid; do
aws deploy get-deployment-target --deployment-id $DEPLOY_ID --target-id "$tid" \
--query 'deploymentTarget.instanceTarget.[targetId,status]' --output text
done
aws deploy create-deployment \
--application-name <app-name> \
--deployment-group-name <group-name> \
--revision '{"revisionType": "AppSpecContent", "appSpecContent": {"content": "{\"version\": 0.0, \"Resources\": [{\"TargetService\": {\"Type\": \"AWS::ECS::Service\", \"Properties\": {\"TaskDefinition\": \"<task-def-arn>\", \"LoadBalancerInfo\": {\"ContainerName\": \"app\", \"ContainerPort\": 8080}}}}]}"}}'
| Error | Cause | Fix |
|---|---|---|
ApplicationDoesNotExistException | Application not found | Verify with list-applications |
DeploymentGroupDoesNotExistException | Group not found | Check with list-deployment-groups |
Deployment stuck in InProgress | Agent not running on instances | Check CodeDeploy agent status on target instances |
HEALTH_CONSTRAINTS failure | Too many instances failed | Check minimum-healthy-hosts config; review instance logs |
| Lifecycle event timeout | Script exceeds timeout | Increase timeout in AppSpec or optimize script |
| Agent not found | CodeDeploy agent not installed | Install via aws ssm send-command or UserData |