0

Following tutorials like this one, I managed to set up a continuous deployment pipe to deploy automatically via AWS CodeDeploy to my EC2 instance using GitHub actions, triggered on merging (or rather pushing) to the main branch. In most of these tutorials, an AWS S3 bucket is specified explicitly, and an aws s3 sync command is included in the GitHub Actions YAML file (again, like in the tutorial).

However, I realised that one need not specify (or even manually create) and S3 bucket for the deployment to work. Instead, just the following command example is enough for the workflow to deploy:

aws deploy create-deployment --application-name ${{ env.codedeployapp }} --deployment-group-name ${{ env.codedeploygrp }} --deployment-config-name CodeDeployDefault.OneAtATime --github-location repository=${{ github.repository }},commitId=${{ github.sha }}

Why do these tutorials manually create an S3 bucket when not required? I want to make sure that I'm not missing something obvious in my setup.

1 Answer 1

0

Yes you can create a new deployment directly from Github, but that will require that you set up a GitHub authentication with applications in CodeDeploy. You might not be able to set up this deployment if you don't have admin access to the repository.

Also, using S3 is a good way to implement "decoupled architecture". Read more here: https://www.techtarget.com/whatis/definition/decoupled-architecture

In general, a decoupled architecture is a framework for complex work that allows components to remain completely autonomous and unaware of each other. Cloud computing is sometimes said to have a decoupled architecture because the cloud provider manages the physical infrastructure, but not the applications or data hosted on it.

By using S3 as the location to upload your source code, if in the future you move away from Github and change into Gitlab or on-premise Git repository, you don't need to change anything on the CodeDeploy side. This is because CodeDeploy expect the source code to be in S3, and will start the deployment once a new S3 upload trigger happen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.