0% found this document useful (0 votes)
3 views55 pages

CloudFormationandOpsWork

Cloud Formation is an AWS service that automates the setup of AWS resources using template files, allowing for predictable provisioning and version control of infrastructure. It supports the creation of templates in YAML or JSON, which can be stored in source control systems and customized through parameters. Additionally, AWS OpsWorks provides a configuration management platform for more control over infrastructure design using Chef recipes, enhancing productivity and reliability in deployment and scaling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views55 pages

CloudFormationandOpsWork

Cloud Formation is an AWS service that automates the setup of AWS resources using template files, allowing for predictable provisioning and version control of infrastructure. It supports the creation of templates in YAML or JSON, which can be stored in source control systems and customized through parameters. Additionally, AWS OpsWorks provides a configuration management platform for more control over infrastructure design using Chef recipes, enhancing productivity and reliability in deployment and scaling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Cloud Formation : Cloud Infrastructure

An AWS service that uses template files to automate the setup of AWS
resources.

• An easy way to create and manage a collection of AWS resources


• Allows orderly and predictable provisioning and updating of resources
• Allows you to version control your AWS infrastructure
• Deploy and update stacks using console, command line or API
• You only pay for the resources you create.
Cloud Infrastructure
Cloud Infrastructure
Manual for Cloud Infrastructure

To create cloud infrastructure, use aws management console


• Easy to get started
• No reproducible
• Error prone
• Time consumption
Scripted Method for Cloud Infrastrcture

To create cloud infrastructure,write some scripts


• Use cli commands to create some resources
• No retry logic
• No updates
• No rollbacks
• Unclear finish times
Cloud Formation : Cloud Infrastructure
Cloud Formation : Template

To create cloud infrastructure, use template file

• Easy to automate
• Reproducible
• Not human readable
• Too many parameters
Cloud Formation

• AWS service for provisioning resources


• Create resources in a predictable, repeatable and automated way

Templated Provision
• Provision identical copies of a stack structure
Cloud Formation : Infrastructure As a code

• Templates can be stored in a source control system

• Track all changes made to your infrastructure stack

• Modify and update resources in a controlled and predictable way

Declarative and Flexible

• Choose the resources and configurations you need

• Customize your template through parameters


Cloud Formation

• Write or create your template right from the start, or you can also use one of
the example templates pre-offered by AWS.

• Along with that, the users are allowed to use several AWS products within
CloudFormation, such as Amazon Elastic Beanstalk, Amazon RDS, and
Amazon EC2.

• Creating or modify a CloudFormation template within YAML or JSON,


Cloud Formation

• The CloudFormation template will elaborate on the resources you want and
the settings associated with them.

• For instance, if you wish to create one EC2 instance, then your template will
declare the same and describe the properties.

• Once you have created the template, save it either in the S3 bucket or locally.
Make sure you save it with an extension such as .txt, .yaml, or .json.

• Create the CloudFormation stack by specifying the Amazon S3 URL or the


template file location over your local computer.
Cloud Formation Process
Template Format
Template Format
Template Format
Template Format
CloudFormation Template
Cloud Formation: Best Practices

• Validate templates
• Use Parameter types
• Use Mappings
• Use Deletion Policies
• Use IAM and tags
Cloud Formation: Validate Templates

Validate Template API action validates:

• JSON/YAML syntax
• Absence of circular dependencies
• Template Structure
Cloud Formation: Parameters
Cloud Formation: Parameter Constraints
Cloud Formation: Mappings
Cloud Formation: Using Template via AWS CLI
Supported AWS Services
Reference Function in Template
Literal References in Template
Mapping in Template
AWS OpsWorks
What is AWS OpsWorks?

• Configuration management platform


• Provides more control over infrastructure design and management than EB
• Infrastructure as code using Chef recipes for fine-grained control
• Consists of a CM model based upon Stacks, layers and Recipes.
Why OpsWorks?
Major Concepts: Stack
• Top Level OpsWorks Entity
• Represents a set of instances and applications that you want to manage
collectively.
• Eg. Web Server Stack many contain a load balancer, server instances and
database.
• It groups custom configuration and houses one or more applications.
Major Concepts: Layers
• Each stack has one or more Layers.
• A simple static web site might have a single Nginx layer.
• A typical web application might instead have a load-balancer layer, a Rails
layer, and a MySQL layer.
• OpsWorks defines plenty of built-in layers (for Rails, HAProxy, PHP, Node,
Memcached, MySQL, etc.)
Major Concepts: Build-in Layers

• HAProxy
• Ruby
• Node.js
• Java
• PHP
• Static Web
• Ganglia
• Memcached
• MySQL
• Custom
Major Concepts: Applications
• Applications are your code, sourced from a git or subversion repository, an
S3 bucket, or even an external web site.

• Finally, we define Instances and assign each to one or more layers.


• These are the EC2 servers themselves.
• You can start instances manually, or configure them to start and stop on a
schedule or in response to load patterns.
AWS Cloud Formation Integration
Improve Productivity

• Scalable Infrastructure
• Flexible
• Deploy often
• Staging environments
Improve Reliability
Improve Control

• Versioned config
• Control anything you can script with Chef recipes
• Lock down console access
• Change and deployment logs
Scaling

• 24/7 hours instances added to a layer can manually start, stop or reboot the
corresponding EC2 instances.
• Automatic Scaling
Time based instances based on a schedule
Load based instances based on several load metric (Network Metric,
CPU Utilization)
• Combination of all 3 types is an effective strategy.
Deployment and Customization

• App and associated infrastructure is deployed automatically.


• Chef recipes define infrastructure as code
Customization
Redeployment
Version Control
Code reuse
OpsWorks Agent

• Installed on every instance


• Can execute different commands on an instance
• Send keep alive messages for auto healing
• Send 15 host level metrics every minute
OpsWorks Agent

• Chef is an open source framework that automates software development and


configuration.

• Whenever a change happens on your stack or upon request, all instances are
notified and recipes are run.
AWS OpsWorks Agent : Custom Recipes
AWS OpsWorks Agent : Custom Recipes
AWS OpsWorks Agent : Life Cycle Events
• Set up
This event occurs after a started instance has finished booting.

• Configure
This event occurs on all of the stack's instances when one of the following
occurs:
1. An instance enters or leaves the online state.
2. You associate an Elastic IP address with an instance or disassociate one
from an instance.
3. You attach an Elastic Load Balancing load balancer to a layer, or detach one
from a layer.
AWS OpsWorks Agent : Life Cycle Events
Deploy
• This event occurs when you run a Deploy command, typically to deploy an
application to a set of application server instances.
• The instances run recipes that deploy the application and any related files
from its repository to the layer's instances.

Undeploy
• This event occurs when you delete an app or run an Undeploy command to
remove an app from a set of application server instances.
• The specified instances run recipes to remove all application versions and
perform any required cleanup.

Shutdown
• The event occurs after you direct AWS OpsWorks Stacks to shut an instance
down but before the associated Amazon EC2 instance is actually terminated.
AWS OpsWorks for Chef Automate
• Fully managed chef server

• Programmable Infrastructure

• Scaling made easy

• Support from Active Chef Community

• Simple to manage hybrid environments


AWS OpsWorks for Chef Automate
• Easy to use Chef on AWS

• Automatic Backups

• Automatic updates and upgrades


Chef minor versions
OS updates
Security Updates

You might also like