[Code Pipeline x Elastic Beanstalk] Summary of errors and countermeasures for CI / CD Java applications to Elastic Beanstalk with Code Pipeline

CI / CD Java application to Elastic Beanstalk with Code Pipeline This is a summary of the errors that can occur in and how to deal with them.

environment

Error and countermeasures

  1. Elastic Beanstalk

(1) 502 (Bad Gateway) error occurs when accessing

Let's check the settings again. [Code Pipeline x Elastic Beanstalk] CI / CD Java application to Elastic Beanstalk with Code Pipeline Part 2 Review "[2] Additional settings" in "3. Creating an Elastic Beanstalk environment" and check if there are any omissions in the settings.

  1. RDS

(1) Cannot access the database

Let's check the permission settings again. [Code Pipeline x Elastic Beanstalk] CI / CD Java application to Elastic Beanstalk with Code Pipeline Part 2 Review the areas (4) to (9) in "[1] Connection settings in RDS" in "4. Database settings" and check for any omissions.

  1. CodePipeline

(1) "The action failed because either the artifact or the Amazon S3 bucket could not be found ...." error appears during deployment

image.png

Changing the input artifact from Build Artifact to Source Artifact will fix it. Follow the procedure below to change it.

① In the pipeline, click "Edit". image.png

② Click "Edit Stage" in the "Deploy" column. image.png

③ Click the edit mark (?). image.png

④ Change "Input Artifact" to "Source Artifact" (①) and click "Finish" (②). image.png

⑤ Click "Save". image.png

⑥ Click "Save". image.png

(2) "Deployment failed. The provided role does not have sufficient permissions: Failed to deploy application. Service: AWS Logs ..." appears.

This error occurs because you do not have access to CloudWatch Logs. This can be resolved by granting the "CloudWatchLogsFullAccess" policy to the role created for CodePipeline.

The procedure is as follows.

① Find and click "IAM" on the management console. image.png

② "Role" (①)> Search for the target CodePipeline role (②) and click the role name (③). image.png

③ Click "Attach policy" image.png

④ Search for "CloudWatch Logs Full Access" (1), check it (2), and click "Attach Policy" (3). image.png

At the end

As I wrote in the main part, I made an error 3 days in the 1- [3]-(5) gradlew permission change in the main part, and 3 times in the deployment stage of 5- [1]-(10). I stumbled and almost broke my heart many times. Even if an error occurs, don't be discouraged, but rather, let's enjoy it with the feeling of how to solve it!

Recommended Posts

[Code Pipeline x Elastic Beanstalk] Summary of errors and countermeasures for CI / CD Java applications to Elastic Beanstalk with Code Pipeline
[Code Pipeline x Elastic Beanstalk] CI / CD Java application to Elastic Beanstalk with Code Pipeline Part 2
[Code Pipeline x Elastic Beanstalk] CI / CD Java application to Elastic Beanstalk with Code Pipeline Part 1
[Code Pipeline x Elastic Beanstalk] CI / CD Java application to Elastic Beanstalk with Code Pipeline Part 3
[Code Pipeline x Elastic Beanstalk] Update the runtime version from Java 8 to Corretto 11 on the Java SE platform
CI the architecture of Java / Kotlin applications with ArchUnit
Summary of ToString behavior with Java and Groovy annotations
Sample code to parse date and time with Java SimpleDateFormat
[Java] Summary of for statements
Summary of steps for developing in Docker container with VS Code
[Details] Implementation of consumer applications with Kinesis Client Library for Java
Summary of problems and countermeasures when operating IE with WebDriver of Selenium2
[For beginners] Summary of java constructor
AWS SDK for Java 1.11.x and 2.x
CodeStar Banzai! CI / CD pipeline to start with just a few clicks
I want to display images with REST Controller of Java and Spring!
Practice of Java programming basics-I want to display triangles with for statements ①
Minimum configuration sample to automatically release Lambda by Java with Code pipeline
Practice of Java programming basics-I want to display triangles with for statements ②