Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codepipline: pipelineName and pipelineVersion attributes #408

Merged
merged 1 commit into from
Jul 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ import validation = require('./validation');
/**
* The ARN of a pipeline
*/
export class PipelineArn extends cdk.Arn {
}
export class PipelineArn extends cdk.Arn { }

/**
* The name of the pipeline.
*/
export class PipelineName extends cdk.Token { }

/**
* The pipeline version.
*/
export class PipelineVersion extends cdk.Token { }

export interface PipelineProps {
/**
Expand Down Expand Up @@ -62,6 +71,16 @@ export class Pipeline extends cdk.Construct implements events.IEventRuleTarget {
*/
public readonly pipelineArn: PipelineArn;

/**
* The name of the pipeline
*/
public readonly pipelineName: PipelineName;

/**
* The version of the pipeline
*/
public readonly pipelineVersion: PipelineVersion;

/**
* Bucket used to store output artifacts
*/
Expand Down Expand Up @@ -102,10 +121,13 @@ export class Pipeline extends cdk.Construct implements events.IEventRuleTarget {

this.artifactBucket.grantReadWrite(this.role);

this.pipelineName = codePipeline.ref;
this.pipelineVersion = codePipeline.getAtt('Version');

// Does not expose a Fn::GetAtt for the ARN so we'll have to make it ourselves
this.pipelineArn = new PipelineArn(cdk.Arn.fromComponents({
service: 'codepipeline',
resource: codePipeline.ref
resource: this.pipelineName
}));
}

Expand Down