question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(cli): add `--execute-only` or `--skip-create-change-set` flag

See original GitHub issue

In order to better support deployments from a pipeline (not code pipeline), it would be ideal if the CLI could execute change sets without creating them.

Use Case

Support for a pipeline that has 3 steps:

  • Step 1: Create change set(s)
  • Step 2: Human review and approval of change set(s)
  • Step 3: Deploy change set(s)

Creating change sets without executing them is already supported with --no-execute. There’s WIP to print change set details in https://github.com/aws/aws-cdk/pull/15494 to make the human review step easier.

The only way to implement step 3 currently is to use an external tool/script to apply the change set.

Proposed Solution

Add an --execute-only flag to skip change set creation.

The process would be:

Step 1: cdk deploy --no-execute --change-set-name ci-build-$n. Step 2: Human review and approval of the change sets created in Step 1. Step 3: cdk deploy --execute-only --change-set-name ci-build-$n.

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
stevehodgkisscommented, Jul 24, 2021

I understand and I sympathize, but CDK is not the right level of abstraction to implement this, and I don’t want to be maintaining code for various odds-and-ends use cases that would be better served by other tooling. It will only slow CDK down in the future, and we have to balance the long-term health of the product with the use cases we unlock.

These are not odds and ends use cases. A cdk plan with a cdk deploy in CI is just asking for danger and if the plan won’t be the same in the deploy step (it’s not approving anything except good luck friend, but with terraform the apply has an outfile file and will be what you will execute). If you want to build a consistent tool that can be used like terraform then this is an oversight.

I think it’s important to separate CDK library development from CDK API “abstractions”. CDK is great, I really enjoy working with it, but a JS API to instruct deployments based on the metadata output could enable so many more things. That’s the bigger picture I’m hoping for.

This is not our core competency either (the framework is), it’s just something we incidentally have to do to make the rest of CDK be useful at all.

This is exactly my point. The framework around this, CDK CLI, or the CDK API, is what would multiply the value of CDK itself as it is now, for many companies.

2reactions
rix0rrrcommented, Jul 19, 2021

I understand and I sympathize, but CDK is not the right level of abstraction to implement this, and I don’t want to be maintaining code for various odds-and-ends use cases that would be better served by other tooling. It will only slow CDK down in the future, and we have to balance the long-term health of the product with the use cases we unlock.

Yes, CDK has a “start-CFN-deployment-and-wait-for-it” feature. That doesn’t mean it should be generically reusable for any CloudFormation change set deployment.

Preferably there should be an external tool that does exactly that, nothing more and nothing less. I know it’s frustrating, but that doesn’t mean CDK should become that tool, just because we could. In fact, I’d love for some tool to exist and CDK to reuse it and drop that code from our code base. This is not our core competency either (the framework is), it’s just something we incidentally have to do to make the rest of CDK be useful at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS CDK Toolkit (cdk command) - AWS Documentation
The AWS CDK Toolkit, the CLI command cdk , is the primary tool for interacting with your ... Add the --long flag to...
Read more >
AWS CloudFormation UPDATE_ROLLBACK_FAILED fix in ...
Creating and executing a Change Set. Select the stack you want to update it's template. Under "Stack Actions" select "Create change set for ......
Read more >
How to create file execute mode permissions in Git on ...
There's no need to do this in two commits, you can add the file and mark it executable in a single commit: C:\Temp\TestRepo>touch...
Read more >
CloudFormation — Boto3 Docs 1.26.36 documentation
CloudFormation doesn't make changes until you execute the change set. ... This field is returned only for SSM parameter types in the template....
Read more >
Linux permissions: SUID, SGID, and sticky bit | Enable Sysadmin
We need to execute scripts, modify files, and run processes in order to ... This command, by default, has the SUID permission set:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found