1
votes

I followed the codepipeline wizard to create a Codebuild and Codedeploy project.

My codebuild script produces a single artifact, an appspec.yml file that's supposed to get passed to codedeploy.

I've tested the file manually via the Codedeploy GUI and the deployment works, however every time I run the pipeline Codedeploy fails with the error BundleType must be either YAML or JSON

The appspec.yml file;

version: 0.0 
Resources:
  - hello-world:
      Type: AWS::Lambda::Function
      Properties:
        Name: "hello-world"
        Alias: "staging"
        CurrentVersion: "5"
        TargetVersion: "22"

My buildspec.yml

version: 0.2
phases:
  build:
    commands:
      - ./build.sh
artifacts:
  files:
    - appspec.yaml
  discard-paths: yes

enter image description here

1

1 Answers

1
votes

The issue is that your appspec is appspec.yml but you specify appspec.yaml in your buildspec.yml - note the yml versus yaml. Update your buildspec.yml with the right extension, and your issue should be solved.