aws-cdk-lib.pipelines.CodePipelineFileSet

class CodePipelineFileSet

LanguageType name
.NETAmazon.CDK.Pipelines.CodePipelineFileSet
Gogithub.com/aws/aws-cdk-go/awscdk/v2/pipelines#CodePipelineFileSet
Javasoftware.amazon.awscdk.pipelines.CodePipelineFileSet
Pythonaws_cdk.pipelines.CodePipelineFileSet
TypeScript (source)aws-cdk-lib » pipelines » CodePipelineFileSet

Implements IFileSetProducer

Extends FileSet

A FileSet created from a CodePipeline artifact.

You only need to use this if you want to add CDK Pipeline stages add the end of an existing CodePipeline, which should be very rare.

Example

declare const codePipeline: codepipeline.Pipeline;

const sourceArtifact = new codepipeline.Artifact('MySourceArtifact');

const pipeline = new pipelines.CodePipeline(this, 'Pipeline', {
  codePipeline: codePipeline,
  synth: new pipelines.ShellStep('Synth', {
    input: pipelines.CodePipelineFileSet.fromArtifact(sourceArtifact),
    commands: ['npm ci','npm run build','npx cdk synth'],
  }),
});

Properties

NameTypeDescription
idstringHuman-readable descriptor for this file set (does not need to be unique).
producerStepThe Step that produces this FileSet.
primaryOutput?FileSetThe primary output of a file set producer.

id

Type: string

Human-readable descriptor for this file set (does not need to be unique).


producer

Type: Step

The Step that produces this FileSet.


primaryOutput?

Type: FileSet (optional)

The primary output of a file set producer.

The primary output of a FileSet is itself.

Methods

NameDescription
producedBy(producer?)Mark the given Step as the producer for this FileSet.
toString()Return a string representation of this FileSet.
static fromArtifact(artifact)Turn a CodePipeline Artifact into a FileSet.

producedBy(producer?)

public producedBy(producer?: Step): void

Parameters

  • producer Step

Mark the given Step as the producer for this FileSet.

This method can only be called once.


toString()

public toString(): string

Returns

  • string

Return a string representation of this FileSet.


static fromArtifact(artifact)

public static fromArtifact(artifact: Artifact): CodePipelineFileSet

Parameters

  • artifact Artifact

Returns

  • CodePipelineFileSet

Turn a CodePipeline Artifact into a FileSet.