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 年前檢視次數 279 次
1 個回答
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
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南