Skip to content

AWS ‐ CloudFormation

FullstackCodingGuy edited this page Sep 9, 2024 · 10 revisions

CloudFormation is an infrastructure code tool to manage aws services, using a text based file one can provision or update the resources. CloudFormation aka Resource Group or Resource Stack, it helps manage resources as single unit.

Using a template code (using json or yaml) to define the resource stack (vm, db, alb, buckets, iam policy etc) and this code can be reused. This template can be stored locally or s3 bucket. We dont need to create a template for each resource, instead, create a template for multiple resources (Stack, ex: LAMP).

Template Code Supports Parameters, Mappings, Conditions

CloudFormation Stack - to manage resources as a single unit, it can have Nested Stacks, Windows Stacks, StackSets

CloudFormation ChangeSets - Summary of potential changes to review before implementation.

Cloud Service Models

Its network based IT Service, comes with proper authentication and security services.

SLA - Contract between consumer and service provider to keep up the uptime guarantees and define the consequences of the downtime.

5 Cloud Characteristics

  • On-demand self-service.
  • Broad network access.
  • Resource pooling.
  • Rapid elasticity.
  • Measured Service.

XaaS - Anything as a Service

Any network accessed service

IaaS

Moving Data Centers to cloud

  • VMs
  • CSP responsible for the hardware
  • Customer responsible for the software

PaaS

Moving Platforms to cloud

  • Web apps, CDN, IDEs, databases, Software development platforms

SaaS

Moving Software to cloud

  • User productivity apps - Office365, SalesForce etc
  • Accessible from thin clients

FaaS - Function as a Service

Typically used for microservice, pay-per-use apps and functions

SECaaS - Security as a service

Network access security a services, Cloud based DDoS mitigation, Cloud based firewall

IaaC - Infrastructure as a code

Allow IT infra much more manageable using code/configuration files using tools CloudFormation Complete automation for all the infrastructure resources. It supports version control and deployment control using CI/CD.

Using CloudFormation Templates, we can do below activities

  • Manage
  • Monitor
  • Provision

Advantages

  • It helps achieve Efficiency and Speed using the automated scripts with consistency for all env (dev, test, stage)

Risks

  • Find out more

IaaC Automation

With the automation, engineer does not have to do any activity manually, everything would be automated using script and executed.

  • Resource Provisioning (allocating new resources spun up) by script
  • Instance Configuration (creating instances on the allocated resources, installing a software) by using script
  • Workload configuration and deployment (Establishing service connections ex: web app to db, web app to cache etc), monitoring and management

CloudFormation Continuous Delivery using CodePipeline

It is a Automated Release methodology to delivery the build package constantly to achieve the speed and consistency.

CloudFormation Stacks

  • Resource Collection managed as single unit under one account region
  • Creating, Updating, Deletion of resources
  • Stack Resources defined by Template
  • Successful creation or deletion of all resources required
  • Stack rolled back if resources cant be created
  • Resources kept if a resource cant be deleted due to whatever reason
  • Working with Stacks using
    • CloudFormation Console - It runs on web browser (create,monitor,update,delete)
    • CloudFormation API -
    • AWS CLI - It runs on terminal for scripting automation (create,monitor,update,delete)

CloudFormation StackSets

It is a Enhanced Stack functionality to manage multiple stacks across accounts and regions using single CloudFormation template. Helps to manage accros multiple stacks and regions using single cloudformation template

Clone this wiki locally