CodePipeline から CodeBuildの呼び出しでエラーになった場合の対応

Error calling startBuild: Invalid artifacts: outputName must be a valid S3 key

Invalid artifactsというのでOutputArtifactsの設定かと悩みましたが、実際はProjectNameの設定ミスでした

Configuration:
  ProjectName: !Ref Build

ステージ全体としてはこんな感じ

- Name: BuildStage
  Actions: 
    - Name: BuildAction
      ActionTypeId:
        Category: Build
        Owner: AWS
        Version: 1
        Provider: CodeBuild
      InputArtifacts:
        - Name: SourceOutput
      OutputArtifacts:
        - Name: BuildOutput
      Configuration:
        ProjectName: !Ref Build

Configuration:
  ProjectName: !GetAtt Build.Arn

ステージ全体としてはこんな感じ

- Name: BuildStage
  Actions: 
    - Name: BuildAction
      ActionTypeId:
        Category: Build
        Owner: AWS
        Version: 1
        Provider: CodeBuild
      InputArtifacts:
        - Name: SourceOutput
      OutputArtifacts:
        - Name: BuildOutput
      Configuration:
        ProjectName: !GetAtt Build.Arn