Skip to content

CICD-264 · AWS EC2 deployment ​

Encyclopedia · Cloud infrastructure integration · All snippets

Previous · CICD-263 · Next · CICD-265

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites provider CLI, scoped CI identity, test environment and provider configuration for named resource.
  • Platforms github-actions, cloud-cli.
  • Parameters RELEASE_SHA.

2. Copy the snippet ​

bash
aws deploy create-deployment --application-name web --deployment-group-name web-staging --revision "revisionType=S3,s3Location={bucket=replace-release-bucket,key=web/${RELEASE_SHA:?}.zip,bundleType=zip}" --query deploymentId --output text

3. How it works ​

CodeDeploy receives a deployment request against a specific application and deployment group. Retain its ID to check final success.

4. Verify the result ​

EC2 tags and CodeDeploy agent select instances. Use appspec hooks and wait deployment-successful for the returned ID.

Validation syntax-validated (Bash parse). Status definitions.