Skip to content

Commit

Permalink
Add CodeDeploy feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
br3ndonland committed Feb 26, 2021
1 parent b14466b commit 86005b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions notes/codedeploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [App specification files](#app-specification-files)
- [Requirements](#requirements)
- [Follow-along](#follow-along)
- [CodeDeploy feedback](#codedeploy-feedback)

## freeCodeCamp ExamPro walkthrough

Expand Down Expand Up @@ -62,3 +63,9 @@ Video 1 11.31.30
- The instructor Andrew creates an EC2 instance, then adds CodeDeploy to it.
- The cheat sheet arrives in Video 2 0.14.30
## CodeDeploy feedback
**I have worked with CodeDeploy in production. CodeDeploy is supposed to improve deployments, but can also make them more difficult.** For example, when performing [blue/green deployments](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/blue-green.html), CodeDeploy steps through a series of [lifecycle hooks](https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html), only some of which are configurable. The `Install` hook has an hour timeout and can't be configured, which means that deployments can hang for an hour, or even an entire day, with no additional information about why they didn't work.

In the [CodePipeline notes](./codepipeline.md#codepipeline-and-github), I mentioned that integration between GitHub and CodePipeline is poor. The integration between GitHub and CodeDeploy is a little better, thanks to GitHub's CI/CD service [GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions). After creating an IAM role for GitHub Actions, I use the [ECS deploy task definition action](https://github.com/marketplace/actions/amazon-ecs-deploy-task-definition-action-for-github-actions) to trigger deployments. It is important to be careful about how the deployment is configured, because of the limitations of lifecycle hooks described above. Hanging lifecycle hooks can waste not only AWS time, but also GitHub Actions build time. For example, if `wait-for-service-stability: true` is set with the [ECS deploy task definition action](https://github.com/marketplace/actions/amazon-ecs-deploy-task-definition-action-for-github-actions) in a GitHub Actions workflow, GitHub has to wait for CodeDeploy and charge for time that CodeDeploy is hanging. To avoid hanging deployments, be sure to add a timeout to your GitHub Actions workflow with `wait-for-minutes: 10`. Ten minutes is usually adequate for a production deployment to complete.

0 comments on commit 86005b1

Please sign in to comment.