와탭랩스 블로그 오픈 이벤트 😃
자세히 보기
Tech
2024-04-12
Managing/Replicating Infrastructure with AWS CloudFormation

 Hi, I am Jungmin Choi from the DevOps team at WhaTap Labs.

AWS provides a great GUI and CLI, allowing users to build systems with a few clicks.

However, even with AWS, the complexity of systems has led to issues with managing resources, replication, and more.

For organizations experiencing these issues, AWS CloudFormation may be the right answer.

1. What is AWS CloudFormation

AWS CloudFormation is a leading IaC tool that allows you to model and configure your AWS resources so that you can spend less time managing your resources and more time developing applications that will run on AWS.

What is IaC?
Short for Infra-structure as a Code, it is the management and provisioning of infrastructure through code.

It is a bit difficult to write, but once you do, you can easily manage/replicate your infrastructure.

blog main image

2. How to Write a Template

Templates that describe and provision AWS resources can be written in JSON or YAML format.

blog main image

After you create your template, simply create your AWS CloudFormation stack and it will automatically create the resources defined in your template in advance.

Creating Templates with Designer

When building an infrastructure with a combination of different resources, it is often convenient to use the Designer supported by AWS CloudFormation.

You can drag and drop resources to configure them, and then just fill in the resource settings.

TIP: Desiner allows you to view a list of settings for a resource

S3-CloudFront
blog main image
EC2-ELB
blog main image
APIGATE-LAMBDA
blog main image

3. Actual Application

blog main image

The image above is based on the AWS Virtual Waiting Room Template, which is available as a sample from AWS and is a simplified template with only the core functionality. With this template, you can configure systems such as course sign-ups, ticketing queues, etc.

When you need a queuing system in another space, you do not have to configure it from scratch!

Difficulties when using

  • If the resource is complex, it is hard to test it until you are done creating it.
  • Setting values that are essential for resource creation are not marked (create if missingx)

→ Hard to debug.

  • Template creation takes a long time.

→ Creating them through the AWS GUI or CLI is usually faster.

It may be more efficient to avoid using infrastructure that is a one-time use.

Summary

  • AWS CloudFormation is an IaC tool that allows you to model and provision AWS resources.
  • Initial configuration is laborious, but it is easy to manage/replicate on an ongoing basis.
  • After creating the template, when creating the stack, create the predefined resources and the environment is complete.

Wrapping up

Being able to manage and replicate a large number of resources in code at once is a definite advantage of using AWS CloudFormation. However, it is not easy to organize a complex system in code, so I think you need to give it a lot of thought and understand your company's system before adopting AWS CloudFormation.

와탭 모니터링을 무료로 체험해보세요!