AWS CloudFormation is a “service that can automatically build AWS resources.” Anyone can instantly build the same environment without mistakes by creating a text file (template) written in YAML or JSON format. In this article, we will introduce the overview and features of AWS CloudFormation, as well as issues when implementing it.
table of contents
- What is AWS CloudFormation?
- Process of building AWS resources using CloudFormation
- Features of AWS CloudFormation
- Reproducibility
- Easy infrastructure management
- Operational costs are easy to predict
- available for free
- Rich templates
- Scalability
- Management of multiple accounts and multiple regions
- problem
- summary
What is AWS CloudFormation?
First, I will introduce an overview of AWS CloudFormation.
AWS CloudFormation is a service that can automatically build AWS resources based on text files (templates) written in YAML or JSON format.
By creating and managing frequently used environment templates in code, anyone can instantly build the same environment without mistakes. This significantly reduces the effort and time compared to building an environment from scratch, making development more efficient. Furthermore, being able to build the same infrastructure environment contributes to the automation of processes in DevOps, where development teams and operations teams work together to proceed with development, making it possible to proceed with development at a constant quality and speed.
The AWS CloudFormation service itself can be used for free. However, each AWS resource used together incurs costs.
Process of building AWS resources using CloudFormation
The process for automatically building AWS resources using AWS CloudFormation is shown in the diagram below.
â‘ Creating a template
There are two main ways to create a template.
You can create a text file from scratch in YAML or JSON format, or you can use the sample template posted on the AWS official website as is or make some changes.
â‘¡Save
Save the created template locally or in an S3 bucket.
â‘¢ Create a stack
Use AWS CloudFormation to create a stack based on the saved template.
â‘£ Building resources
AWS CloudFormation builds and configures the stack resources specified in the template.
Features of AWS CloudFormation
Next, I will introduce the features of AWS CloudFormation.
Reproducibility
Once you create a template, you can recreate the same environment as many times as you like. This makes it possible to significantly reduce the effort and time required to build an environment and to avoid human errors.
Easy infrastructure management
Once you create a template, you can recreate the same environment as many times as you like. This makes it possible to significantly reduce the effort and time required to build an environment and to avoid human errors.
Operational costs are easy to predict
Even if the system is new, if you reuse templates that have been used in the past, operational costs will be easier to predict.
available for free
There is no cost to use AWS CloudFormation. However, charges will be incurred for other AWS resources used together, such as Amazon EC2, AWS ELB, and VPC.
Rich templates
Although it is possible to create templates in-house from scratch, the official AWS website has a variety of sample templates and template snippets (pieces of source code that can be easily cut and pasted and reused) that include best practices. They are publicly available, and by using them as is, you can easily build an environment that combines security and availability. In addition, by using the sample template as a base and modifying some parts to suit your company, you can efficiently build an environment without omissions or omissions.
Scalability
You can use AWS CloudFormation Registry to discover, provision, and manage third-party resources and modules such as MongoDB, Datadog, Atlassian Opsgenie, JFrog, Trend Micro, and Splunk.
Management of multiple accounts and multiple regions
With CloudFormation StackSets, you can use a single template to securely and automatically provision, update, and delete a common set of AWS resources, regardless of the number of accounts or their location.
problem
Implementing AWS CloudFormation has the following issues:
â‘ Learning costs are required
AWS CloudFormation templates are written in YAML and JSON formats, so if you are not familiar with these file formats, it will take time to learn and understand them. Additionally, if no one within the company is knowledgeable, financial costs may be incurred, such as inviting instructors from outside.
â‘¡ It may take more time than making manual corrections Even if you
want to make a small correction, you need to create a stack from the template again and apply it, so in some cases, it may take more time than making manual corrections. There is a possibility that the
③ AWS CloudFormation templates have a limit on resource creation, which limits the number of resources that can be created to 500. To avoid reaching this creation limit, there is a way to separate one template into multiple templates.
summary
Reducing the effort and time involved in building the environment that serves as the basis for development is extremely important for promoting DX (transformation) quickly and efficiently. Additionally, in DevOps, a development method that allows software development to proceed flexibly and quickly through collaboration and cooperation between development and operations personnel, it is necessary to be able to build the same environment to automate various processes. For these reasons, we believe that using IaC tools such as AWS CloudFormation introduced in this article, which can manage infrastructure using code and efficiently build production environments, will become increasingly popular.
If your company is having trouble building or managing infrastructure or would like to consult with us, please contact CMC Japan. CMC Japan is the Japanese subsidiary of CMC Corporation, Vietnam’s second-largest ICT company, and has over 2,200 IT engineers with 30 years of development know-how and diverse skill sets, including infrastructure. Based on our interviews, we provide consulting and IT solutions tailored to your needs and concerns.