0
votes

I have below cloudformation template:

CodeBuildProject:
    Type: AWS::CodeBuild::Project
    Properties:
      Name: project
      ServiceRole: !Ref CodeBuildRole
      Artifacts:
        Type: CODEPIPELINE
      Source:
        Type: CODEPIPELINE
...

The Artifiacts and Source -> Type are CODEPIPELINE. I am translating above code to CDK but couldn't find the right API to specify these values.

I read this doc https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codebuild.Source.html and https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codebuild.IArtifacts.html but it doesn't have any method to load source from CODEPIPELINE.

1

1 Answers

1
votes

You can use PipelineProject:

A convenience class for CodeBuild Projects that are used in CodePipeline.

An example of how the class can be used is in: