aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.61k stars 3.91k forks source link

(cli): shell out to changeset approver tool #19504

Open rix0rrr opened 2 years ago

rix0rrr commented 2 years ago

Description

Shell out to external tools for change approval during cdk deploy.

Use Case

Allow people to integrate their own tools into cdk deploy, so they can customize the approval logic (and/or UI) without having to go through us).

Proposed Solution

Add a --changeset-approval-tool=xyz flag. This flag will supersede the built-in change approval modes and work as follows:

AWS_ACCESS_KEY_ID=*** AWS_SECRET_KEY=*** AWS_SESSION_TOKEN=*** xyz arn:aws:....:stack/MyStack/11111-22222-ccccc/my-change-set

If the tool exits with exit code 0, continue.

Otherwise, abort.

Other information

No response

Acknowledge

stevehodgkiss commented 2 years ago

It would be great if CDK had a builtin way of viewing the changeset before approval. We don't have any special requirements for how a changeset is visualised/approved, just that the actions (add, remove, modify, replace) can be seen before approval. I think it's something that should be a core part of aws-cdk.

https://github.com/aws/aws-cdk/issues/3780 https://github.com/aws/aws-cdk/pull/15494

Would you be open to a new PR to show the change set before approval, similar to https://github.com/aws/aws-cdk/pull/15494 but with the same output columns as SAM CLI? For reference, SAM CLI presents the change set like this:

sam4