Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Getting started with AWS CloudFormation

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

AWS cloudformation orchestrates and invokes AWS cloud resources through templates. And the existing environment can be upgraded by modifying the template code level, and there is no doubt that the flexible and convenient characteristics of cloud business. Let's show you how to use cloudformation through an entry-level simple hands-on case. I hope you can do it yourself.

Create a cloudformation template

Image above: enter the cloudformation interface of the webconsole console and click create new stack. (new users have a 1-year AWS free tier that can be used to experience various services)

Image above: in this experiment, we first select a simple single-instance single-area LAMP Stack.

Image above: click View/Edit template in Designer to enter the visual editing template interface.

Image above: the visual editing interface can see the dependency between the existing resources of the template. When you click the icon of securitygroup, the JSON language of the template below will automatically jump to the securitygroup-related code to facilitate review and modification.

Image above: when you click the ec2 icon, the lower JSON language automatically jumps to the ec2 section. The resources in the Resource types on the left can be clicked to generate the corresponding code, and users can directly use it or modify the code parameters according to the actual situation, which is very convenient.

Image above: click create stack Peugeot in the upper left corner to create the prepared template.

Image above: select the LAMP Stack template and click Next.

Image above: fill in an a-nice-template here in Stack name. Standardized naming is recommended in formal work. InstanceType chose t2.micro here for experimental exercises. KeyName is the key used to log in to this ec2. Just choose it. DB-related can be filled in casually, do not understand can go to Baidu mysql basic knowledge. Then click the next in the lower right corner twice until you enter the create page.

Image above: review interface. You can see the relevant information about this Lamp Stack. Confirm it and click create in the lower right corner to create resources.

Image above: template resources are in the process of creating create in progress, which will be very fast.

Image above: the resource is created quickly.

Image above: when you finally return to the console of ec2, you can see that the LAMP stand-alone machine you just created with cloudformation is ready to use, and the securitygroup of this machine has just been created through a-nice-template.

Image above: click the URL link of the template here in cloudformation to access the ec2 you just created.

Image above: remember to delete resources after the completion of the experiment to avoid deduction.

Summary: cloudformation can not only quickly call and deploy the resources of the infrastructure layer through the template, but also modify the internal application / system configuration files of the resources, which is very powerful. The template can be used repeatedly, only a small amount of modification is needed to the parameters in the template according to the actual situation, and the concept of once and for all greatly reduces the workload of DevOps.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report