aws-cdk-lib.aws_codepipeline.ArtifactPath

class ArtifactPath

LanguageType name
.NETAmazon.CDK.AWS.CodePipeline.ArtifactPath
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodepipeline#ArtifactPath
Javasoftware.amazon.awscdk.services.codepipeline.ArtifactPath
Pythonaws_cdk.aws_codepipeline.ArtifactPath
TypeScript (source)aws-cdk-lib » aws_codepipeline » ArtifactPath

A specific file within an output artifact.

The most common use case for this is specifying the template file for a CloudFormation action.

Example

// Source stage: read from repository
const repo = new codecommit.Repository(stack, 'TemplateRepo', {
  repositoryName: 'template-repo',
});
const sourceOutput = new codepipeline.Artifact('SourceArtifact');
const source = new cpactions.CodeCommitSourceAction({
  actionName: 'Source',
  repository: repo,
  output: sourceOutput,
  trigger: cpactions.CodeCommitTrigger.POLL,
});
const sourceStage = {
  stageName: 'Source',
  actions: [source],
};

// Deployment stage: create and deploy changeset with manual approval
const stackName = 'OurStack';
const changeSetName = 'StagedChangeSet';

const prodStage = {
  stageName: 'Deploy',
  actions: [
    new cpactions.CloudFormationCreateReplaceChangeSetAction({
      actionName: 'PrepareChanges',
      stackName,
      changeSetName,
      adminPermissions: true,
      templatePath: sourceOutput.atPath('template.yaml'),
      runOrder: 1,
    }),
    new cpactions.ManualApprovalAction({
      actionName: 'ApproveChanges',
      runOrder: 2,
    }),
    new cpactions.CloudFormationExecuteChangeSetAction({
      actionName: 'ExecuteChanges',
      stackName,
      changeSetName,
      runOrder: 3,
    }),
  ],
};

new codepipeline.Pipeline(stack, 'Pipeline', {
  stages: [
    sourceStage,
    prodStage,
  ],
});

Initializer

new ArtifactPath(artifact: Artifact, fileName: string)

Parameters

  • artifact Artifact
  • fileName string

Properties

NameTypeDescription
artifactArtifact
fileNamestring
locationstring

artifact

Type: Artifact


fileName

Type: string


location

Type: string

Methods

NameDescription
static artifactPath(artifactName, fileName)

static artifactPath(artifactName, fileName)

public static artifactPath(artifactName: string, fileName: string): ArtifactPath

Parameters

  • artifactName string
  • fileName string

Returns

  • ArtifactPath