Integrate with AWS Code Deploy
Problem to solve
As a user that is deploying to AWS, I want to use GitLab for SCM and CI but to deploy to AWS using Code Deploy
Intended users
User experience goal
The user should be able to collaborate in work using GitLab and integrate seamlessly to CodeDeploy to deploy to AWS instances. A commit/MR change in GitLab will trigger a deploy in Code Deploy.
Proposal
- Create an application on GitLab repo
- Provision an instance on AWS (EC2 for example)
- Create an application on AWS
- Create a deployment group on AWS
- Deploy the revision
What this looks like for GitHub
aws deploy create-deployment \
--application-name CodeDeployGitHubDemo-App \
--deployment-config-name CodeDeployDefault.OneAtATime \
--deployment-group-name CodeDeployGitHubDemo-DepGrp \
--description "My GitHub deployment demo" \
--github-location repository=repository,commitId=commit-id
we can create a docker image that does these actions directly from the Yaml file.
Future iteration:
- Monitor and verify the deployment Call the list-deployments command to get the deployment ID for the application named CodeDeployGitHubDemo-App and the deployment group named CodeDeployGitHubDemo-DepGrp:
aws deploy list-deployments --application-name CodeDeployGitHubDemo-App --deployment-group-name CodeDeployGitHubDemo-DepGrp --query "deployments" --output text
Call the get-deployment command, supplying the ID of the deployment in the output from the list-deployments command:
aws deploy get-deployment --deployment-id deployment-id --query "deploymentInfo.[status, creator]" --output text
Further details
CodeDeploy integrates with lots of other CI and CD tools https://aws.amazon.com/codedeploy/product-integrations/ but not with GitLab
Permissions and Security
Documentation
Availability & Testing
What does success look like, and how can we measure that?
What is the type of buyer?
Is this a cross-stage feature?
devopsverify Category:Continuous Integration
Links / references
- https://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners-github.html
- https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials-github.html
- https://circleci.com/orbs/registry/orb/circleci/aws-code-deploy<!-- Label reminders - you should have one of each of the following labels if you can find the correct ones!