↓ Skip to main content
DevOps

IaC: Infrastructure as Code

·2 mins

IaC tools like Terraform allows one to manage infrastructure with configuration files rather than through a graphical user interface.

From the official website of Terraform
From the official website of Terraform

Installation
#

I will cover steps to install on MAC OS using brew.

Install Tap
#

Learn about taps from here. — brew official documentation
brew tap hashicorp/tap

validate the tap is installed

> brew tap
hashicorp/tap

Install Terraform
#

brew install hashicorp/tap/terraform && brew update

Validate installation
#

terraform -h
Usage: terraform [global options] <subcommand> [args]

The available commands for execution are listed below.
The primary workflow commands are given first, followed by
less common or more advanced commands.

Main commands:
  init          Prepare your working directory for other commands
  validate      Check whether the configuration is valid
  plan          Show changes required by the current configuration
  apply         Create or update infrastructure
  destroy       Destroy previously-created infrastructure

All other commands:
  console       Try Terraform expressions at an interactive command prompt
  fmt           Reformat your configuration in the standard style
  force-unlock  Release a stuck lock on the current workspace
  get           Install or upgrade remote Terraform modules
  graph         Generate a Graphviz graph of the steps in an operation
  import        Associate existing infrastructure with a Terraform resource
  login         Obtain and save credentials for a remote host
  logout        Remove locally-stored credentials for a remote host
  output        Show output values from your root module
  providers     Show the providers required for this configuration
  refresh       Update the state to match remote systems
  show          Show the current state or a saved plan
  state         Advanced state management
  taint         Mark a resource instance as not fully functional
  test          Experimental support for module integration testing
  untaint       Remove the 'tainted' state from a resource instance
  version       Show the current Terraform version
  workspace     Workspace management

Global options (use these before the subcommand, if any):
  -chdir=DIR    Switch to a different working directory before executing the
                given subcommand.
  -help         Show this help output, or the help for
Author
Samarthya
Engineer, learner, tinkerer. This is my trophy shelf of everyday work and leisure.

Related

Spinnaker: Artifact Helm

In this blog let’s try add a helm account and enable for use in the pipelines bash-5.0$ hal config artifact helm account get dev-helm-ac + Get current deployment Success + Get dev-helm-ac artifact account Success + Artifact account dev-helm-ac: HelmArtifactAccount(name=dev-helm-ac, repository=https://helm-dev-local.artifactory.net/artifactory/helm-dev-local, username=myaccount, password=samplepassword, usernamePasswordFile=/home/spinnaker/.hal/helm_password) The steps I followed are explained in detail here.

Spinnaker: Open Source Deployment

I have written a series of blogs to capture how you can deploy spinnaker on a Kubernetes cluster & manage a helm chart deployment via pipeline. The only way to enable more frequent changes is to invest in supporting people with better tooling, practices, and culture From the Book Spinnaker

Spinnaker: docker-registry

You will need a valid docker registry before you add any trigger in the pipeline in Spinnaker Official documentation is a good resource to seek more clarifications — Spinnaker In my case I have already added an account my-docker-registry as under (The final result after you successfully configure Docker.