Introduction to AWS CloudFormation:
A good example of how the DevOps principles are used in practice is AWS CloudFormation. CloudFormation provides a common language for you to design and provision AWS and third-party application resources in your cloud environment.
CloudFormation allows you to use programming languages or a simple text file to model and provision, in an automated and secure manner, all the resources needed for your applications across all regions and accounts. This gives you a single source of truth for your AWS and third-party resources. CloudFormation makes it easy to organize and deploy a collection of AWS resources and lets you describe any dependencies or pass in special parameters when the stack is configured.
What Is AWS CloudFormation?
- Building Blocks: It is a language that gives you building blocks to describe the infrastructure you want to provision in AWS.
- Text files: Containing the description that is formatted in JSON and YAML. In this, you can version it and track changes like any other piece of code.
- Free: It is free you can only pay for the infrastructure that is created by it.
Benefits Of Using CloudFormation:
- Model Complete Infrastructure: CloudFormation enables you to model your entire infrastructure and application resources with either a text file or programming language. CloudFormation CLI and Registry make it easy to manage third party resources with CloudFormation. CloudFormation provides a single source of truth for all your resources and helps you to standardize infrastructure components used across your organization, enabling configuration compliance and faster troubleshooting.
- Automate & deploy: CloudFormation provisions your application resources in a safe, repeatable manner, allowing you to build and rebuild your applications and infrastructure, without having to perform manual actions or write custom scripts. CloudFormation takes administration of determining the right operations to perform when managing your stack, orchestrating them most efficiently, and rolls back changes automatically if errors are detected.
- CloudFormation at Core: CloudFormation is just code. Codifying your infrastructure enables you to treat your infrastructure as just code. You can write it with any code editor, check it into a version control system, and review the files with team members before deploying it into production.
Key Terminology Regarding AWS CloudFormation?
- CloudFormation Stack: A collection of AWS resources that you manage as a single unit. The stack is created when you give the CloudFormation service your template.
- CloudFormation Template: The documents that describe how to act and what to create. It is the text that you write that CloudFormation uses to provision infrastructure. A template can be used to both create and update a stack.
E.g of Template:
How AWS CloudFormation Works?
Example Of CloudFormation Architecture
By using CloudFormation templates, you can able to define and model AWS resources that can be created and updated. These templates are written in a JavaScript Object Notation (JSON). Each template requires a specific syntax and structure that depends on the types of resources being created and managed. By using templates, you can provision infrastructure in a repeatable and reliable way.
You can create custom CloudFormation templates or use sample templates that are available publicly. Once templates are deployed or updated into the AWS environment, the collection of resources under management is called a “stack.” You can able to manage stacks through the AWS Management Console, CloudFormation APIs, or AWS Command Line Interface. Common actions include create-stack, describe-stacks, list-stacks, and update-stack.
When you create or update a stack in the console, events are displayed showing the status of the configuration. If an error occurs, the stack is rolled back to its previous state. Amazon Simple Notification Service (Amazon SNS) helps you manage these events. For example, you can use Amazon SNS to track stack creation and deletion progress via email and integrate with other processes programmatically.
With templates, you can work with a broad set of AWS offerings, including Amazon Simple Storage Service (Amazon S3), Amazon Elastic Compute Cloud (EC2), Amazon ElastiCache, AWS Elastic Beanstalk, Auto Scaling, Amazon CloudFront, Amazon DynamoDB, Elastic Load Balancing, AWS OpsWorks, AWS Identity and Access Management, and Amazon Virtual Private Cloud.
When And Where To Use AWS CloudFormation?
- When you have to deploy infrastructure rather than doing it manually.
- To create a repeatable patterned environment, e.g. a WordPress blog and a database if you were running a web hosting business.
- To run automated testing for CI/CD environments. Create a dedicated, clean environment, inject your code, run testing, produce results, then delete the test environment, all with no human input.
- To define an environment all at once, and have it deployed to any region in the AWS Cloud without reconfiguration.
- To manage infrastructure configuration using software development style versioning and code repositories such as git.
No comments:
Post a Comment