9

I've created a pipeline which does the following:

  1. Git changes trigger next action (code build)
  2. Codebuild initiates & builds a docker image from git source
  3. Set latest docker container up on Elasticbeanstalk

The first 2 steps are working fine, git changes initiate a codebuild, the codebuild builds a docker image, and then tries to set it up on Elasticbeanstalk (which fails). The following error is thrown:

Invalid action configuration The action failed because either the artifact or the Amazon S3 bucket could not be found. Name of artifact bucket: MY_BUCKET_NAME. Verify that this bucket exists. If it exists, check the life cycle policy, then try releasing a change.

In my codebuild project, I've set the artifact location to MY_BUCKET_NAME & named it aws-test-artifact. Is this all I have to do?

I've tried looking around and am unable to find anything on this issue.

James111
  • 15,378
  • 15
  • 78
  • 121

3 Answers3

6

As Adam Loving commented we must add artifacts section.

Adding this section to your buildspec.yml file will make this work.

artifacts:
  files:
    - '**/*'

From documentation https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.artifacts.files adding '**/*' will include all files into the build target.

Andrey
  • 349
  • 4
  • 4
3

I had the same problem. Just changed Input artifacts from BuildArtifact to SourceArtifact in the build stage, and everything worked.

Shishir
  • 39
  • 2
2

So I found the fix to this issue! What I had to do was goto codebuild => edit project => Show advanced settings => Artifacts packaging

From here I changed Artifacts packaging to Zip!

Advanced settings section

James111
  • 15,378
  • 15
  • 78
  • 121