Skip to content

Commit

Permalink
feat(code pipeline): cross-account: action account attribute
Browse files Browse the repository at this point in the history
Add account attribute to action, so pipeline could detect
if action should be executed in foreign account, and perform
steps to simplify managing of cross-account deployments.
  • Loading branch information
Radoslaw Smogura committed Jan 17, 2019
1 parent 8b160bb commit ea36531
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/@aws-cdk/aws-codepipeline-api/lib/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ export interface ActionProps extends CommonActionProps, CommonActionConstructPro
*/
region?: string;

/**
* The account this Action resides in.
*
* @default the Action resides in the same account as the Pipeline
*/
account?: string;

artifactBounds: ActionArtifactBounds;
configuration?: any;
version?: string;
Expand Down Expand Up @@ -197,6 +204,18 @@ export abstract class Action extends cdk.Construct {
*/
public readonly region?: string;

/**
* The AWS account the given Action resides in.
* Note that a cross-account Pipeline requires replication artifact stores (buckets and KMS keys)
* to function correctly. You can provide their names with the
* {@link PipelineProps#crossRegionReplicationBuckets} property.
* If you don't, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets,
* that you will need to `cdk deploy` before deploying the main, Pipeline-containing Stack.
*
* @default the Action resides in the same account as the Pipeline
*/
public readonly account?: string;

/**
* The action's configuration. These are key-value pairs that specify input values for an action.
* For more information, see the AWS CodePipeline User Guide.
Expand Down Expand Up @@ -231,6 +250,7 @@ export abstract class Action extends cdk.Construct {
this.category = props.category;
this.provider = props.provider;
this.region = props.region;
this.account = props.account;
this.configuration = props.configuration;
this.artifactBounds = props.artifactBounds;
this.runOrder = props.runOrder === undefined ? 1 : props.runOrder;
Expand Down

0 comments on commit ea36531

Please sign in to comment.