class ArtifactPath
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodePipeline.ArtifactPath |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscodepipeline#ArtifactPath |
![]() | software.amazon.awscdk.services.codepipeline.ArtifactPath |
![]() | aws_cdk.aws_codepipeline.ArtifactPath |
![]() | 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', {
crossAccountKeys: true,
stages: [
sourceStage,
prodStage,
],
});
Initializer
new ArtifactPath(artifact: Artifact, fileName: string)
Parameters
- artifact
Artifact
- fileName
string
Properties
Name | Type | Description |
---|---|---|
artifact | Artifact | |
file | string | |
location | string |
artifact
Type:
Artifact
fileName
Type:
string
location
Type:
string
Methods
Name | Description |
---|---|
static artifact |
static artifactPath(artifactName, fileName)
public static artifactPath(artifactName: string, fileName: string): ArtifactPath
Parameters
- artifactName
string
- fileName
string
Returns