Open nikolay opened 2 years ago
You can use apply
instead of deploy
, but we need to keep deploy
to stay compliant with the AWS cdk
@DanielMSchmidt Sorry, didn't see the aliases on the far right. I'm not sure why they have to be kept when it's a totally different CLI, which is targeting only Terraform. In fact, deploy
and destroy
can be aliases only in the presence of an environment flag, for example. CDKTF can do irreversible damage unlike the typical CDK use cases!
They don't have to be in sync, but there are a lot of folks coming from the AWS CDK so we want to make their transitions as easy as possible.
@DanielMSchmidt It's hard to quantify, but a lot of people who use CDK are simply Terraform users, who are missing the dynamic provider capability of Terraform proper and are faced with the difficult choice to either use Terragrunt, or implement some templating, or use Terraform CDK. Given Terraform Cloud users can't use Terragrunt nicely, I picked CDKTF. And thanks to autocomplete, I've accidentally destroyed a test stack.
I'm sorry that happened to you! I definitely agree, a lot of folks come from Terraform, even more than from the AWS CDK would be my guess. That is why these commands exist both as apply/deploy & plan/diff. Not having the deploy alias for apply would certainly lead to folks being annoyed with CDKTF since apply is weird for them. It's a weird spot for both user groups and allowing both is the best trade-off we can do.
Another thing is, we don't want to second guess our users, which is why if you supply an --auto-approve flag we won't ask again before running the command.
Community Note
Description
The visual difference between
deploy
anddestroy
is minimal. Also, both are prone to an autocomplete devastating mistakes. Please, consider deprecatingdeploy
in favor ofprovision
or something different. This problem does not exist withapply
anddestroy
! No to mention thatdiff
also starts with aD
.