Docker on Amazon Web Services
上QQ阅读APP看书,第一时间看更新

Getting Started with AWS

In the previous chapter, we discussed the various options you have for deploying your container applications to AWS, and it's now time to start implementing practical solutions using the Elastic Container Service (ECS), Fargate, Elastic Kubernetes Service (EKS), Elastic Beanstalk, and Docker Swarm. Before we can cover all of this exciting material, you need to establish an AWS account, understand how to set up access for your account, and ensure you have a solid grasp of the various tools we will use throughout this book to interact with AWS.

Getting started with AWS is very easy—AWS offers a free tier suite of services that enable you to test and try out a number of AWS services at no cost for 12 months, or, in some cases, indefinitely. Of course, there are limitations imposed that ensure you can't set up your own Bitcoin mining services for free, but for the most part, you can leverage these free tier services to test a wide number of scenarios, including almost all of the material we will work through in this book. So, this chapter will start off with establishing a new AWS account, which will require you to have a valid credit card, just in case you do follow through on that great new Bitcoin mining venture.

Once you have an account in place, the next step is to set up administrative access to your account. By default, all AWS accounts are created with a root user that has the highest level of account privileges, however AWS do not recommend using the root account for day-to-day administrative use. Therefore, we will configure the AWS Identity Access and Management (IAM) service, creating IAM users and groups, and learning how to implement enhanced security using multi-factor authentication (MFA). 

With access to your AWS account established, we will then focus on the various tools that you can use to interact with AWS, including the AWS console that provides a web-based management interface that you access with your web browser, and the AWS CLI tool for interacting with AWS via the command line.

Finally, we will introduce a management service and toolset called AWS CloudFormation, which provides an infrastructure as code approach for defining your AWS infrastructure and services. CloudFormation allows you to define templates that enable you to build complete environments with the single click of a button, and do so in a repeatable and consistent fashion. We will be using CloudFormation extensively throughout this book, as in practice, most organizations that are deploying Docker-based applications are adopting infrastructure as code tooling such as CloudFormation, Ansible, or Terraform to automate the deployment of their Docker applications and supporting infrastructure. You will learn how to create a simple CloudFormation template and then deploy that template using both the AWS console and AWS CLI.

In this chapter, the following topics will be covered:

  • Setting up an AWS account
  • Logging in as the root account
  • Creating IAM users, groups, and roles
  • Creating an EC2 key pair
  • Installing the AWS CLI
  • Configuring credentials and profiles in the AWS CLI
  • Interacting with AWS using the AWS CLI
  • Introducing AWS CloudFormation
  • Defining a simple AWS CloudFormation template
  • Deploying an AWS CloudFormation stack
  • Deleting an AWS CloudFormation stack