Deployments & Managing Infrastructure at Scale Flashcards
What is CloudFormation
Cloud Formation allows you to manage infrastructure and automate any deployments using code.
• Provisions and manages stacks of AWS resources based on templates you create to model your infrastructure architecture
• It provides a common language for you to model and provision AWS resources.
Benefits of AWS CloudFormation
• Infrastructure as code = No resources are manually created, which is excellent for control
• Changes to the infrastructure are reviewed through code
• You can estimate the costs of your resources using the CloudFormation template
• Productivity = Ability to destroy and re-create an infrastructure on the cloud on the fly
• Automated generation of Diagram
• Use existing templates on the web
CloudFormation Templates
• You can write CloudFormation templates in both YAML and JSON
• They are declarations of the AWS resources that make up a stack.
CloudFormation working with Stacks
A stack is a collection of AWS resources that you can manage as a single unit.
• AWS CloudFormation ensures all stack resources are created or deleted as appropriate.
• All the resources in a stack are defined by the stack’s AWS CloudFormation template.
CloudFormation Designer
Is a graphic tool for creating, viewing, and modifying AWS CloudFormation templates.
• You can diagram your template resources
• We can see all the resources
• We can see the relations between the components
AWS Cloud Development Kit (CDK)
• Is an open source software development framework to define your cloud application resources using familiar programming languages.
• The code is “compiled” into a CloudFormation template (JSON/YAML)
You can therefore deploy infrastructure and application runtime code together
• Deploy infrastructure on AWS with languages
Typical architecture: Web App 3-tier
Client > [ELB] > [EC2 Instances + Auto Scaling Group] > RDS + ElastiCache
Developer problems on AWS
• Managing infrastructure
• Deploying Code
• Configuring all the databases, load balancers, etc
• Scaling concerns
AWS Elastic Beanstalk
Elastic Beanstalk is an easy to use service that deploys, manages and scales web apps and services for you
• Beanstalk = Platform as a Service (PaaS)
• Makes it easier for developers
• We still have full control over the AWS resources powering your app
• Beanstalk is free but you pay for the underlying instances
• Lets you focus on building great web or mobile apps for your users without spending a lot of time managing and configuring infrastructure
• Provides platforms for programming languages
Elastic Beanstalk - Shared Responsibility
Managed service
• Instance configuration / OS is handled by Beanstalk
• Deployment strategy is configurable but performed by Elastic Beanstalk
• Capacity provisioning
• Load balancing & auto-scaling
• Application health-monitoring & responsivenes
• Just the application code is the responsibility of the developer
•Not only can deploy an application, but also update it
Elastic Beanstalk – Health Monitoring
• Health agent pushes metrics to CloudWatch
• Checks for app health, publishes health events
What’s the difference between Beanstalk and CloudFormation if they both use CloudFormation?
CloudFormation is going to be used to deploy infrastructure as code. That means that you can deploy anything not only in these two instances, but anything on CloudFormation. And it doesn’t have to be, for example, an application.
Whereas Beanstalk is a code centric view. It’s a platform as a service, in which the first thing you have to do in a Beanstalk environment is to upload your code and then Beanstalk will find a way for you to run that code, and will do it for you.
AWS CodeDeploy
• Automates your software deployments, allowing you to deploy reliably and rapidly.
• Works with EC2 Instances
• Works with On-Premises Servers
• Hybrid service
AWS CodeCommit
• Developers usually store code in a repository, using the Git technology
• Source-control service that hosts Git-based repositories
• Makes it easy to collaborate with others on code
• The code changes are automatically versioned
Benefits
• Fully managed
• Scalable & highly available
• Private, Secured, Integrated with AW
AWS CodeBuild
• Compiles source code, runs tests, and produces software packages that are ready to deploy. (by CodeDeploy for example)
Benefits
• Serverless
• Fully managed
• Continuously scalable & highly available
• Secure & Pay-as-you-go pricing