aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

CodePipeline: CloudFormation ExecuteChangeSet Action doesn't have correct permissions

Open joshrp opened this issue 7 years ago • 2 comments

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • [x] :beetle: bug report
    • [ ] :rocket: feature request
    • [ ] :books: construct library gap
    • [ ] :phone: security issue or vulnerability => Please see policy
    • [ ] :question: support request => Please see note at the top of this template.
  • What is the current behavior?

pipeline.addStage({
  stageName: "DeployStack",
  actions: [
    new pipeActions.CloudFormationExecuteChangeSetAction({
      actionName: "Deploy",
      stackName: "myStack-" + stage,
      changeSetName: stage + '-deployment',
      output: deployArtifact
    })
  ]
});

The default role for a CloudFormationExecuteChangeSetAction will only be created with cloudformation:ExecuteChangeSet permission. This errors when ran in CodePipeline with a permissions error for the cloudformation:DescribeStacks permission.

See: https://github.com/awslabs/aws-cdk/blob/master/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts#L121

  • What is the expected behavior (or behavior of feature suggested)? The ExecuteChangeSet Action Default Role needs cloudformation:DescribeStacks and cloudformation:DescribeChangeSet on the {stack}/* resource to be able to deploy.

  • Please tell us about your environment:

    • CDK CLI Version: 0.36.1
    • Module Version: 0.36.1
    • OS: all
    • Language: all
  • Other information This could be related to the recent change in: #3105 since the permission may have been available on the general role.

joshrp avatar Jul 02 '19 04:07 joshrp

Thanks for reporting this @joshrp . Let me try to reproduce on my end.

skinny85 avatar Jul 02 '19 17:07 skinny85

Confirmed I was able to reproduce this. Working on a fix.

skinny85 avatar Jul 02 '19 21:07 skinny85