12

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.

3 Answers 3

7

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.

Sign up to request clarification or add additional context in comments.

Comments

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

2 Comments

There is no option for artifacts packaging
Also, make sure your Buildspec has an artifacts section. Otherwise the build will succeed and link to an artifacts file that doesn't exist and was never uploaded.
2

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

2 Comments

Can you please explain your answer?
This does will exclude any changes to the artifact done during the build step.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.