# CodePipelineFileSet

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.

Extends: FileSet › CodePipelineFileSet
Implements: IFileSetProducer

- Source: [`pipelines/lib/codepipeline/artifact-map.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/pipelines/lib/codepipeline/artifact-map.ts#L71)

## Example

```ts
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

- `id`: string — Human-readable descriptor for this file set (does not need to be unique).

- `primaryOutput`: [FileSet](/cdk/api/v2/docs/aws-cdk-lib.pipelines.FileSet.html) — The primary output of a file set producer.

  The primary output of a FileSet is itself.

- `producer`: [Step](/cdk/api/v2/docs/aws-cdk-lib.pipelines.Step.html) — The Step that produces this FileSet.

## Methods

- `fromArtifact(artifact: Artifact): CodePipelineFileSet // chainable` (static) — Turn a CodePipeline Artifact into a FileSet.

- `producedBy(producer?: Step): void` — Mark the given Step as the producer for this FileSet.

  This method can only be called once.

- `toString(): string` — Return a string representation of this FileSet.
