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

fix(aws-cloudformation): change use of Role to IRole in CodePipeline Actions #1364

Merged
merged 1 commit into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface PipelineDeployStackActionProps {
*
* @default A fresh role with admin or no permissions (depending on the value of `adminPermissions`).
*/
role?: iam.Role;
role?: iam.IRole;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in props is not a breaking change (code that passed Role here would still work)


/**
* Acknowledge certain changes made as part of deployment
Expand Down Expand Up @@ -97,7 +97,7 @@ export class PipelineDeployStackAction extends cdk.Construct {
/**
* The role used by CloudFormation for the deploy action
*/
public readonly role: iam.Role;
public readonly role: iam.IRole;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change (code that expects to find Role here now finds something more abstract).


private readonly stack: cdk.Stack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export = nodeunit.testCase({
adminPermissions: false,
role
});
test.deepEqual(role.id, deployAction.role.id);
test.same(deployAction.role, role);
test.done();
},
'users can specify IAM permissions for the deploy action'(test: nodeunit.Test) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export interface PipelineCloudFormationDeployActionProps extends PipelineCloudFo
*
* @default A fresh role with full or no permissions (depending on the value of `adminPermissions`).
*/
role?: iam.Role;
role?: iam.IRole;

/**
* Acknowledge certain changes made as part of deployment
Expand Down Expand Up @@ -194,7 +194,7 @@ export interface PipelineCloudFormationDeployActionProps extends PipelineCloudFo
* Base class for all CloudFormation actions that execute or stage deployments.
*/
export abstract class PipelineCloudFormationDeployAction extends PipelineCloudFormationAction {
public readonly role: iam.Role;
public readonly role: iam.IRole;

constructor(parent: cdk.Construct, id: string, props: PipelineCloudFormationDeployActionProps, configuration: any) {
const capabilities = props.adminPermissions && props.capabilities === undefined ? CloudFormationCapabilities.NamedIAM : props.capabilities;
Expand Down Expand Up @@ -450,7 +450,7 @@ class SingletonPolicy extends cdk.Construct {
}).addResource(stackArnFromProps(props));
}

public grantPassRole(role: iam.Role): void {
public grantPassRole(role: iam.IRole): void {
this.statementFor({ actions: ['iam:PassRole'] }).addResource(role.roleArn);
}

Expand Down