Github code pipeline to Elastic Beanstalk (EBS)

0

I want to automate the deployment of the spring boot application from GitHub to AWS elastic beanstalk (ebs). I tried both the AWS code pipeline and code star. But I keep facing permission and policy requirement errors. Not sure what the required permissions are. I will really appreciate any guidance on how to do this, with examples if possible.

The background to this question is that I am trying to move my application from Heroku to AWS. I use Guthub as my repository.

Thanks!

1 Answer
0

To automate deployment of spring boot application, you will be needing three stages in codepipeline.

  1. Source (Github: Version 2 recommended)
  2. Build ( Include the commands in buildspec.yml to build)
  3. Deploy ( AWS Elastic Beanstalk as action).

When we create codepipeline, there is an option to select the Artifact Store bucket and KMS key for encryption.By default, codepipeline uses the bucket codepipeline-Aws_Region-Account_ID and default kms key. All the permissions are added by default to the both the service roles that are created by default. Please, make sure that both the codepipeline and codebuild service role should have permission to the s3 and kms for custom configurations. S3 bucket should have permission to allow codepipeline and codebuild service role to read and write to S3. If using custom KMS, key resource policy should also allow the access to CodeBuild and CodePipeline service role. Please refer the documentation [1] that uses CodePipeline to run CodeBuild and deploy to Elastic Beanstalk.

In the codebuild buildspec.yml you need to create the artifacts that will be used by the next stage Deploy with action AWS Elastic Beanstalk. You can refer [2] for the the buildspec.yml syntax. artifacts: files: - "**/*"

References:

[1] https://docs.aws.amazon.com/codebuild/latest/userguide/sample-elastic-beanstalk.html#sample-elastic-beanstalk-codepipeline [2] https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions