Devops, Continuous Integration and Deployment Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/category/technology/languages-platforms-object-oriented-observations/devops-continuous-integration-and-deployment/ Production Grade Technical Solutions | Data Encryption and Public Cloud Expert Tue, 27 Apr 2021 01:20:38 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.2 https://www.anujvarma.com/wp-content/uploads/anujtech.png Devops, Continuous Integration and Deployment Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/category/technology/languages-platforms-object-oriented-observations/devops-continuous-integration-and-deployment/ 32 32 Terraform Basics and Helpful Commands https://www.anujvarma.com/terraform-basics-and-helpful-commands/ https://www.anujvarma.com/terraform-basics-and-helpful-commands/#respond Sat, 04 Jul 2020 02:13:23 +0000 https://www.anujvarma.com/?p=6529 Overview These are just some quick recap notes and troubleshooting steps. There’s much more to terraform, but this is a quick basics overview, getting started guide and a short troubleshooting […]

The post Terraform Basics and Helpful Commands appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Overview

These are just some quick recap notes and troubleshooting steps. There’s much more to terraform, but this is a quick basics overview, getting started guide and a short troubleshooting guide.

How does Terraform translate it’s resource definitions to the target cloud?

Terraform works via a ‘provider’ resource for each cloud platform. The provider translates the resource definitions in the .tf file – to API calls (e.g. AWS API calls for the AWS provider).  There are cases where certain features are only available in AWS CLI – and not via API (such as enabling MFA on s3 buckets). In these rare cases, the default provider for aws will not work.
The provider feature is what makes terraform both cloud agnostic and super flexible.
For e.g. if you don’t like AWS Cloudfront and want to use Cloudflare as your cdn on aws – you simply plug in a cloudflare terraform provider.   Same for if you do not like route 53 and want to use another dns service. Here is a list of all the terraform providers (they keep adding more)

Terraform planning and applying

After applying, Terraform maintains a snapshot of the state of resources it provisioned. This is stored in a .tfstate file and is used as the baseline for future plan and apply executions.

 After a while of using Terraform, I realized, if I ever wanted to know if something had unintentionally changed in our infrastructure, I just needed to run plan and see if Terraform intended to do anything.

If anything was changed intentionally, then it would have been in the source code and Terraform would not plan to do anything. However, if anyone changed any part of our AWS infrastructure manually, Terraform’s plan would identify it and let us know.

In other words, if our AWS or GCP infrastructure drifted from its expected state, then Terraform’s plan would detect it.

Local Setup with credentials (AWS , GCP Providers)

Google Provider (Download the json formatted key for your service account from Google’s Console. That’s what account.json refers to)

provider "google" {
  credentials = file("account.json")
  project     = "my-project-id"
  region      = "us-central1"
}

AWS Provider
provider "aws" {
  version = "~> 2.0"
  region  = "us-east-1"
}

Validating, Planning and Applying

terraform validate

terraform plan

terraform apply

Formatting Code

terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style.

Targeting Specific Resources instead of ALL Resources in your TF module

terraform apply -target=google_storage_bucket.my_storage_bucket

Troubleshooting Debugging

Terraform apply can fail without giving a meaningful reason. To see the underlying reason, you have to enable TF_LOG = “debug”. On a windows machine, fire up a powershell prompt to do do. On a Linux box, a bash prompt will do the same.

From a powershell prompt, type 
$env:TF_LOG="config"

Sometimes, your debug trace will show 'resource tainted'. To untaint tainted resources 

terraform untaint resourcename

String  Concat

format("%s/%s",var.string,"string2")

Summary

These are just some quick recap notes and troubleshooting steps. There’s much more to terraform, but this is a quick basics overview, getting started guide and a short troubleshooting guide.


Need an experienced AWS/GCP/Azure Professional to help out with your Public Cloud Strategy? Set up a time with Anuj Varma.

The post Terraform Basics and Helpful Commands appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/terraform-basics-and-helpful-commands/feed/ 0
DevOps (Agile) versus QA (Waterfall, SDLC) https://www.anujvarma.com/devops-versus-qa-sdlc/ https://www.anujvarma.com/devops-versus-qa-sdlc/#respond Fri, 05 May 2017 15:46:26 +0000 http://www.anujvarma.com/?p=4689 When working within the TOGAF framework, it is important to propose the right architecture for the right development methodology.  For example, for an Agile methodology, there would be a heavy […]

The post DevOps (Agile) versus QA (Waterfall, SDLC) appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
When working within the TOGAF framework, it is important to propose the right architecture for the right development methodology. 

For example, for an Agile methodology, there would be a heavy component of CI (Continuous Integration) and CD (Continuous Delivery).  For a waterfall model, not so much CI and CD as there would be QA.

Tools

DevOps entails the use of tools such as BUGtrack, JIRA and GitHub.  Test automation tools including Selenium, Cucumber, JUnit, TestNG and JMeter manage, execute and measure functional tests and cycles.

QA uses standard lifecycle management tools – such as HP ALM.

The post DevOps (Agile) versus QA (Waterfall, SDLC) appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/devops-versus-qa-sdlc/feed/ 0