简体   繁体   English

AWS CLI与控制台和CloudFormation堆栈

[英]AWS CLI vs Console and CloudFormation stacks

Is there any known downside to creating resources on aws through the CLI? 通过CLI在AWS上创建资源是否存在任何已知的弊端? Is it more reliable/easier/error prone/largely accepted/recommended to use one method over the other? 使用一种方法比另一种方法更可靠/更容易/容易出错/被广泛接受/建议吗? While setting up recurring scripts, is there a reason why i would want to use CloudFormation or the AWS Console over the AWS CLI to run commands directly? 设置重复脚本时,是否有理由为什么我要通过AWS CLI使用CloudFormation或AWS控制台直接运行命令?

For example, if I were to create an ECS Fargate Task Definition, is there any reason why I might want to use AWS CloudFormation or the Console over AWS CLI? 例如,如果我要创建ECS Fargate任务定义,我是否有任何理由要通过AWS CLI使用AWS CloudFormation或控制台? Cli syntax is straightforward and easy to use, and there are a few things (like setting up event rules/targets for a fargate task specifically) that are not supported via cloudformation yet. Cli语法简单易用,并且有些事情(例如专门为Fargate任务设置事件规则/目标)尚未通过cloudformation支持。

The AWS CLI and AWS CloudFormation are two different tools that can be used to create infrastructure on AWS. AWS CLI和AWS CloudFormation是两个不同的工具,可用于在AWS上创建基础架构。 The CLI is more powerful and has finer grained control than CloudFormation. 与CloudFormation相比,CLI更加强大,并且具有更细粒度的控制。 CloudFormation makes it very easy to use yaml or json text files that can describe an entire enterprise in the cloud. CloudFormation使使用可以描述云中整个企业的yaml或json文本文件非常容易。

One of the strong benefits of CloudFormation is the automatic support for rolling back changes if anything fails while deploying a stack. CloudFormation的强大优势之一是自动支持在部署堆栈时发生任何故障时回滚更改。 The CLI in comparison would require you to figure out the details of what went wrong and how to get back to where your state was. 相比之下,CLI将要求您弄清楚出了什么问题以及如何返回到您的状态的详细信息。 Updating infrastructure using CloudFormation is another benefit. 使用CloudFormation更新基础架构是另一个好处。 Make the change in the template and update the stack. 在模板中进行更改并更新堆栈。

For small setups, using the CLI is fine. 对于小型设置,使用CLI很好。 However, once you get past launching an EC2 instance and start building VPCs, Instances, KeyPairs, Security Groups, RDS, etc. etc. you will find that the CLI has some real limitations: mostly being too manual of a process, not easily repeatable, difficult to put the process into version control, .... 但是,一旦您开始启动EC2实例并开始构建VPC,实例,密钥对,安全组,RDS等,您就会发现CLI确实存在一些局限性:大多数情况下,该过程过于手工,不易重复,难以将流程放入版本控制中,....

If you are constantly building, testing and deleting complex setups, CloudFormation is absolutely one of the best tools from AWS. 如果您一直在构建,测试和删除复杂的设置,那么CloudFormation绝对是AWS最好的工具之一。 Note that there are a number of third party solutions that have a huge number of followers such as Bamboo, Octopus, Jenkins, Chef, etc. 请注意,有许多第三方解决方案具有大量关注者,例如Bamboo,Octopus,Jenkins,Chef等。

If your job is SysOps or DevOps then you absolutely want to master the CLI and CloudFormation. 如果您的工作是SysOps或DevOps,那么您绝对想掌握CLI和CloudFormation。 These are amazing tools for working with AWS. 这些是使用AWS的绝佳工具。 Also master Beanstalk, maybe OpsWorks and one of the third party tools like Jenkins. 还是Beanstalk的高手,也许是OpsWorks以及Jenkins等第三方工具之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM