{"id":2083,"date":"2022-02-08T07:30:42","date_gmt":"2022-02-08T07:30:42","guid":{"rendered":"https:\/\/blog.samarthya.me\/wps\/?p=2083"},"modified":"2022-02-08T07:30:45","modified_gmt":"2022-02-08T07:30:45","slug":"iac-infrastructure-as-code","status":"publish","type":"post","link":"https:\/\/blog.samarthya.me\/wps\/2022\/02\/08\/iac-infrastructure-as-code\/","title":{"rendered":"IaC: Infrastructure as Code"},"content":{"rendered":"\n<p>IaC tools like <code>Terraform<\/code> allows one to manage infrastructure with configuration files rather than through a graphical user interface.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img decoding=\"async\" src=\"https:\/\/learn.hashicorp.com\/img\/terraform\/terraform-iac.png\" alt=\"\"\/><figcaption>From the official website of Terraform<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installation\">Installation<\/h2>\n\n\n\n<p>I will cover steps to install on MAC OS using brew.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-tap\">Install Tap<\/h3>\n\n\n\n<figure class=\"wp-block-pullquote has-white-color has-black-background-color has-text-color has-background\"><blockquote><p>Learn about taps from <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.brew.sh\/Taps\" target=\"_blank\">here<\/a>.<\/p><cite>brew official documentation<\/cite><\/blockquote><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>brew tap hashicorp\/tap<\/code><\/pre>\n\n\n\n<p>validate the tap is installed<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> brew tap\nhashicorp\/tap<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-terraform\">Install Terraform<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install hashicorp\/tap\/terraform &amp;&amp; brew update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"validate-installation\">Validate installation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>terraform -h\nUsage: terraform &#91;global options] &lt;subcommand> &#91;args]\n\nThe available commands for execution are listed below.\nThe primary workflow commands are given first, followed by\nless common or more advanced commands.\n\nMain commands:\n  init          Prepare your working directory for other commands\n  validate      Check whether the configuration is valid\n  plan          Show changes required by the current configuration\n  apply         Create or update infrastructure\n  destroy       Destroy previously-created infrastructure\n\nAll other commands:\n  console       Try Terraform expressions at an interactive command prompt\n  fmt           Reformat your configuration in the standard style\n  force-unlock  Release a stuck lock on the current workspace\n  get           Install or upgrade remote Terraform modules\n  graph         Generate a Graphviz graph of the steps in an operation\n  import        Associate existing infrastructure with a Terraform resource\n  login         Obtain and save credentials for a remote host\n  logout        Remove locally-stored credentials for a remote host\n  output        Show output values from your root module\n  providers     Show the providers required for this configuration\n  refresh       Update the state to match remote systems\n  show          Show the current state or a saved plan\n  state         Advanced state management\n  taint         Mark a resource instance as not fully functional\n  test          Experimental support for module integration testing\n  untaint       Remove the 'tainted' state from a resource instance\n  version       Show the current Terraform version\n  workspace     Workspace management\n\nGlobal options (use these before the subcommand, if any):\n  -chdir=DIR    Switch to a different working directory before executing the\n                given subcommand.\n  -help         Show this help output, or the help for <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>IaC tools like Terraform allows one to manage infrastructure with configuration files rather than through a graphical user interface. Installation I will cover steps to install on MAC OS using brew. Install Tap Learn about taps from here. brew official documentation validate the tap is installed Install Terraform Validate installation<\/p>\n","protected":false},"author":1,"featured_media":2084,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[233,34],"tags":[234,235],"class_list":["post-2083","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-iac","category-technical","tag-iac","tag-terraform","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/2083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/comments?post=2083"}],"version-history":[{"count":0,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/2083\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media\/2084"}],"wp:attachment":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media?parent=2083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/categories?post=2083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/tags?post=2083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}