0
votes

This is my first time working with AWS CodePipeline (and actually CI/CD in general) and I’m having issues deploying my NodeJS/Express app to Elastic Beanstalk.

I’ve set up a pipeline with three steps:

  1. Source from my GitHub repo
  2. Build using CodeBuild
  3. Deploy to ElasticBeanstalk

My Source and Build stages are completing successfully, but the deploy step fails with the following message:

The action failed because either the artifact or the Amazon S3 bucket could not be found. Name of artifact bucket: codepipeline-us-east-1-[long-string-of-numbers]. Verify that this bucket exists. If it exists, check the life cycle policy, then try releasing a change.

I have verified that the S3 bucket exists, and there is no life cycle policy on it.

I also checked the policy attached to the service-role being used and it has full S3 access.

The Deploy stage has the following settings:

  • Action Name: Deploy
  • Action Provider: Elastic Beanstalk
  • Region: US East (N. Virginia)
  • Input Artifacts: BuildArtifact
  • Application Name & Environment Name are the appropriate values for my Elastic Beanstalk set up
  • Variable Namespace: DeployVariables

I've confirmed that the Output Artifact name of the Build stage is "BuildArtifact", which matches the Input Artifact for my Deploy stage.

The pipeline originally did not have a build step in it, and it was previously using a different S3 bucket: elasticbeanstalk-us-east-1-[long-string-of-numbers], not sure if that is a factor or not.

Any idea on how I can get this deployment to work?

1

1 Answers

0
votes

I think I figured it out.

I realized I didn't have an Artifact set up in CodeBuild. To resolve, I went to CodeBuild, went into my BuildProject, selected "Artifacts" from the "Edit" menu, and filled out the corresponding data.

Then, in the buildspec.yaml for my nodejs project, I added the following: artifacts: files: - '**/*'