Terraform Blue Green Deployment & Terraform Canary Deployment 🔵🐣🟢 AWS | ALB | EC2

Terraform Blue Green Deployment and Terraform Canary Deployment allows you to reduce risk when you upgrade your application. In case of the issue you can always rollout to the previous blue deployment. Terraform Blue-green deployment is a technique that reduces downtime and risk by running two identical production environments called Blue and Green. At any time, only one of the environments is live, with the live environment serving all production traffic. For this example, Blue is currently live and Green is idle.

Did I help you out?
☕ Buy Me a Coffe: https://www.buymeacoffee.com/antonputra
🔴 Add me on LinkedIn: https://www.linkedin.com/in/anton-putra

=========
⏱️TIMESTAMPS⏱️
0:00 Intro
0:15 AWS Networking Overview
0:30 Create versions.tf
0:38 Create main.tf
1:52 Create blue.tf
2:16 Create init-script.sh
2:26 Create variables.tf
2:36 Create output.tf
2:42 Deploy Blue Environment
3:20 Create green.tf
4:08 Create and Shift 10% of traffic to Green Deployment
4:27 Split traffic 50/50 between Blue and Green Deployment
4:37 Switch 100% of traffic to new Green Deployment and Destroy Blue

=========
Source Code
🖥️ - GitHub: https://github.com/antonputra/tutorials/tree/main/lessons/063

=========
SOCIAL
🎙 - Twitter: https://twitter.com/antonvputra
📨 - Email: me@antonputra.com

#Terraform #HashiCorp #AWS

#aws #hashicorp #terraform

What is GEEK

Buddha Community

Terraform Blue Green Deployment & Terraform Canary Deployment 🔵🐣🟢 AWS | ALB | EC2

Terraform Blue Green Deployment & Terraform Canary Deployment 🔵🐣🟢 AWS | ALB | EC2

Terraform Blue Green Deployment and Terraform Canary Deployment allows you to reduce risk when you upgrade your application. In case of the issue you can always rollout to the previous blue deployment. Terraform Blue-green deployment is a technique that reduces downtime and risk by running two identical production environments called Blue and Green. At any time, only one of the environments is live, with the live environment serving all production traffic. For this example, Blue is currently live and Green is idle.

Did I help you out?
☕ Buy Me a Coffe: https://www.buymeacoffee.com/antonputra
🔴 Add me on LinkedIn: https://www.linkedin.com/in/anton-putra

=========
⏱️TIMESTAMPS⏱️
0:00 Intro
0:15 AWS Networking Overview
0:30 Create versions.tf
0:38 Create main.tf
1:52 Create blue.tf
2:16 Create init-script.sh
2:26 Create variables.tf
2:36 Create output.tf
2:42 Deploy Blue Environment
3:20 Create green.tf
4:08 Create and Shift 10% of traffic to Green Deployment
4:27 Split traffic 50/50 between Blue and Green Deployment
4:37 Switch 100% of traffic to new Green Deployment and Destroy Blue

=========
Source Code
🖥️ - GitHub: https://github.com/antonputra/tutorials/tree/main/lessons/063

=========
SOCIAL
🎙 - Twitter: https://twitter.com/antonvputra
📨 - Email: me@antonputra.com

#Terraform #HashiCorp #AWS

#aws #hashicorp #terraform

Rory  West

Rory West

1619263860

Why Terraform? How to Getting Started with Terraform Using AWS

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.

Traditional Infrastructure vs Modern Infrastructure

Traditional Infrastructure

  • Mutable
  • Operational Complexity
  • No Central Control on Infrastructure

Modern Infrastructure

  • Immutable
  • Less Operational Complexity
  • Faster time to the market
  • single point for state management

#terraform-aws #terraform #aws #aws-ec2

Rory  West

Rory West

1620959460

Complete Guide to Terraform AWS

We’re continuing our series on Terraform AWS with a post that breaks down the basics. The world of Terraform AWS can be described as complex — from AWS storage to AWS best practices, there’s a depth of knowledge necessary to get familiar with Terraform AWS.

Whether you’re an expert at Terraform AWS or just getting started, it’s our goal at InfraCode to provide you with clear and easy-to-understand information at every level. The number of resources out there is abundant but overwhelming. That’s why we create simplified guides that are immediately usable and always understandable.

In this article, we’ll dive into:

  • A Beginner’s Overview to Terraform AWS
  • Managing AWS Storage
  • Terraform AWS Best Practices

#aws-ec2 #aws #terraform #terraform aws

Kole  Haag

Kole Haag

1603213200

Using Terraform to Create an EC2 Instance With Cloudwatch Alarm Metrics

Hey guys! I wanted to do a quick tutorial on how I created an EC2 module for Terraform. If you want to see the repository it is located in check it out here. This module will do a few things:

  1. Create an EC2 Instance
  2. Automatically look up the latest Windows Server 2019 AMI for the EC2 instance.
  3. Create and attach a additional drive.
  4. Create a Cloudwatch Alarm Metric to monitor CPU.

The folder structure looks like this:

Image for post

First things first… I created the main.tf file which contains all of my configuration except for the variables and outputs. The main.tf has a few parts to it.

AWS Instance Code

The first section is the instance resource code

#AWS Instance

resource "aws_instance" "example" {
     ami = data.aws_ami.windows.id
     instance_type = "t2.micro"
     availability_zone = var.availability_zone
}

You will notice a few things here.

  1. The instance type is set in the module to t2.micro
  2. availability_zone is set using a variable
  3. ami is set using data

We will get the the availability zone piece in just a bit, first we are going to tackle the data used for the ami argument.

Data for AMI Using a Filter

The next bit of code for the filter looks like this

#AMI Filter for Windows Server 2019 Base

data "aws_ami" "windows" {
     most_recent = true
     filter {
       name   = "name"
       values = ["Windows_Server-2019-English-Full-Base-*"]
  }
     filter {
       name   = "virtualization-type"
       values = ["hvm"]
  }
     owners = ["801119661308"] ## Canonical
}

The argument most_recent is set to true. This means that it will grab the most recent AMI that fits the criteria that we specify in our filter.

Next you will notice that in the name we set the value to *Windows_Server-2019-English-Full-Base- **with the star at the end. This lets Terraform know we don’t care about what text comes after that point and it was done because the standard format puts the date there. If we set the date the ami was created and set the most_recent argument to true it would not do us any good.

After that we set the virtualization-type to hvm. I am not going to go into a lot of detail here. Just know this is a good idea and do some additional research on hvm vs pv.

Last we set **owners **to 801119661308.

Now I am sure you are asking… how the heck do I actually get this information? Well you are going to have to run a quick command with the AWS cli.

First, login to AWS and get the ami you want to grab the information for. Here is an example:

Image for post

If you click on launch instance you can do a search.

#aws-ec2 #hashicorp-terraform #aws-cloudwatch #terraform-modules #terraform

Lindsey  Koepp

Lindsey Koepp

1603458624

A Beginner's Guide to Amazon EC2 (Elastic Compute Cloud)

Amazon EC2 is a service that allows you businesses to run their application in AWS cloud. You can easily set up a virtual machine and perform all your computation on it. In this post, we will teach you the basics of Amazon EC2.

Introduction

EC2 is one of the oldest and fundamental services of AWS. Though everything today is serverless, you still need to know EC2. EC2 allows you to do the following things :

  • Rent virtual machines (EC2 itself)
  • Store data on virtual drives (EBS)
  • Distribute load across the machines (ELB)
  • Scale the services using an auto-scaling group (ASG)

Amazon Machine Image – AMI

AMIs are the templates from which virtual servers (EC2 instance) get created.

In simple terms, AMIs are the collection of the operating system, architecture (32-bit or 64-bit) with the softwares that will be running on that operating system.

For example:

  • Amazon Linux AMI is the one that comes with a Linux operating system and many packages of the Linux that one might need.

  • Windows AMI comes with Windows as its operating system and software one might need.

By choosing AMI you basically decide the software part of your EC2 machine. You can use a single AMI and launch multiple instances from it.

#aws #aws-cloud #aws-iam #aws-certification #aws-top-story #ec2 #virtual-machine #amazon-web-services