3.1 Define methods of deploying and operating in the AWS cloud

Amazon Web Services offers multiple options for provisioning your IT infrastructure and the deployment of your applications. Whether it is a simple three-tier application or a complex set of workloads, the deployment model varies from customer to customer. But with the right techniques, AWS can help you pick the best strategy and tool set for deploying an infrastructure that can handle your workload. The main principles to remember are AAA - Automate, Automate, Automate.

AWS Elastic Beanstalk
Elastic Beanstalk is a high-level deployment tool that helps you get an app from your desktop to the web in a matter of minutes. Elastic Beanstalk handles the details of your hosting environment—capacity provisioning, load balancing, scaling, and application health monitoring—so you don't have to.

A platform configuration defines the infrastructure and software stack to be used for a given environment. When you deploy your app, Elastic Beanstalk provisions a set of AWS resources that can include Amazon EC2 instances, alarms, a load balancer, security groups, and more.

AWS CloudFormation
AWS CloudFormation is a service that helps you model and set up your Amazon Web Services resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS. You create a template that describes all the AWS resources that you want (like Amazon EC2 instances or Amazon RDS DB instances), and AWS CloudFormation takes care of provisioning and configuring those resources for you.

AWS OpsWorks
AWS OpsWorks is a configuration management service that helps you configure and operate applications in a cloud enterprise by using Chef. There are 2 variants: AWS OpsWorks Stacks and AWS OpsWorks for Chef Automate.

AWS OpsWorks Stacks
AWS OpsWorks Stacks, the original service, provides a simple and flexible way to create and manage stacks and applications. AWS OpsWorks Stacks lets you deploy and monitor applications in your stacks. Unlike AWS OpsWorks for Chef Automate, AWS OpsWorks Stacks does not require or create Chef servers; AWS OpsWorks Stacks performs some of the work of a Chef server for you. AWS OpsWorks Stacks monitors instance health, and provisions new instances for you, when necessary, by using Auto Healing and Auto Scaling.

AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate lets you create AWS-managed Chef servers that include Chef Automate premium features, and use the Chef DK and other Chef tooling to manage them. WS OpsWorks for Chef Automate manages both Chef Automate Server and Chef Server software on a single instance.

AWS CodeCommit
AWS CodeCommit is a fully-managed source control service that makes it easy for companies to host secure and highly scalable private Git repositories. CodeCommit integrates with AWS CodePipeline and AWS CodeDeploy to streamline your development and release process.

AWS CodePipeline
AWS CodePipeline is a continuous integration and continuous delivery service for fast and reliable application and infrastructure updates. CodePipeline builds, tests, and deploys your code every time there is a code change, based on the release process models you define.

AWS CodeDeploy
AWS CodeDeploy is a service that automates code deployments and software deployments to any instance, including Amazon EC2 instances and instances running on-premises. AWS CodeDeploy makes it easier for you to rapidly release new features, helps you avoid downtime during application deployment, and handles the complexity of updating your applications.

Amazon Elastic Container Service
Amazon Elastic Container Service (ECS) is a highly scalable, high performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances. Amazon ECS eliminates the need for you to install, operate, and scale your own cluster management infrastructure.

Infrastructure as Code

 * Terraform
 * Salt Stack
 * Ansible

Configuration Management

 * Chef
 * Puppet
 * Ansible

Continuous Integration

 * Jenkins
 * TeamCity

Hosted Version Control Repositories

 * GitHub
 * GitLab
 * BitBucket

Good Practice

 * Provision infrastructure from code
 * Deploy artifacts automatically from version control
 * Configuration managed from code and applied automatically
 * Scale your infrastructure automatically
 * Monitor every aspect of the pipeline and the infrastructure (CloudWatch)
 * Logging for every action (CloudWatch Logs and CloudTrail)
 * Instance profiles for embedding IAM roles in instances automatically
 * Use variables, don't hard code values
 * Tagging can be used with automation to provide more insights on what has been provisioned

Updating Your Stack
There are many ways to update your stack.
 * You can update your AMIs and then deploy a new environment from them.
 * You can use CI tools to deploy the code to existing environments.
 * You can use the "Blue/Green" method to have one environment for production (blue) and one for the new version (green). When it is time to upgrade, simply redirect the traffic from blue to green.