O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing DevOps on AWS

Book Description

Bring the best out of DevOps and build, deploy, and maintain applications on AWS

About This Book

  • Work through practical examples and gain DevOps best practices to successfully deploy applications on AWS
  • Successfully provision and operate distributed application systems and your AWS infrastructure using DevOps
  • Perform Continuous Integration and deployment and fine-tune the way you deliver on AWS

Who This Book Is For

This book is for system administrators and developers who manage AWS infrastructure and environments and are planning to implement DevOps in their organizations. Those aiming for the AWS Certified DevOps Engineer certification will also find this book useful. Prior experience of operating and managing AWS environments is expected.

What You Will Learn

  • See the difference between Object Oriented Programming and Protocol Oriented Programming
  • See the difference between reference and value types and when to use each
  • Find out how we can leverage the tuple to reduce the complexity of our code
  • Discover what protocols are and how to use them
  • See how to implement protocol extensions to create a very flexible code base
  • Learn how to implement several design patterns in a Protocol-Oriented approach
  • Learn how to solve real-world design issues with protocol-oriented programming

In Detail

Knowing how to adopt DevOps in your organization is becoming an increasingly important skill for developers, whether you work for a start-up, an SMB, or an enterprise.

This book will help you to drastically reduce the amount of time spent on development and increase the reliability of your software deployments on AWS using popular DevOps methods of automation.

To start, you will get familiar with the concept of IaC and will learn to design, deploy, and maintain AWS infrastructure. Further on, you'll see how to design and deploy a Continuous Integration platform on AWS using either open source or AWS provided tools/services.

Following on from the delivery part of the process, you will learn how to deploy a newly created, tested, and verified artefact to the AWS infrastructure without manual intervention. You will then find out what to consider in order to make the implementation of Configuration Management easier and more effective.

Toward the end, you will get to know the tricks and tips to optimize and secure your AWS environment. By the end of the book, you will have mastered the art of applying AWS to DevOps in your organization

Style and approach

This book is packed full of real-world examples demonstrating use cases that help you deploy DevOps best practices on AWS.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Implementing DevOps on AWS
    1. Implementing DevOps on AWS
    2. Credits
    3. About the Author
    4. About the Reviewer
    5. www.PacktPub.com
      1. Why subscribe?
    6. Customer Feedback
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. What is DevOps and Should You Care?
      1. What is DevOps?
        1. A common goal
        2. Shared knowledge (no silos)
        3. Trust and shared responsibility
        4. Respect
        5. Automation
        6. Reproducible infrastructure
        7. Metrics and monitoring
        8. Continuous Integration, Delivery, and Deployment
        9. Embracing failure
      2. Should you care
        1. Is this the right time?
        2. Will it work?
        3. Is it worth it?
        4. Do you need it?
      3. Summary
    9. 2. Start Treating Your Infrastructure as Code
      1. IaC using Terraform
        1. Configuration
        2. Template design
          1. Resources
          2. Variables
          3. Outputs
        3. Operations
          1. Validation
          2. Dry-run
          3. Deployment
          4. Updates
          5. Removal
      2. IaC using CloudFormation
        1. Configuration
        2. Template design
          1. Parameters
          2. Resources
          3. Outputs
        3. Operations
          1. Template validation
          2. Deploying a Stack
          3. Updating a stack
          4. Deleting a stack
      3. Summary
    10. 3. Bringing Your Infrastructure Under Configuration Management
      1. Introduction to SaltStack
        1. Preparation
      2. Writing Configuration Management code
        1. States
        2. Pillars
        3. Grains
        4. Top files
      3. Bootstrapping nodes under Configuration Management (end-to-end IaC)
      4. Summary
    11. 4. Build, Test, and Release Faster with Continuous Integration
      1. Prepare IaC
        1. Terraform templates
          1. Variables
          2. Variables (values)
          3. Resources
            1. Create the VPC
            2. Add networking components
            3. Add EC2 node and related resources
          4. Outputs
        2. SaltStack code
          1. States
          2. Pillars
          3. Minion configuration
      2. Deploy IaC
      3. Setup CI
        1. Jenkins initialization
        2. Writing a demo app
        3. Defining the pipeline
        4. Setting up the pipeline
      4. Summary
    12. 5. Ever-Ready to Deploy Using Continuous Delivery
      1. Preparing Terraform templates
        1. Resources
        2. Variables
        3. Variables (values)
        4. Outputs
      2. Prepareing Salt code
        1. States
          1. top.sls
          2. jenkins
          3. nginx
        2. Pillars
        3. Minion configuration
      3. Preparing Jenkins code
        1. Packer
          1. demo-app.json
          2. demo-app_vars.json
          3. demo-app_userdata.sh
        2. Serverspec
          1. spec/localhost/demo-app_spec.rb
        3. demo-app
        4. demo-app-cdelivery
      4. Preparing CodeCommit repositories
      5. Deploy Terraform templates
      6. Initializing Jenkins
      7. Configuring Jenkins jobs
        1. demo-app pipeline
        2. demo-app-cdelivery pipeline
      8. Summary
    13. 6. Continuous Deployment - A Fully Automated Workflow
      1. Terraform code (resources.tf)
        1. outputs.tf
          1. Deployment
      2. Jenkins pipelines
        1. Continuous Deployment pipeline
          1. cdeployment.sh
      3. Summary
    14. 7. Metrics, Log Collection, and Monitoring
      1. Centralized logging
        1. Ingesting and storing logs with Logstash and Elasticsearch
        2. Collecting logs with Elasticsearch Filebeat
        3. Visualizing logs with Kibana
      2. Metrics
        1. Ingesting and storing metrics with Prometheus
        2. Gathering OS and application metrics with Telegraf
        3. Visualizing metrics with Grafana
      3. Monitoring
        1. Alerting with Prometheus
        2. Self-remediation with Prometheus and Jenkins
      4. Summary
    15. 8. Optimize for Scale and Cost
      1. Architectural considerations
        1. The VPC
          1. CIDR
          2. Subnets and Availability Zones
          3. VPC limits
      2. The frontend layer
      3. The backend layer
      4. The object storage layer
        1. The load balancing layer
        2. Cross-zone load balancing
        3. ELB pre-warming
        4. The CDN layer
        5. Spot instances
        6. AWS Calculators
      5. Summary
    16. 9. Secure Your AWS Environment
      1. Managing access using IAM
        1. Securing the root account
      2. VPC security
        1. Security Groups
        2. Network ACLs
        3. VPN gateway
        4. VPC peering
      3. EC2 security
        1. IAM Roles
        2. SSH access
          1. Individual keys
          2. Entrypoint
        3. ELBs everywhere
        4. HTTPS by default
        5. Encrypted storage
          1. EBS volumes
          2. S3 objects
        6. OS updates
      4. Security auditing
        1. VPC Flow Logs
        2. CloudTrail
        3. Trusted Advisor
        4. AWS Config
        5. Self pen testing
      5. Summary
    17. 10. AWS Tips and Tricks
      1. Using VPCs
      2. Keep the Main route table as a fallback
      3. Staying within the VPC
      4. Creating IAM roles in advance
      5. Groups over users
      6. Knowing the AWS service limits
      7. Pre-warm ELBs if needed
      8. Using termination protection
      9. Tagging what you can
      10. Deploying across multiple zones
      11. Enhancing your ELB health-checks
      12. Offloading SSL onto the ELB
      13. EIP versus public IP
      14. Mind the full-hour billing
      15. Using Route53 ALIAS records
      16. The S3 bucket namespace is global
      17. - versus . in the S3 bucket name
      18. Randomizing S3 filenames
      19. Initializing (pre-warm) EBS volumes
      20. Summary