You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
218 KiB
218 KiB
<html>
<head>
</head>
</html>
In [1]:
!brew install fetch
!mkdir temp
%pip install requests-html
%pip install html2text
%pip install markdown
%pip install python-frontmatter
%pip install readability-lxml
Running `brew update --auto-update`... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). You have 19 outdated formulae installed. You can upgrade them with brew upgrade or list them with brew outdated. Warning: fetch 0.4.5 is already installed and up-to-date. To reinstall 0.4.5, run: brew reinstall fetch Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: requests-html in /home/donaldrich/.local/lib/python3.10/site-packages (0.10.0) Requirement already satisfied: fake-useragent in /home/donaldrich/.local/lib/python3.10/site-packages (from requests-html) (0.1.11) Requirement already satisfied: pyquery in /home/donaldrich/.local/lib/python3.10/site-packages (from requests-html) (1.4.3) Requirement already satisfied: pyppeteer>=0.0.14 in /home/donaldrich/.local/lib/python3.10/site-packages (from requests-html) (1.0.2) Requirement already satisfied: bs4 in /home/donaldrich/.local/lib/python3.10/site-packages (from requests-html) (0.0.1) Requirement already satisfied: w3lib in /home/donaldrich/.local/lib/python3.10/site-packages (from requests-html) (1.22.0) Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from requests-html) (2.25.1) Requirement already satisfied: parse in /home/donaldrich/.local/lib/python3.10/site-packages (from requests-html) (1.19.0) Requirement already satisfied: urllib3<2.0.0,>=1.25.8 in /usr/lib/python3/dist-packages (from pyppeteer>=0.0.14->requests-html) (1.26.5) Requirement already satisfied: tqdm<5.0.0,>=4.42.1 in /home/donaldrich/.local/lib/python3.10/site-packages (from pyppeteer>=0.0.14->requests-html) (4.64.0) Requirement already satisfied: pyee<9.0.0,>=8.1.0 in /home/donaldrich/.local/lib/python3.10/site-packages (from pyppeteer>=0.0.14->requests-html) (8.2.2) Requirement already satisfied: websockets<11.0,>=10.0 in /home/donaldrich/.local/lib/python3.10/site-packages (from pyppeteer>=0.0.14->requests-html) (10.3) Requirement already satisfied: appdirs<2.0.0,>=1.4.3 in /home/donaldrich/.local/lib/python3.10/site-packages (from pyppeteer>=0.0.14->requests-html) (1.4.3) Requirement already satisfied: certifi>=2021 in /home/donaldrich/.local/lib/python3.10/site-packages (from pyppeteer>=0.0.14->requests-html) (2022.6.15) Requirement already satisfied: importlib-metadata>=1.4 in /home/donaldrich/.local/lib/python3.10/site-packages (from pyppeteer>=0.0.14->requests-html) (4.12.0) Requirement already satisfied: beautifulsoup4 in /home/donaldrich/.local/lib/python3.10/site-packages (from bs4->requests-html) (4.11.1) Requirement already satisfied: cssselect>0.7.9 in /home/donaldrich/.local/lib/python3.10/site-packages (from pyquery->requests-html) (1.1.0) Requirement already satisfied: lxml>=2.1 in /usr/lib/python3/dist-packages (from pyquery->requests-html) (4.8.0) Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from w3lib->requests-html) (1.16.0) Requirement already satisfied: zipp>=0.5 in /usr/lib/python3/dist-packages (from importlib-metadata>=1.4->pyppeteer>=0.0.14->requests-html) (1.0.0) Requirement already satisfied: soupsieve>1.2 in /home/donaldrich/.local/lib/python3.10/site-packages (from beautifulsoup4->bs4->requests-html) (2.3.2.post1) Note: you may need to restart the kernel to use updated packages. Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: html2text in /home/donaldrich/.local/lib/python3.10/site-packages (2020.1.16) Note: you may need to restart the kernel to use updated packages. Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: markdown in /home/donaldrich/.local/lib/python3.10/site-packages (3.4.1) Note: you may need to restart the kernel to use updated packages. Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: python-frontmatter in /home/donaldrich/.local/lib/python3.10/site-packages (1.0.0) Requirement already satisfied: PyYAML in /home/donaldrich/.local/lib/python3.10/site-packages (from python-frontmatter) (5.1) Note: you may need to restart the kernel to use updated packages. Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: readability-lxml in /home/donaldrich/.local/lib/python3.10/site-packages (0.8.1) Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (from readability-lxml) (4.8.0) Requirement already satisfied: cssselect in /home/donaldrich/.local/lib/python3.10/site-packages (from readability-lxml) (1.1.0) Requirement already satisfied: chardet in /usr/lib/python3/dist-packages (from readability-lxml) (4.0.0) Note: you may need to restart the kernel to use updated packages.
url = "https://spacelift.io/blog/terraform-commands-cheat-sheet" https://spacelift.io/blog/terraform https://res.cloudinary.com/acloud-guru/image/fetch/c_thumb,f_auto,q_auto/https://acg-wordpress-content-production.s3.us-west-2.amazonaws.com/app/uploads/2020/11/terraform-cheatsheet-from-ACG.pdf https://www.techbeatly.com/terraform-cheat-sheet https://jayendrapatil.com/terraform-cheat-sheet/ https://github.com/antonbabenko/terraform-best-practices.git
In [15]:
!curl -fLvo tf.pdf https://res.cloudinary.com/acloud-guru/image/fetch/c_thumb,f_auto,q_auto/https://acg-wordpress-content-production.s3.us-west-2.amazonaws.com/app/uploads/2020/11/terraform-cheatsheet-from-ACG.pdf
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 151.101.129.137:443...
* Connected to res.cloudinary.com (151.101.129.137) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.2 (IN), TLS header, Certificate Status (22):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.2 (IN), TLS header, Finished (20):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2999 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.2 (OUT), TLS header, Finished (20):
} [5 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=IL; L=Petah Tikva; O=Cloudinary Ltd; CN=*.cloudinary.com
* start date: May 30 06:40:39 2022 GMT
* expire date: Jul 1 06:40:39 2023 GMT
* subjectAltName: host "res.cloudinary.com" matched cert's "*.cloudinary.com"
* issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
* SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x55cc70ee6e80)
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
> GET /acloud-guru/image/fetch/c_thumb,f_auto,q_auto/https://acg-wordpress-content-production.s3.us-west-2.amazonaws.com/app/uploads/2020/11/terraform-cheatsheet-from-ACG.pdf HTTP/2
> Host: res.cloudinary.com
> user-agent: curl/7.81.0
> accept: */*
>
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [193 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
< HTTP/2 200
< content-type: image/png
< etag: "4c05202557d1f3a51bac32d0ca142fe8"
< last-modified: Mon, 23 Nov 2020 21:34:47 GMT
< date: Wed, 10 Aug 2022 09:16:25 GMT
< vary: Save-Data
< strict-transport-security: max-age=604800
< cache-control: private, no-transform, immutable, max-age=604800
< server-timing: fastly;dur=2;cpu=1;start=2022-08-10T09:16:25.962Z;desc=hit,rtt;dur=92
< server: Cloudinary
< timing-allow-origin: *
< access-control-allow-origin: *
< accept-ranges: bytes
< x-content-type-options: nosniff
< access-control-expose-headers: Content-Length,ETag,Server-Timing,Vary,X-Content-Type-Options
< content-length: 432177
<
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
100 422k 100 422k 0 0 1685k 0 --:--:-- --:--:-- --:--:-- 1688k
* Connection #0 to host res.cloudinary.com left intact
In [14]:
from requests_html import HTMLSession
session = HTMLSession()
r = session.get("https://www.techbeatly.com/terraform-cheat-sheet")
print(r.text)
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="profile" href="https://gmpg.org/xfn/11" />
<title>Terraform Cheat Sheet – techbeatly</title>
<meta name='robots' content='max-image-preview:large' />
<script type="92814b2e02b11c1b32c775f9-text/javascript">document.documentElement.className = document.documentElement.className.replace("no-js","js");</script>
<link rel='dns-prefetch' href='//www.techbeatly.com' />
<link rel='dns-prefetch' href='//www.googletagmanager.com' />
<link rel='dns-prefetch' href='//s.w.org' />
<link rel='dns-prefetch' href='//v0.wordpress.com' />
<link rel='dns-prefetch' href='//widgets.wp.com' />
<link rel='dns-prefetch' href='//c0.wp.com' />
<link rel='dns-prefetch' href='//pagead2.googlesyndication.com' />
<link rel="alternate" type="application/rss+xml" title="techbeatly » Feed" href="https://www.techbeatly.com/feed/" />
<link rel="alternate" type="application/rss+xml" title="techbeatly » Comments Feed" href="https://www.techbeatly.com/comments/feed/" />
<link rel="alternate" type="application/rss+xml" title="techbeatly » Terraform Cheat Sheet Comments Feed" href="https://www.techbeatly.com/terraform-cheat-sheet/feed/" />
<script type="92814b2e02b11c1b32c775f9-text/javascript">
window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/www.techbeatly.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=6.0.1"}};
/*! This file is auto-generated */
!function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode,e=(p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0),i.toDataURL());return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])?!1:!s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([129777,127995,8205,129778,127999],[129777,127995,8203,129778,127999])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(e=t.source||{}).concatemoji?c(e.concatemoji):e.wpemoji&&e.twemoji&&(c(e.twemoji),c(e.wpemoji)))}(window,document,window._wpemojiSettings);
</script>
<style>
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 0.07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
<link rel='stylesheet' id='wp-block-library-css' href='https://c0.wp.com/c/6.0.1/wp-includes/css/dist/block-library/style.min.css' media='all' />
<style id='wp-block-library-inline-css'>
.has-text-align-justify{text-align:justify;}
</style>
<link rel='stylesheet' id='mediaelement-css' href='https://c0.wp.com/c/6.0.1/wp-includes/js/mediaelement/mediaelementplayer-legacy.min.css' media='all' />
<link rel='stylesheet' id='wp-mediaelement-css' href='https://c0.wp.com/c/6.0.1/wp-includes/js/mediaelement/wp-mediaelement.min.css' media='all' />
<style id='global-styles-inline-css'>
body{--wp--preset--color--black: #000000;--wp--preset--color--cyan-bluish-gray: #abb8c3;--wp--preset--color--white: #ffffff;--wp--preset--color--pale-pink: #f78da7;--wp--preset--color--vivid-red: #cf2e2e;--wp--preset--color--luminous-vivid-orange: #ff6900;--wp--preset--color--luminous-vivid-amber: #fcb900;--wp--preset--color--light-green-cyan: #7bdcb5;--wp--preset--color--vivid-green-cyan: #00d084;--wp--preset--color--pale-cyan-blue: #8ed1fc;--wp--preset--color--vivid-cyan-blue: #0693e3;--wp--preset--color--vivid-purple: #9b51e0;--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple: linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%);--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan: linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%);--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange: linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%);--wp--preset--gradient--luminous-vivid-orange-to-vivid-red: linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%);--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray: linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%);--wp--preset--gradient--cool-to-warm-spectrum: linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%);--wp--preset--gradient--blush-light-purple: linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%);--wp--preset--gradient--blush-bordeaux: linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%);--wp--preset--gradient--luminous-dusk: linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%);--wp--preset--gradient--pale-ocean: linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%);--wp--preset--gradient--electric-grass: linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%);--wp--preset--gradient--midnight: linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%);--wp--preset--duotone--dark-grayscale: url('#wp-duotone-dark-grayscale');--wp--preset--duotone--grayscale: url('#wp-duotone-grayscale');--wp--preset--duotone--purple-yellow: url('#wp-duotone-purple-yellow');--wp--preset--duotone--blue-red: url('#wp-duotone-blue-red');--wp--preset--duotone--midnight: url('#wp-duotone-midnight');--wp--preset--duotone--magenta-yellow: url('#wp-duotone-magenta-yellow');--wp--preset--duotone--purple-green: url('#wp-duotone-purple-green');--wp--preset--duotone--blue-orange: url('#wp-duotone-blue-orange');--wp--preset--font-size--small: 13px;--wp--preset--font-size--medium: 20px;--wp--preset--font-size--large: 36px;--wp--preset--font-size--x-large: 42px;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-color{color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-color{color: var(--wp--preset--color--white) !important;}.has-pale-pink-color{color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-color{color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-color{color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-color{color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-color{color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-color{color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-color{color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-color{color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-color{color: var(--wp--preset--color--vivid-purple) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-background-color{background-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-pale-pink-background-color{background-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-background-color{background-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-background-color{background-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-background-color{background-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-background-color{background-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-background-color{background-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-background-color{background-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-background-color{background-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-background-color{background-color: var(--wp--preset--color--vivid-purple) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-border-color{border-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-pale-pink-border-color{border-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-border-color{border-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-border-color{border-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-border-color{border-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-border-color{border-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-border-color{border-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-border-color{border-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-border-color{border-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-border-color{border-color: var(--wp--preset--color--vivid-purple) !important;}.has-vivid-cyan-blue-to-vivid-purple-gradient-background{background: var(--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple) !important;}.has-light-green-cyan-to-vivid-green-cyan-gradient-background{background: var(--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan) !important;}.has-luminous-vivid-amber-to-luminous-vivid-orange-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange) !important;}.has-luminous-vivid-orange-to-vivid-red-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-orange-to-vivid-red) !important;}.has-very-light-gray-to-cyan-bluish-gray-gradient-background{background: var(--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray) !important;}.has-cool-to-warm-spectrum-gradient-background{background: var(--wp--preset--gradient--cool-to-warm-spectrum) !important;}.has-blush-light-purple-gradient-background{background: var(--wp--preset--gradient--blush-light-purple) !important;}.has-blush-bordeaux-gradient-background{background: var(--wp--preset--gradient--blush-bordeaux) !important;}.has-luminous-dusk-gradient-background{background: var(--wp--preset--gradient--luminous-dusk) !important;}.has-pale-ocean-gradient-background{background: var(--wp--preset--gradient--pale-ocean) !important;}.has-electric-grass-gradient-background{background: var(--wp--preset--gradient--electric-grass) !important;}.has-midnight-gradient-background{background: var(--wp--preset--gradient--midnight) !important;}.has-small-font-size{font-size: var(--wp--preset--font-size--small) !important;}.has-medium-font-size{font-size: var(--wp--preset--font-size--medium) !important;}.has-large-font-size{font-size: var(--wp--preset--font-size--large) !important;}.has-x-large-font-size{font-size: var(--wp--preset--font-size--x-large) !important;}
</style>
<link rel='stylesheet' id='sek-base-light-css' href='https://www.techbeatly.com/wp-content/plugins/nimble-builder/assets/front/css/sek-base-light.min.css?ver=3.3.1' media='all' />
<link rel='stylesheet' id='simple-banner-style-css' href='https://www.techbeatly.com/wp-content/plugins/simple-banner/simple-banner.css?ver=2.12.0' media='all' />
<link rel='stylesheet' id='hueman-main-style-css' href='https://www.techbeatly.com/wp-content/themes/hueman/assets/front/css/main.min.css?ver=3.7.22' media='all' />
<style id='hueman-main-style-inline-css'>
body { font-family:Arial, sans-serif;font-size:1.00rem }@media only screen and (min-width: 720px) {
.nav > li { font-size:1.00rem; }
}.container-inner { max-width: 1150px; }::selection { background-color: #074ab3; }
::-moz-selection { background-color: #074ab3; }a,a>span.hu-external::after,.themeform label .required,#flexslider-featured .flex-direction-nav .flex-next:hover,#flexslider-featured .flex-direction-nav .flex-prev:hover,.post-hover:hover .post-title a,.post-title a:hover,.sidebar.s1 .post-nav li a:hover i,.content .post-nav li a:hover i,.post-related a:hover,.sidebar.s1 .widget_rss ul li a,#footer .widget_rss ul li a,.sidebar.s1 .widget_calendar a,#footer .widget_calendar a,.sidebar.s1 .alx-tab .tab-item-category a,.sidebar.s1 .alx-posts .post-item-category a,.sidebar.s1 .alx-tab li:hover .tab-item-title a,.sidebar.s1 .alx-tab li:hover .tab-item-comment a,.sidebar.s1 .alx-posts li:hover .post-item-title a,#footer .alx-tab .tab-item-category a,#footer .alx-posts .post-item-category a,#footer .alx-tab li:hover .tab-item-title a,#footer .alx-tab li:hover .tab-item-comment a,#footer .alx-posts li:hover .post-item-title a,.comment-tabs li.active a,.comment-awaiting-moderation,.child-menu a:hover,.child-menu .current_page_item > a,.wp-pagenavi a{ color: #074ab3; }input[type="submit"],.themeform button[type="submit"],.sidebar.s1 .sidebar-top,.sidebar.s1 .sidebar-toggle,#flexslider-featured .flex-control-nav li a.flex-active,.post-tags a:hover,.sidebar.s1 .widget_calendar caption,#footer .widget_calendar caption,.author-bio .bio-avatar:after,.commentlist li.bypostauthor > .comment-body:after,.commentlist li.comment-author-admin > .comment-body:after{ background-color: #074ab3; }.post-format .format-container { border-color: #074ab3; }.sidebar.s1 .alx-tabs-nav li.active a,#footer .alx-tabs-nav li.active a,.comment-tabs li.active a,.wp-pagenavi a:hover,.wp-pagenavi a:active,.wp-pagenavi span.current{ border-bottom-color: #074ab3!important; }.sidebar.s2 .post-nav li a:hover i,
.sidebar.s2 .widget_rss ul li a,
.sidebar.s2 .widget_calendar a,
.sidebar.s2 .alx-tab .tab-item-category a,
.sidebar.s2 .alx-posts .post-item-category a,
.sidebar.s2 .alx-tab li:hover .tab-item-title a,
.sidebar.s2 .alx-tab li:hover .tab-item-comment a,
.sidebar.s2 .alx-posts li:hover .post-item-title a { color: #0082d8; }
.sidebar.s2 .sidebar-top,.sidebar.s2 .sidebar-toggle,.post-comments,.jp-play-bar,.jp-volume-bar-value,.sidebar.s2 .widget_calendar caption{ background-color: #0082d8; }.sidebar.s2 .alx-tabs-nav li.active a { border-bottom-color: #0082d8; }
.post-comments::before { border-right-color: #0082d8; }
.is-scrolled #header #nav-mobile { background-color: #454e5c; background-color: rgba(69,78,92,0.90) }#footer-bottom { background-color: #1a1a1a; }.sidebar.expanding, .sidebar.collapsing, .sidebar .sidebar-content, .sidebar .sidebar-toggle, .container-inner > .main::before,.container-inner > .main::after { background-color: #f5f9f6; }@media only screen and (min-width: 480px) and (max-width: 1200px) { .s2.expanded { background-color: #f5f9f6; } }@media only screen and (min-width: 480px) and (max-width: 960px) { .s1.expanded { background-color: #f5f9f6; } }
</style>
<link rel='stylesheet' id='theme-stylesheet-css' href='https://www.techbeatly.com/wp-content/themes/hueman-child/style.css?ver=1.0.0' media='all' />
<link rel='stylesheet' id='hueman-font-awesome-css' href='https://www.techbeatly.com/wp-content/themes/hueman/assets/front/css/font-awesome.min.css?ver=3.7.22' media='all' />
<link crossorigin="anonymous" rel='stylesheet' id='open-sans-css' href='https://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&display=fallback&ver=6.0.1' media='all' />
<link rel='stylesheet' id='tmm-css' href='https://www.techbeatly.com/wp-content/plugins/team-members/inc/css/tmm_style.css?ver=6.0.1' media='all' />
<link rel='stylesheet' id='sek-dyn-skp__all_post-css' href='https://www.techbeatly.com/wp-content/uploads/nimble_css/skp__all_post.css?ver=1660112369' media='all' />
<link rel='stylesheet' id='sek-dyn-skp__global-css' href='https://www.techbeatly.com/wp-content/uploads/nimble_css/skp__global.css?ver=1660112369' media='all' />
<link rel='stylesheet' id='social-logos-css' href='https://c0.wp.com/p/jetpack/11.2/_inc/social-logos/social-logos.min.css' media='all' />
<link rel='stylesheet' id='jetpack_css-css' href='https://c0.wp.com/p/jetpack/11.2/css/jetpack.css' media='all' />
<script id='jetpack_related-posts-js-extra' type="92814b2e02b11c1b32c775f9-text/javascript">
var related_posts_js_options = {"post_heading":"h4"};
</script>
<script src='https://c0.wp.com/p/jetpack/11.2/_inc/build/related-posts/related-posts.min.js' id='jetpack_related-posts-js' type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script id='nb-js-app-js-extra' type="92814b2e02b11c1b32c775f9-text/javascript">
var sekFrontLocalized = {"isDevMode":"","isCustomizing":"","frontNonce":{"id":"SEKFrontNonce","handle":"ce23373276"},"skope_id":"skp__post_post_10240","recaptcha_public_key":"","lazyload_enabled":"1","video_bg_lazyload_enabled":"1","load_front_assets_on_dynamically":"1","assetVersion":"3.3.1","frontAssetsPath":"https:\/\/www.techbeatly.com\/wp-content\/plugins\/nimble-builder\/assets\/front\/","contextuallyActiveModules":{"czr_tiny_mce_editor_module":["__nimble__87c2b0051b1a","__nimble__9fc89e53cae5","__nimble__12d6cb3caed8","__nimble__d21bec8f90a2","__nimble__282fc9ce9c3a","__nimble__c63acc4a4bde","__nimble__bc1b1fb36c62","__nimble__f0379886e7b9","__nimble__95c293730d7f","__nimble__f7c5037e1a31","__nimble__3e0fbb63f6c9","__nimble__62d9bb31fba2","__nimble__4158a1fb3ace","__nimble__0d279d61ad33","__nimble__d30c0fe27575"],"czr_heading_module":["__nimble__39de2c57eeef","__nimble__2e1151afbab0","__nimble__fbd86554a224","__nimble__fd17d30be11a","__nimble__8f7390830e43","__nimble__43c421be0915","__nimble__673ccc5c49b5"],"czr_spacer_module":["__nimble__c5b63c556e8b","__nimble__fdaea2459ac4"],"czr_widget_area_module":["__nimble__73dad4725d84","__nimble__e7d46f22c6a9","__nimble__004a3f62741a","__nimble__2dfb3c986a52","__nimble__8586d69490c5"],"czr_divider_module":["__nimble__f0bcf0d5a113","__nimble__aa5734a12fbf"],"czr_post_grid_module":["__nimble__5ffb85166874","__nimble__1de5cee682db","__nimble__e9a32aa82e20","__nimble__911137c72348"],"czr_simple_html_module":["__nimble__f42d6388016e","__nimble__6f3cf33cbb91","__nimble__8bb5099721f2","__nimble__6ddcbd06a0fd","__nimble__2f037a87d6e4"],"czr_image_module":["__nimble__20afffa6494f","__nimble__400b8557aa06"],"czr_menu_module":["__nimble__0be653a19905"],"czr_social_icons_module":["__nimble__e69a9539c9b8"]},"fontAwesomeAlreadyEnqueued":"","partialFrontScripts":{"slider-module":"nb-needs-swiper","menu-module":"nb-needs-menu-js","front-parallax":"nb-needs-parallax","accordion-module":"nb-needs-accordion"}};
</script>
<script id='nb-js-app-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
window.nb_={},function(e,t){if(window.nb_={isArray:function(e){return Array.isArray(e)||"[object Array]"===toString.call(e)},inArray:function(e,t){return!(!nb_.isArray(e)||nb_.isUndefined(t))&&e.indexOf(t)>-1},isUndefined:function(e){return void 0===e},isObject:function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},errorLog:function(){nb_.isUndefined(console)||"function"!=typeof window.console.log||console.log.apply(console,arguments)},hasPreloadSupport:function(e){var t=document.createElement("link").relList;return!(!t||!t.supports)&&t.supports("preload")},listenTo:function(e,t){nb_.eventsListenedTo.push(e);var n={"nb-jquery-loaded":function(){return"undefined"!=typeof jQuery},"nb-app-ready":function(){return void 0!==window.nb_&&nb_.wasListenedTo("nb-jquery-loaded")},"nb-swipebox-parsed":function(){return"undefined"!=typeof jQuery&&void 0!==jQuery.fn.swipebox},"nb-main-swiper-parsed":function(){return void 0!==window.Swiper}},o=function(o){nb_.isUndefined(n[e])||!1!==n[e]()?t():nb_.errorLog("Nimble error => an event callback could not be fired because conditions not met => ",e,nb_.eventsListenedTo,t)};"function"==typeof t?nb_.wasEmitted(e)?o():document.addEventListener(e,o):nb_.errorLog("Nimble error => listenTo func param is not a function for event => ",e)},eventsEmitted:[],eventsListenedTo:[],emit:function(e,t){if(!(nb_.isUndefined(t)||t.fire_once)||!nb_.wasEmitted(e)){var n=document.createEvent("Event");n.initEvent(e,!0,!0),document.dispatchEvent(n),nb_.eventsEmitted.push(e)}},wasListenedTo:function(e){return"string"==typeof e&&nb_.inArray(nb_.eventsListenedTo,e)},wasEmitted:function(e){return"string"==typeof e&&nb_.inArray(nb_.eventsEmitted,e)},isInScreen:function(e){if(!nb_.isObject(e))return!1;var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-n>=0)},isCustomizing:function(){return!1},isLazyLoadEnabled:function(){return!nb_.isCustomizing()&&!1},preloadOrDeferAsset:function(e){if(e=e||{},nb_.preloadedAssets=nb_.preloadedAssets||[],!nb_.inArray(nb_.preloadedAssets,e.id)){var t,n=document.getElementsByTagName("head")[0],o=function(){if("style"===e.as)this.setAttribute("rel","stylesheet"),this.setAttribute("type","text/css"),this.setAttribute("media","all");else{var t=document.createElement("script");t.setAttribute("src",e.href),t.setAttribute("id",e.id),"script"===e.as&&t.setAttribute("defer","defer"),n.appendChild(t),i.call(this)}e.eventOnLoad&&nb_.emit(e.eventOnLoad)},i=function(){if(this&&this.parentNode&&this.parentNode.contains(this))try{this.parentNode.removeChild(this)}catch(e){nb_.errorLog("NB error when removing a script el",el)}};("font"!==e.as||nb_.hasPreloadSupport())&&(t=document.createElement("link"),"script"===e.as?e.onEvent?nb_.listenTo(e.onEvent,function(){o.call(t)}):o.call(t):(t.setAttribute("href",e.href),"style"===e.as?t.setAttribute("rel",nb_.hasPreloadSupport()?"preload":"stylesheet"):"font"===e.as&&nb_.hasPreloadSupport()&&t.setAttribute("rel","preload"),t.setAttribute("id",e.id),t.setAttribute("as",e.as),"font"===e.as&&(t.setAttribute("type",e.type),t.setAttribute("crossorigin","anonymous")),t.onload=function(){this.onload=null,"font"!==e.as?e.onEvent?nb_.listenTo(e.onEvent,function(){o.call(t)}):o.call(t):e.eventOnLoad&&nb_.emit(e.eventOnLoad)},t.onerror=function(t){nb_.errorLog("Nimble preloadOrDeferAsset error",t,e)}),n.appendChild(t),nb_.preloadedAssets.push(e.id),i.call(e.scriptEl))}},mayBeRevealBG:function(){this.getAttribute("data-sek-src")&&(this.setAttribute("style",'background-image:url("'+this.getAttribute("data-sek-src")+'")'),this.className+=" sek-lazy-loaded",this.querySelectorAll(".sek-css-loader").forEach(function(e){nb_.isObject(e)&&e.parentNode.removeChild(e)}))}},window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var n=0;n<this.length;n++)e.call(t,this[n],n,this)}),nb_.listenTo("nb-docready",function(){var e=document.querySelectorAll("div.sek-has-bg");!nb_.isObject(e)||e.length<1||e.forEach(function(e){nb_.isObject(e)&&(window.sekFrontLocalized&&window.sekFrontLocalized.lazyload_enabled?nb_.isInScreen(e)&&nb_.mayBeRevealBG.call(e):nb_.mayBeRevealBG.call(e))})}),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll)nb_.emit("nb-docready");else{var n=function(){nb_.wasEmitted("nb-docready")||nb_.emit("nb-docready")};document.addEventListener("DOMContentLoaded",n),window.addEventListener("load",n)}}(window,document),function(){var e=function(){var e="nb-jquery-loaded";nb_.wasEmitted(e)||nb_.emit(e)},t=function(n){n=n||0,void 0!==window.jQuery?e():n<30?setTimeout(function(){t(++n)},200):window.console&&window.console.log&&console.log("Nimble Builder problem : jQuery.js was not detected on your website")},n=document.getElementById("nb-jquery");n&&n.addEventListener("load",function(){e()}),t()}(),window,document,nb_.listenTo("nb-jquery-loaded",function(){sekFrontLocalized.load_front_assets_on_dynamically&&(nb_.scriptsLoadingStatus={},nb_.ajaxLoadScript=function(e){jQuery(function(t){e=t.extend({path:"",complete:"",loadcheck:!1},e),nb_.scriptsLoadingStatus[e.path]&&"pending"===nb_.scriptsLoadingStatus[e.path].state()||(nb_.scriptsLoadingStatus[e.path]=nb_.scriptsLoadingStatus[e.path]||t.Deferred(),jQuery.ajax({url:sekFrontLocalized.frontAssetsPath+e.path+"?"+sekFrontLocalized.assetVersion,cache:!0,dataType:"script"}).done(function(){"function"!=typeof e.loadcheck||e.loadcheck()?"function"==typeof e.complete&&e.complete():nb_.errorLog("ajaxLoadScript success but loadcheck failed for => "+e.path)}).fail(function(){nb_.errorLog("ajaxLoadScript failed for => "+e.path)}))})})}),nb_.listenTo("nb-jquery-loaded",function(){jQuery(function(e){sekFrontLocalized.load_front_assets_on_dynamically&&(nb_.ajaxLoadScript({path:sekFrontLocalized.isDevMode?"js/ccat-nimble-front.js":"js/ccat-nimble-front.min.js"}),e.each(sekFrontLocalized.partialFrontScripts,function(e,t){nb_.listenTo(t,function(){nb_.ajaxLoadScript({path:sekFrontLocalized.isDevMode?"js/partials/"+e+".js":"js/partials/"+e+".min.js"})})}))})});
</script>
<script id="nb-jquery" src='https://c0.wp.com/c/6.0.1/wp-includes/js/jquery/jquery.min.js' id='jquery-core-js' type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script src='https://c0.wp.com/c/6.0.1/wp-includes/js/jquery/jquery-migrate.min.js' id='jquery-migrate-js' type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script src='https://www.techbeatly.com/wp-content/plugins/simple-banner/simple-banner.js?ver=2.12.0' id='simple-banner-script-js' type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script id='simple-banner-script-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
const simpleBannerScriptParams = {"version":"2.12.0","hide_simple_banner":"no","simple_banner_position":"sticky","header_margin":"","header_padding":"","simple_banner_text":"<a href=\"https:\/\/www.techbeatly.com\/k8s\" target=\"_blank\">Get up to 200USD OFF on CKA, CKAD, CKS, KCNA. Use TECHBEATLY15 at checkout. Check now !<\/a>","pro_version_enabled":"","disabled_on_current_page":false,"debug_mode":"","id":10240,"disabled_pages_array":[],"is_current_page_a_post":true,"disabled_on_posts":"","simple_banner_font_size":"16px","simple_banner_color":"#d6fffa","simple_banner_text_color":"#333333","simple_banner_link_color":"#333333","simple_banner_close_color":"","simple_banner_custom_css":"","simple_banner_scrolling_custom_css":"","simple_banner_text_custom_css":"line-height: 100%;","simple_banner_button_css":"","site_custom_css":"","keep_site_custom_css":"","site_custom_js":"","keep_site_custom_js":"","wp_body_open_enabled":"","wp_body_open":true,"close_button_enabled":"","close_button_expiration":"","close_button_cookie_set":false}
</script>
<script src='https://www.googletagmanager.com/gtag/js?id=UA-57016827-1' id='google_gtagjs-js' async type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script id='google_gtagjs-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}
gtag('set', 'linker', {"domains":["www.techbeatly.com"]} );
gtag("js", new Date());
gtag("set", "developer_id.dZTNiMT", true);
gtag("config", "UA-57016827-1", {"anonymize_ip":true});
</script>
<link rel="https://api.w.org/" href="https://www.techbeatly.com/wp-json/" /><link rel="alternate" type="application/json" href="https://www.techbeatly.com/wp-json/wp/v2/posts/10240" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.techbeatly.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://www.techbeatly.com/wp-includes/wlwmanifest.xml" />
<meta name="generator" content="WordPress 6.0.1" />
<link rel="canonical" href="https://www.techbeatly.com/terraform-cheat-sheet/" />
<link rel='shortlink' href='https://wp.me/p9ZggX-2Fa' />
<link rel="alternate" type="application/json+oembed" href="https://www.techbeatly.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.techbeatly.com%2Fterraform-cheat-sheet%2F" />
<link rel="alternate" type="text/xml+oembed" href="https://www.techbeatly.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.techbeatly.com%2Fterraform-cheat-sheet%2F&format=xml" />
<meta name="generator" content="Site Kit by Google 1.80.0" /><style type="text/css">.simple-banner{position:sticky;}</style><style type="text/css">.simple-banner .simple-banner-text{font-size:16px;}</style><style type="text/css">.simple-banner{background:#d6fffa;}</style><style type="text/css">.simple-banner .simple-banner-text{color:#333333;}</style><style type="text/css">.simple-banner .simple-banner-text a{color:#333333;}</style><style type="text/css">.simple-banner .simple-banner-text{line-height: 100%;}</style><style id="simple-banner-site-custom-css-dummy" type="text/css"></style><script id="simple-banner-site-custom-js-dummy" type="92814b2e02b11c1b32c775f9-text/javascript"></script><style>img#wpstats{display:none}</style>
<link rel="preload" as="font" type="font/woff2" href="https://www.techbeatly.com/wp-content/themes/hueman/assets/front/webfonts/fa-brands-400.woff2?v=5.15.2" crossorigin="anonymous" />
<link rel="preload" as="font" type="font/woff2" href="https://www.techbeatly.com/wp-content/themes/hueman/assets/front/webfonts/fa-regular-400.woff2?v=5.15.2" crossorigin="anonymous" />
<link rel="preload" as="font" type="font/woff2" href="https://www.techbeatly.com/wp-content/themes/hueman/assets/front/webfonts/fa-solid-900.woff2?v=5.15.2" crossorigin="anonymous" />
<!--[if lt IE 9]>
<script src="https://www.techbeatly.com/wp-content/themes/hueman/assets/front/js/ie/html5shiv-printshiv.min.js"></script>
<script src="https://www.techbeatly.com/wp-content/themes/hueman/assets/front/js/ie/selectivizr.js"></script>
<![endif]-->
<meta name="google-adsense-platform-account" content="ca-host-pub-2644536267352236">
<meta name="google-adsense-platform-domain" content="sitekit.withgoogle.com">
<style type="text/css">.broken_link, a.broken_link {
text-decoration: line-through;
}</style><link rel="amphtml" href="https://www.techbeatly.com/terraform-cheat-sheet/amp/">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1676785078101005" crossorigin="anonymous" type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
( function( w, d, s, l, i ) {
w[l] = w[l] || [];
w[l].push( {'gtm.start': new Date().getTime(), event: 'gtm.js'} );
var f = d.getElementsByTagName( s )[0],
j = d.createElement( s ), dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore( j, f );
} )( window, document, 'script', 'dataLayer', 'GTM-5ZGXRQT' );
</script>
<meta property="og:type" content="article" />
<meta property="og:title" content="Terraform Cheat Sheet" />
<meta property="og:url" content="https://www.techbeatly.com/terraform-cheat-sheet/" />
<meta property="og:description" content="This cheat sheet is a living document and I will make changes whenever there is an update or changes in the Terraform CLI options or versions." />
<meta property="article:published_time" content="2021-11-24T10:41:36+00:00" />
<meta property="article:modified_time" content="2021-12-15T04:46:26+00:00" />
<meta property="og:site_name" content="techbeatly" />
<meta property="og:image" content="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new.png" />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="720" />
<meta property="og:image:alt" content="" />
<meta property="og:locale" content="en_US" />
<meta name="twitter:creator" content="@techbeatly" />
<meta name="twitter:site" content="@techbeatly" />
<meta name="twitter:text:title" content="Terraform Cheat Sheet" />
<meta name="twitter:image" content="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new.png?w=640" />
<meta name="twitter:card" content="summary_large_image" />
<html lang="en" prefix="og: http://ogp.me/ns#">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-57016827-1" type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-57016827-1');
</script>
<meta name="yandex-verification" content="b79da0804a340282" />
<script id="mcjs" type="92814b2e02b11c1b32c775f9-text/javascript">!function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connected/js/users/51c4a353c6e7182c08f8fc921/6c3b82329269d0a4590b0ae2d.js");</script><link rel="icon" href="https://www.techbeatly.com/wp-content/uploads/2021/09/cropped-techbeatly-logo-v4-512x512-1-32x32.png" sizes="32x32" />
<link rel="icon" href="https://www.techbeatly.com/wp-content/uploads/2021/09/cropped-techbeatly-logo-v4-512x512-1-192x192.png" sizes="192x192" />
<link rel="apple-touch-icon" href="https://www.techbeatly.com/wp-content/uploads/2021/09/cropped-techbeatly-logo-v4-512x512-1-180x180.png" />
<meta name="msapplication-TileImage" content="https://www.techbeatly.com/wp-content/uploads/2021/09/cropped-techbeatly-logo-v4-512x512-1-270x270.png" />
<link rel="stylesheet" type="text/css" id="wp-custom-css" href="https://www.techbeatly.com/?custom-css=6cfa095ec0" /> </head>
<body class="nb-3-3-1 nimble-no-local-data-skp__post_post_10240 nimble-has-group-site-tmpl-skp__all_post nimble-site-tmpl__user_tmpl__nb_tmpl_post-v1 post-template-default single single-post postid-10240 single-format-standard wp-custom-logo wp-embed-responsive sek-hide-rc-badge nimble-template-enabled col-2cl full-width topbar-enabled header-desktop-sticky header-mobile-sticky hueman-3-7-22-with-child-theme hu-links-not-underlined safari">
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5ZGXRQT" height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-dark-grayscale"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0 0.49803921568627" /><feFuncG type="table" tableValues="0 0.49803921568627" /><feFuncB type="table" tableValues="0 0.49803921568627" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-grayscale"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0 1" /><feFuncG type="table" tableValues="0 1" /><feFuncB type="table" tableValues="0 1" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-purple-yellow"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0.54901960784314 0.98823529411765" /><feFuncG type="table" tableValues="0 1" /><feFuncB type="table" tableValues="0.71764705882353 0.25490196078431" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-blue-red"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0 1" /><feFuncG type="table" tableValues="0 0.27843137254902" /><feFuncB type="table" tableValues="0.5921568627451 0.27843137254902" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-midnight"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0 0" /><feFuncG type="table" tableValues="0 0.64705882352941" /><feFuncB type="table" tableValues="0 1" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-magenta-yellow"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0.78039215686275 1" /><feFuncG type="table" tableValues="0 0.94901960784314" /><feFuncB type="table" tableValues="0.35294117647059 0.47058823529412" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-purple-green"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0.65098039215686 0.40392156862745" /><feFuncG type="table" tableValues="0 1" /><feFuncB type="table" tableValues="0.44705882352941 0.4" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-blue-orange"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0.098039215686275 1" /><feFuncG type="table" tableValues="0 0.66274509803922" /><feFuncB type="table" tableValues="0.84705882352941 0.41960784313725" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg> <div id="nimble-page" class="">
<a class="sek-skip-link sek-screen-reader-text" href="#nimble-page">Skip to content</a>
<header id="nimble-header" class="">
<div class="sektion-wrapper nb-loc " data-sek-level="location" data-sek-id="nimble_global_header" data-sek-is-global-location="true" data-sek-is-header-location="true"> <div data-sek-level="section" data-sek-id="__nimble__ef7ebba75ad0" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__f2eed21bc62f" class="sek-column sek-col-base sek-section-custom-breakpoint-col-50 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__20afffa6494f" data-sek-module-type="czr_image_module" class="sek-module " title=""> <div class="sek-module-inner">
<a class="sek-link-to-url " href="https://www.techbeatly.com"><figure class=" sek-img" title="techbeatly - #learning"><img width="1000" height="300" src="https://www.techbeatly.com/wp-content/uploads/2021/09/techbeatly-logo-v4.1-black.png" class="attachment-original size-original no-lazy" alt="" /></figure></a> </div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__e05c959df415" class="sek-column sek-col-base sek-section-custom-breakpoint-col-50 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__0be653a19905" data-sek-module-type="czr_menu_module" class="sek-module " title=""> <div class="sek-module-inner">
<nav class="sek-nav-wrap" data-sek-expand-below="yes" data-sek-mobile-menu-breakpoint=768>
<button class="sek-nav-toggler sek-collapsed" type="button" data-target="#__nimble__0be653a19905" aria-controls="__nimble__0be653a19905" aria-expanded="false" aria-label="Toggle navigation">
<span class="sek-ham__span-wrapper">
<span class="line line-1"></span>
<span class="line line-2"></span>
<span class="line line-3"></span>
</span>
</button>
<div class="sek-nav-collapse sek-submenu-fade sek-submenu-move" id="__nimble__0be653a19905" data-sek-mm-state="collapsed" style="display:none">
<ul id="menu-mobile_header_menu" class="sek-menu-module sek-nav"><li id="menu-item-3144" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3144"><a href="https://www.techbeatly.com/ansible/"><span class="sek-nav__title">Ansible</span></a></li>
<li id="menu-item-3148" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3148"><a href="https://www.techbeatly.com/category/cloud/openshift/"><span class="sek-nav__title">OpenShift</span></a></li>
<li id="menu-item-6334" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-6334"><a href="https://www.techbeatly.com/kubernetes/"><span class="sek-nav__title">Kubernetes</span></a></li>
<li id="menu-item-6133" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-has-children menu-item-6133"><a href="https://www.techbeatly.com/category/devops/"><span class="sek-nav__title">DevOps</span></a>
<ul class="sub-menu">
<li id="menu-item-8631" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-8631"><a href="https://www.techbeatly.com/category/automation/terraform/"><span class="sek-nav__title">Terraform</span></a></li>
<li id="menu-item-8633" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-8633"><a href="https://www.techbeatly.com/category/cloud/microsoft-azure/"><span class="sek-nav__title">Microsoft Azure</span></a></li>
<li id="menu-item-3146" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3146"><a href="https://www.techbeatly.com/category/cloud/google-cloud-platform/"><span class="sek-nav__title">Google Cloud Platform</span></a></li>
<li id="menu-item-3147" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3147"><a href="https://www.techbeatly.com/category/cloud/aws/"><span class="sek-nav__title">AWS</span></a></li>
</ul>
</li>
<li id="menu-item-8628" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8628"><a href="#"><span class="sek-nav__title">Certification</span></a>
<ul class="sub-menu">
<li id="menu-item-8629" class="menu-item menu-item-type-post_type menu-item-object-post menu-item-8629"><a href="https://www.techbeatly.com/kubernetes-certification-cka-ckad-exam-tips-learning-path/"><span class="sek-nav__title">CKA, CKS & CKAD Guide</span></a></li>
<li id="menu-item-8630" class="menu-item menu-item-type-post_type menu-item-object-post menu-item-8630"><a href="https://www.techbeatly.com/hashicorp-certified-terraform-associate-learning-exam-tips/"><span class="sek-nav__title">Terraform Associate Exam Guide</span></a></li>
</ul>
</li>
<li id="menu-item-3153" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-3153"><a href="https://www.techbeatly.com/category/technical-events/"><span class="sek-nav__title">Events</span></a>
<ul class="sub-menu">
<li id="menu-item-3151" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3151"><a href="https://www.techbeatly.com/category/technical-events/malaysia-events/"><span class="sek-nav__title">Malaysia Events</span></a></li>
<li id="menu-item-3152" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3152"><a href="https://www.techbeatly.com/category/technical-events/online-events/"><span class="sek-nav__title">Online Events</span></a></li>
</ul>
</li>
<li id="menu-item-6135" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-6135"><a href="https://www.techbeatly.com/contact/"><span class="sek-nav__title">Contact</span></a></li>
<li id="menu-item-6134" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-6134"><a href="https://www.techbeatly.com/about/"><span class="sek-nav__title">About</span></a></li>
</ul> </div>
</nav> </div>
</div> </div>
</div> </div>
</div>
</div> </div> </header>
<div id="nimble-content" class="">
<div class="sektion-wrapper nb-loc " data-sek-level="location" data-sek-id="loop_start" data-sek-is-global-location="false"> <div data-sek-level="section" data-sek-id="__nimble__e0f4a9333082" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__aa127a8d729c" class="sek-column sek-col-base sek-col-100 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__87c2b0051b1a" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><span class="sek-post-category"><a href="https://www.techbeatly.com/category/devops/" rel="category tag">DevOps</a> / <a href="https://www.techbeatly.com/category/featured/" rel="category tag">Featured</a> / <a href="https://www.techbeatly.com/category/infrastructre-hardware/" rel="category tag">Infrastructre & Hardware</a> / <a href="https://www.techbeatly.com/category/automation/terraform/" rel="category tag">Terraform</a></span></p>
</div>
</div> <div data-sek-level="module" data-sek-id="__nimble__39de2c57eeef" data-sek-module-type="czr_heading_module" class="sek-module " title=""> <div class="sek-module-inner">
<h1 class="sek-heading">Terraform Cheat Sheet</h1> </div>
</div> <div data-sek-level="section" data-sek-id="__nimble__5c2458b7d490" data-sek-is-nested="true" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__e3106a34455c" class="sek-column sek-col-base sek-col-50 sek-hidden-on-tablets sek-hidden-on-mobiles "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__9fc89e53cae5" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><img alt='' src='https://secure.gravatar.com/avatar/1558aaf0c06196e6b9cb24c21e5ca858?s=85&d=monsterid&r=g' srcset='https://secure.gravatar.com/avatar/1558aaf0c06196e6b9cb24c21e5ca858?s=170&d=monsterid&r=g 2x' class='avatar avatar-85 photo' height='85' width='85' /></p>
</div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__c5ec92b4d132" class="sek-column sek-col-base sek-col-50 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__12d6cb3caed8" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><span style="color: #000000;"><strong><a href="https://www.techbeatly.com/author/gini/" title="Posts by Gineesh Mada Pparambath" class="sek-author-link" rel="author">Gineesh Mada Pparambath</a><br />
</strong><time class="sek-published-date" datetime="2021-11-24T18:41:36+08:00">November 24, 2021</time></span></p>
</div>
</div> </div>
</div> </div>
</div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__65dc3430c2d7" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__6bc50cf05890" class="sek-column sek-col-base sek-col-50 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__d21bec8f90a2" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p>
<figure class="wp-block-image size-large"><img width="1024" height="576" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new-1024x576.png" alt="" class="wp-image-10366" data-sek-srcset="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new-1024x576.png 1024w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new-300x169.png 300w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new-768x432.png 768w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new.png 1280w" data-sek-sizes="(max-width: 1024px) 100vw, 1024px"></figure><h2><span id="What_is_Terraform">What is Terraform</span></h2>
<p>Terraform is an open-source software tool to manage end to end lifecycle of your IT infrastructure. Terraform provides a consistent CLI workflow to manage hundreds of cloud services. </p>
<h3><span id="Latest_Terraform_Articles">Latest Terraform Articles </span></h3>
<ul class="wp-block-latest-posts__list wp-block-latest-posts"><li><a class="wp-block-latest-posts__post-title" href="https://www.techbeatly.com/terraform-free-courses/">10 Free Courses to Learn Terraform</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.techbeatly.com/terraform-cheat-sheet/">Terraform Cheat Sheet</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.techbeatly.com/creating-the-elastic-stack-on-aws-using-terraform/">Creating the Elastic Stack on AWS using Terraform</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.techbeatly.com/using-ansible-with-terraform-ansible-real-life-series/">Using Ansible with Terraform – Ansible Real Life Series</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.techbeatly.com/how-to-import-existing-vmware-vm-in-to-terraform/">How to Import Existing VMWare VM’s into Terraform</a></li>
<li><a class="wp-block-latest-posts__post-title" href="https://www.techbeatly.com/hashicorp-certified-terraform-associate-learning-exam-tips/">HashiCorp Certified Terraform Associate – Learning & Exam Tips</a></li>
</ul><div class="lwptoc lwptoc-baseItems lwptoc-light lwptoc-notInherit" data-smooth-scroll="1" data-smooth-scroll-offset="24"><div class="lwptoc_i"> <div class="lwptoc_header">
<b class="lwptoc_title">Contents</b> <span class="lwptoc_toggle">
<a href="#" class="lwptoc_toggle_label" data-label="show">hide</a>
</span>
</div>
<div class="lwptoc_items lwptoc_items-visible">
<div class="lwptoc_itemWrap"><div class="lwptoc_item"> <a href="#What_is_Terraform">
<span class="lwptoc_item_label">What is Terraform</span>
</a>
<div class="lwptoc_itemWrap"><div class="lwptoc_item"> <a href="#Latest_Terraform_Articles">
<span class="lwptoc_item_label">Latest Terraform Articles</span>
</a>
</div></div></div><div class="lwptoc_item"> <a href="#Installing_Terraform">
<span class="lwptoc_item_label">Installing Terraform</span>
</a>
</div><div class="lwptoc_item"> <a href="#Terraform_CLI_Cheat_Sheet">
<span class="lwptoc_item_label">Terraform CLI Cheat Sheet</span>
</a>
<div class="lwptoc_itemWrap"><div class="lwptoc_item"> <a href="#terraform_version">
<span class="lwptoc_item_label">terraform version</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_init">
<span class="lwptoc_item_label">terraform init</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_plan">
<span class="lwptoc_item_label">terraform plan</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_get">
<span class="lwptoc_item_label">terraform get</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_apply">
<span class="lwptoc_item_label">terraform apply</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_destroy">
<span class="lwptoc_item_label">terraform destroy</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_refresh">
<span class="lwptoc_item_label">terraform refresh</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_show">
<span class="lwptoc_item_label">terraform show</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_validate">
<span class="lwptoc_item_label">terraform validate</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_providers">
<span class="lwptoc_item_label">terraform providers</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_state">
<span class="lwptoc_item_label">terraform state</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_graph">
<span class="lwptoc_item_label">terraform graph</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_fmt">
<span class="lwptoc_item_label">terraform fmt</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_taint">
<span class="lwptoc_item_label">terraform taint</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_import">
<span class="lwptoc_item_label">terraform import</span>
</a>
</div><div class="lwptoc_item"> <a href="#terraform_workspaces">
<span class="lwptoc_item_label">terraform workspaces</span>
</a>
</div><div class="lwptoc_item"> <a href="#Terraform_Default_Plugin_Directories">
<span class="lwptoc_item_label">Terraform Default Plugin Directories</span>
</a>
</div><div class="lwptoc_item"> <a href="#Terraform_Variable_Assignment">
<span class="lwptoc_item_label">Terraform Variable Assignment</span>
</a>
</div></div></div><div class="lwptoc_item"> <a href="#Resources">
<span class="lwptoc_item_label">Resources</span>
</a>
<div class="lwptoc_itemWrap"><div class="lwptoc_item"> <a href="#Share_this_to_your_network">
<span class="lwptoc_item_label">Share this to your network:</span>
</a>
</div></div></div></div></div>
</div></div><h2><span id="Installing_Terraform">Installing Terraform</span></h2>
<p>You can download the Terraform software from <strong><a rel="noreferrer noopener" href="https://www.terraform.io/downloads.html" data-type="URL" data-id="https://www.terraform.io/downloads.html" target="_blank">HashiCorp’s download</a></strong> page and use native installation methods for your operating system. Also you can install Terraform using the package managers like <code>yum</code>, <code>apt</code>, <code>homebrew</code>, Chocolatey (<code>choco</code>) etc. Refer <strong><a rel="noreferrer noopener" href="https://learn.hashicorp.com/tutorials/terraform/install-cli" data-type="URL" data-id="https://learn.hashicorp.com/tutorials/terraform/install-cli" target="_blank">install Terraform </a></strong>page for the appropriate method for your operating system.</p>
<figure class="wp-block-image size-full"><img width="821" height="546" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-installation-methods.png" alt="" class="wp-image-10340" data-sek-srcset="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-installation-methods.png 821w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-installation-methods-300x200.png 300w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-installation-methods-768x511.png 768w" data-sek-sizes="(max-width: 821px) 100vw, 821px"></figure><h2><span id="Terraform_CLI_Cheat_Sheet">Terraform CLI Cheat Sheet</span></h2>
<p>Please note, this cheat sheet is a living document and I will make changes whenever there is an update or changes in the Terraform CLI options or versions. This cheat sheet does not written in an alphabetical order or based on workflow.</p>
<p>Planning <strong><a href="https://www.youtube.com/watch?v=cozEYDS9Ajg&t=226s" data-type="URL" data-id="https://www.youtube.com/watch?v=cozEYDS9Ajg&t=226s" target="_blank" rel="noreferrer noopener">HashiCorp Certified Terraform Associate Certification</a></strong> ? Watch the video for details.</p>
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<div class="video-container"><span class="embed-youtube" style="text-align:center; display: block;"><iframe class="youtube-player" width="640" height="360" src="https://www.youtube.com/embed/cozEYDS9Ajg?version=3&rel=1&showsearch=0&showinfo=1&iv_load_policy=1&fs=1&hl=en-US&autohide=2&start=226&wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe></span></div>
</div></figure><h3><span id="terraform_version">terraform version</span></h3>
<pre class="wp-block-code"><code>$ terraform version
Terraform v1.0.1
on darwin_amd64</code></pre>
<h3><span id="terraform_init">terraform init</span></h3>
<pre class="wp-block-code"><code>$ terraform init</code></pre>
<p><meta charset="utf-8">Ask for input if necessary. If false, will error if input was required.</p>
<pre class="wp-block-code"><code>$ terraform init -input=false</code></pre>
<p>You can also change the backend details using <code>-backend-config</code> option. <code>-reconfigure</code> will reconfigure the backend, ignoring any saved configuration.</p>
<pre class="wp-block-code"><code>$ terraform init -backend-config=PATH/TO/CONFIGURATION_FILE -reconfigure</code></pre>
<h3><span id="terraform_plan">terraform plan</span></h3>
<p>The<strong> </strong><code>plan</code> will check the configuration files (basically all the <code>*.tf</code> files in the directory) and will show you the items or changes going to made on target infrastructure or resources. Please note, this command will not actually perform the planned actions.</p>
<pre class="wp-block-code"><code><meta charset="utf-8">$ terraform plan</code></pre>
<p>You can optionally save the plan to a file, which you can then pass to the <code>apply</code> command to perform exactly the actions described in the plan.</p>
<pre class="wp-block-code"><code>$ terraform plan -out plan.out</code></pre>
<h3><span id="terraform_get">terraform get</span></h3>
<p>Downloads and installs modules needed for the configuration given by PATH. <code>get</code> recursively downloads all modules needed, such as modules imported by modules imported by the root and so on. Module installation also happens automatically by default as part of<br>the “terraform init” command, so <span style="text-decoration: underline;">you should rarely need to run this command separately.</span></p>
<pre class="wp-block-code"><code>$ terraform get</code></pre>
<p>You can update the already downloaded modules using <code>-update=true</code> option.</p>
<pre class="wp-block-code"><code><meta charset="utf-8">$ terraform get -update=true</code></pre>
<h3><span id="terraform_apply">terraform apply</span></h3>
<p><code>apply</code> will do the actual operation on the infrastructure resources. <code>apply</code> will show the plan and actions in detail. </p>
<pre class="wp-block-code"><code>$ terraform apply</code></pre>
<p><code>apply</code> will ask for your confirmation to proceed with changes. You can use <code>-auto-approve</code> for auto-confirmation.</p>
<pre class="wp-block-code"><code>$ terraform apply -auto-approve</code></pre>
<p>You can pass different variables or variable files.</p>
<pre class="wp-block-code"><code>$ terraform plan -var="instancetype=t2.small"
$ terraform plan -var-file="custom.tfvars</code></pre>
<p>You can use <code>-target</code> option to target specific resources, modules, or collections of resources.</p>
<pre class="wp-block-code"><code>$ terraform apply -target="aws_s3_bucket_object.objects"</code></pre>
<h3><span id="terraform_destroy">terraform destroy</span></h3>
<p>Warning: <code>destroy</code> will delete all resource but with confirmation.</p>
<pre class="wp-block-code"><code>$ terraform destroy</code></pre>
<p>You can create a deletion plan as below.</p>
<pre class="wp-block-code"><code>$ terraform plan –destroy</code></pre>
<p>Use the <code>-target</code> to destroy a specific resource.</p>
<pre class="wp-block-code"><code>$ terraform destroy -target<meta charset="utf-8">="aws_s3_bucket_object.objects"</code></pre>
<p>Also note, you can comment out the resource, then terraform will detect it as not part of config and will remove when you do <code>plan</code> or <code>apply</code>.</p>
<h3><span id="terraform_refresh">terraform refresh</span></h3>
<p>You can update the terraform state file with metadata that matches the physical resources they are tracking.</p>
<pre class="wp-block-code"><code>$ terraform refresh</code></pre>
<h3><span id="terraform_show">terraform show</span></h3>
<p>Show the terraform state information in a human readable format. You can also use it for displaying information from plan file.</p>
<pre class="wp-block-code"><code>$ terraform show</code></pre>
<h3><span id="terraform_validate">terraform validate</span></h3>
<p>You can check the syntax and validate the configuration using <code>validate</code> subcommand.</p>
<pre class="wp-block-code"><code>$ terraform validate
Success! The configuration is valid.</code></pre>
<h3><span id="terraform_providers">terraform providers</span></h3>
<p>You can see the providers in use by the modules and configurations in your Terraform files. </p>
<pre class="wp-block-code"><code>$ terraform providers
Providers required by configuration:
.
└── provider[registry.terraform.io/hashicorp/aws]</code></pre>
<h3><span id="terraform_state">terraform state</span></h3>
<p><code>terraform state</code> has multiple subcommands to manage the terraform state. You can <code>move</code>, <code>rm</code> (delete), <code>list</code> or <code>show</code> the resource state.</p>
<pre class="wp-block-code"><code>Subcommands:
list List resources in the state
mv Move an item in the state
pull Pull current state and output to stdout
push Update remote state from a local state file
replace-provider Replace provider in the state
rm Remove instances from the state
show Show a resource in the state</code></pre>
<p>Example usages</p>
<pre class="wp-block-code"><code># List state
$ terraform state list
aws_iam_user.lb
aws_instance.myec2
# Show resource
$ terraform state show aws_instance.myec2
# Push terraform state to remote backend
$ tarraform state push
# Pull the remote terraform state to a local copy
$ terraform state pull > terraform.tfstate
# Update and tell terraform that <strong>packet_device.worker</strong> has been renamed to <meta charset="utf-8"><strong>packet_device.helper</strong>
$ terraform state mv <strong>packet_device.worker packet_device.helper</strong>
# Move the resource block into the child module configuration
$ terraform state mv <strong>packet_device.worker</strong> <strong>module.worker.packet_device.worker</strong>
# Remove the resource from state but it will not remove the resource from cloud/provider.
$ terraform state rm aws_instance.myec2</code></pre>
<p>Remove the resource from state but it will not remove the resource from cloud/provider. But next time when you run <code>terraform plan</code> or <code>apply</code>, Terraform will recreate the instance as again as the resource definition is still there.</p>
<pre class="wp-block-code"><code>$ terraform state rm aws_instance.myec2
Removed aws_instance.myec2
Successfully removed 1 resource instance(s).</code></pre>
<h3><span id="terraform_graph">terraform graph</span></h3>
<p><code>graph</code> will generate the visual graph of your infrastructure based on Terraform configuration files. </p>
<p>Outputs the visual execution graph of Terraform resources according to<br>either the current configuration or an execution plan.</p>
<pre class="wp-block-code"><code>$ terraform graph</code></pre>
<p>The output of terraform graph will be in DOT format and you can use tools like dot to generate image files from dot files. </p>
<pre class="wp-block-code"><code>sudo apt-get install graphviz
# or
sudo yum install graphviz
$ terraform graph | dot –Tpng > graph.png</code></pre>
<h3><span id="terraform_fmt">terraform fmt</span></h3>
<p>Rewrites all Terraform configuration files to a canonical format with appropriate indentation and styling. (JSON files (.tf.json or .tfvars.json) are not modified.)</p>
<pre class="wp-block-code"><code>$ terraform fmt</code></pre>
<h3><span id="terraform_taint">terraform taint</span></h3>
<p>You can manually mark a terraform managed resource as tainted and forcing it to be destroyed and recreated on the next apply. <code>terraform taint</code> command will make modification in the <code>tfstate</code> file and recreate action will happen in next apply. Please note, <code>terraform taint</code> command will not modify the <code>.tf</code> file or the infrastructure.</p>
<pre class="wp-block-code"><code>$ terraform taint aws_instance.myec2</code></pre>
<h3><span id="terraform_import">terraform import</span></h3>
<p>You can import your existing infrastructure into Terraform and manage using Terraform.</p>
<pre class="wp-block-code"><code># Importing VMWare VM to terraform
$ terraform import vsphere_virtual_machine.vm /DC1/vm/DEV/DEV2</code></pre>
<p>Read our detailed guide: <strong><a rel="noreferrer noopener" href="https://www.techbeatly.com/how-to-import-existing-vmware-vm-in-to-terraform/" data-type="URL" data-id="https://www.techbeatly.com/how-to-import-existing-vmware-vm-in-to-terraform/" target="_blank">How to Import Existing VMWare VM’s into Terraform</a></strong></p>
<h3><span id="terraform_workspaces">terraform workspaces</span></h3>
<p><strong><a rel="noreferrer noopener" href="https://www.terraform.io/docs/cli/workspaces/index.html" data-type="URL" data-id="https://www.terraform.io/docs/cli/workspaces/index.html" target="_blank">Terraform Workspaces</a></strong> will help to manage same terraform configurations for different environments (eg: dev, staging, production) in the same project directory. </p>
<pre class="wp-block-code"><code># Check the workspace
$ terraform workspace show
default
# Create new workspace
$ terraform workspace new dev
Created and switched to workspace "dev"!
# List all workspaces
$ terraform workspace list
default
* dev
# Switch to a specific workspace
$ terraform workspace select dev
Switched to workspace "dev".</code></pre>
<p>Terraform will create separate <code>terraform.tfstate</code> files in <code>terraform.tfstate.d/WORKSPACE_NAME/ </code>directories in the project directory.</p>
<pre class="wp-block-code"><code>$ tree terraform.tfstate.d/
terraform.tfstate.d/
├── dev
│ └── terraform.tfstate
├── prod
└── stage
└── terraform.tfstate
3 directories, 2 files</code></pre>
<p>You can use <code>${terraform.workspace}</code> interpolation to dynamically use the workspace name inside your terraform configuration (<code>*.tf</code>). Eg: you can use it for selecting instance type from an array based on workspace.</p>
<pre class="wp-block-code"><code>resource "aws_instance" "myec2" {
ami = "ami-0cd31be676780afa7"
instance_type = lookup(var.instance_type,terraform.workspace)
}
variable "instance_type" {
type = map
default = {
default = "t2.nano"
stage = "t2.nano"
dev = "t2.micro"
prod = "t2.large"
}
}</code></pre>
<p>Or you can use this <meta charset="utf-8"><code>${terraform.workspace}</code> for tagging the instance.</p>
<pre class="wp-block-code"><code>resource "aws_instance" "example" {
# ... other arguments
tags = {
Name = "web-${terraform.workspace}"
}
}</code></pre>
<p>Refer <strong><a href="https://www.terraform.io/docs/language/state/workspaces.html" data-type="URL" data-id="https://www.terraform.io/docs/language/state/workspaces.html" target="_blank" rel="noreferrer noopener">Terraform Workspaces</a></strong> documentation for more details.</p>
<p></p>
<h3><span id="Terraform_Default_Plugin_Directories">Terraform Default Plugin Directories</span></h3>
<ul><li>Windows: %APPDATA%\terraform.d\plugins</li><li>All other systems: ~/.terraform.d/plugins</li></ul><h3><span id="Terraform_Variable_Assignment">Terraform Variable Assignment</span></h3>
<p>You can pass variables to Terraform in different methods. </p>
<p>1. Environment variables – with a prefix <code>TF_VAR_</code></p>
<pre class="wp-block-code"><code>$ export TF_VAR_instance_type=t2.micro</code></pre>
<p>2. Command Line Flags</p>
<pre class="wp-block-code"><code><meta charset="utf-8">$ terraform plan -var="instancetype=t2.small"</code></pre>
<p>3. From a variable file – use <code>terraform.tfvars</code> – terraform will load all variables from this file. If different var files to be used then,</p>
<pre class="wp-block-code"><code>$ terraform plan -var-file="custom.tfvars</code></pre>
<p>4. Variable Defaults – can keep variable default in another <code>.tf</code> file.</p>
<pre class="wp-block-code"><code>$ cat variables.tf
variable "my_ip" {
default = "10.1.10.10/32"
}</code></pre>
<ul><li>if no value mentioned, then <code>default</code> value will be used.</li><li>if <code>default</code> value not defined, then terraform will ask for variable when you do <code>apply</code> or <code>plan</code> operation.</li></ul><h2><span id="Resources">Resources</span></h2>
<ul><li><strong><a href="https://spacelift.io/blog/how-to-use-terraform-variables" data-type="URL" data-id="https://spacelift.io/blog/how-to-use-terraform-variables" target="_blank" rel="noreferrer noopener">How to Use Terraform Variables (Locals, Input, Output, Environment)</a></strong></li></ul><div class="sharedaddy sd-sharing-enabled"><div class="robots-nocontent sd-block sd-social sd-social-icon sd-sharing"><h3 class="sd-title"><span id="Share_this_to_your_network">Share this to your network:</span></h3><div class="sd-content"><ul><li class="share-twitter"><a rel="nofollow noopener noreferrer" data-shared="sharing-twitter-10240" class="share-twitter sd-button share-icon no-text" href="https://www.techbeatly.com/terraform-cheat-sheet/?share=twitter" target="_blank" title="Click to share on Twitter"><span></span><span class="sharing-screen-reader-text">Click to share on Twitter (Opens in new window)</span></a></li><li class="share-facebook"><a rel="nofollow noopener noreferrer" data-shared="sharing-facebook-10240" class="share-facebook sd-button share-icon no-text" href="https://www.techbeatly.com/terraform-cheat-sheet/?share=facebook" target="_blank" title="Click to share on Facebook"><span></span><span class="sharing-screen-reader-text">Click to share on Facebook (Opens in new window)</span></a></li><li class="share-linkedin"><a rel="nofollow noopener noreferrer" data-shared="sharing-linkedin-10240" class="share-linkedin sd-button share-icon no-text" href="https://www.techbeatly.com/terraform-cheat-sheet/?share=linkedin" target="_blank" title="Click to share on LinkedIn"><span></span><span class="sharing-screen-reader-text">Click to share on LinkedIn (Opens in new window)</span></a></li><li class="share-tumblr"><a rel="nofollow noopener noreferrer" data-shared="" class="share-tumblr sd-button share-icon no-text" href="https://www.techbeatly.com/terraform-cheat-sheet/?share=tumblr" target="_blank" title="Click to share on Tumblr"><span></span><span class="sharing-screen-reader-text">Click to share on Tumblr (Opens in new window)</span></a></li><li class="share-pinterest"><a rel="nofollow noopener noreferrer" data-shared="sharing-pinterest-10240" class="share-pinterest sd-button share-icon no-text" href="https://www.techbeatly.com/terraform-cheat-sheet/?share=pinterest" target="_blank" title="Click to share on Pinterest"><span></span><span class="sharing-screen-reader-text">Click to share on Pinterest (Opens in new window)</span></a></li><li class="share-pocket"><a rel="nofollow noopener noreferrer" data-shared="" class="share-pocket sd-button share-icon no-text" href="https://www.techbeatly.com/terraform-cheat-sheet/?share=pocket" target="_blank" title="Click to share on Pocket"><span></span><span class="sharing-screen-reader-text">Click to share on Pocket (Opens in new window)</span></a></li><li class="share-end"></ul></div></div></div>
<div id="jp-relatedposts" class="jp-relatedposts">
<h3 class="jp-relatedposts-headline"><em>Related</em></h3>
</div></p>
</div>
</div> <div data-sek-level="module" data-sek-id="__nimble__282fc9ce9c3a" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><em>Disclaimer: The views expressed and the content shared are those of the author and do not reflect the views of the author's employer or techbeatly platform.</em></p>
</div>
</div> <div data-sek-level="module" data-sek-id="__nimble__c63acc4a4bde" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p>Tags: <span class="sek-post-tags"><a href="https://www.techbeatly.com/tag/free-terraform/" rel="tag">free terraform</a> · <a href="https://www.techbeatly.com/tag/hashicorp-certified-terraform-associate/" rel="tag">HashiCorp Certified Terraform Associate</a> · <a href="https://www.techbeatly.com/tag/how-to-learn-terraform/" rel="tag">how to learn terraform</a> · <a href="https://www.techbeatly.com/tag/terraform-cheat-sheet/" rel="tag">terraform cheat sheet</a> · <a href="https://www.techbeatly.com/tag/terraform-cheatsheet/" rel="tag">terraform cheatsheet</a> · <a href="https://www.techbeatly.com/tag/terraform-cli-cheat-sheet/" rel="tag">terraform cli cheat sheet</a> · <a href="https://www.techbeatly.com/tag/terraform-command-line-cheatsheet/" rel="tag">terraform command line cheatsheet</a> · <a href="https://www.techbeatly.com/tag/terraform-guides/" rel="tag">terraform guides</a></span></p>
</div>
</div> <div data-sek-level="module" data-sek-id="__nimble__c5b63c556e8b" data-sek-module-type="czr_spacer_module" class="sek-module " title=""> <div class="sek-module-inner">
<div class="sek-spacer"></div> </div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__81fa7b0db832" class="sek-column sek-col-base sek-col-50 sek-hidden-on-tablets sek-hidden-on-mobiles "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__73dad4725d84" data-sek-module-type="czr_widget_area_module" class="sek-module " title=""> <div class="sek-module-inner">
<aside id="block-2" class="widget widget_block widget_search"><form role="search" method="get" action="https://www.techbeatly.com/" class="wp-block-search__button-outside wp-block-search__text-button wp-block-search"><label for="wp-block-search__input-1" class="wp-block-search__label">Search</label><div class="wp-block-search__inside-wrapper "><input type="search" id="wp-block-search__input-1" class="wp-block-search__input " name="s" value="" placeholder="Search in techbeatly" required /><button type="submit" class="wp-block-search__button ">Search</button></div></form></aside> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__e7d46f22c6a9" data-sek-module-type="czr_widget_area_module" class="sek-module " title=""> <div class="sek-module-inner">
<aside id="block-6" class="widget widget_block"><p><strong><a href="https://www.techbeatly.com/k8s" target="_blank">Get 22% OFF on CKA, CKAD, CKS, KCNA. Use PIDAY22 at checkout. Check now !!!</a></strong><br>
</p></aside> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__2e1151afbab0" data-sek-module-type="czr_heading_module" class="sek-module " title=""> <div class="sek-module-inner">
<h3 class="sek-heading">Latest posts</h3> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__f0bcf0d5a113" data-sek-module-type="czr_divider_module" class="sek-module " title=""> <div class="sek-module-inner">
<span class="sek-divider"></span> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__fdaea2459ac4" data-sek-module-type="czr_spacer_module" class="sek-module " title=""> <div class="sek-module-inner">
<div class="sek-spacer"></div> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__5ffb85166874" data-sek-module-type="czr_post_grid_module" class="sek-module " title=""> <div class="sek-module-inner">
<div class="sek-post-grid-wrapper sek-has-mobile-breakpoint" id="__nimble__5ffb85166874">
<div class="sek-grid-items sek-list-layout sek-thumb-custom-height ">
<article id="sek-pg-12889" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/ansible-automation-controller-ad-hoc-commands/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/08/ansible-automation-controller-ad-hoc-commands-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<div class="sek-pg-category"><a href="https://www.techbeatly.com/category/infrastructre-hardware/" rel="category tag">Infrastructre & Hardware</a></div>
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/ansible-automation-controller-ad-hoc-commands/" rel="bookmark">Running Ad Hoc commands from Ansible Automation Controller (Ansible Automation Platform)</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">August 9, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-12795" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/no-code-app-development/">
<img width="768" height="513" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/06/pexels-christina-morillo-1181472-coding-768x513.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<div class="sek-pg-category"><a href="https://www.techbeatly.com/category/developer/" rel="category tag">Developer</a> / <a href="https://www.techbeatly.com/category/devops/" rel="category tag">DevOps</a></div>
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/no-code-app-development/" rel="bookmark">All You Need To Know About No-Code App Development</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">June 24, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-12762" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/7-devops-trends-in-2022/">
<img width="768" height="512" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/05/pexels-realtoughcandycom-11035393_1920-768x512.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<div class="sek-pg-category"><a href="https://www.techbeatly.com/category/automation/" rel="category tag">Automation</a> / <a href="https://www.techbeatly.com/category/cloud/" rel="category tag">Cloud</a> / <a href="https://www.techbeatly.com/category/devops/" rel="category tag">DevOps</a></div>
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/7-devops-trends-in-2022/" rel="bookmark">7 DevOps Trends in 2022</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">May 22, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-12750" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/4-common-devops-challenges/">
<img width="768" height="504" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/05/annie-spratt-hCb3lIB8L8E-unsplash-devops-mistakes-chatty-768x504.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<div class="sek-pg-category"><a href="https://www.techbeatly.com/category/developer/" rel="category tag">Developer</a> / <a href="https://www.techbeatly.com/category/devops/" rel="category tag">DevOps</a> / <a href="https://www.techbeatly.com/category/infrastructre-hardware/" rel="category tag">Infrastructre & Hardware</a></div>
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/4-common-devops-challenges/" rel="bookmark">4 Common DevOps Challenges and How Developers Can Overcome Them</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">May 11, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-12734" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/best-tools-for-vm-backup-to-prevent-anybrservice-interruption-or-severe-financial-loss/">
<img width="768" height="480" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/05/best-tools-for-vm-backup-to-prevent-anybrservice-interruption-or-severe-financial-loss-768x480.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<div class="sek-pg-category"><a href="https://www.techbeatly.com/category/cloud/" rel="category tag">Cloud</a> / <a href="https://www.techbeatly.com/category/infrastructre-hardware/" rel="category tag">Infrastructre & Hardware</a></div>
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/best-tools-for-vm-backup-to-prevent-anybrservice-interruption-or-severe-financial-loss/" rel="bookmark">Best Tools for VM Backup to Prevent Any Service Interruption or Severe Financial Loss</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">May 6, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-12645" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/top-business-intelligence-tools-for-commercial-usage-in-2022/">
<img width="768" height="512" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/04/john-schnobrich-FlPc9_VocJ4-unsplash-768x512.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<div class="sek-pg-category"><a href="https://www.techbeatly.com/category/courses/" rel="category tag">Courses</a></div>
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/top-business-intelligence-tools-for-commercial-usage-in-2022/" rel="bookmark">Top Business Intelligence Tools For Commercial Usage In 2022</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">April 20, 2022</span>
</aside>
</div> </article>
</div>
</div> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__f42d6388016e" data-sek-module-type="czr_simple_html_module" class="sek-module " title=""> <div class="sek-module-inner">
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-1676785078101005" data-ad-slot="3862722496" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
</script> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__aa5734a12fbf" data-sek-module-type="czr_divider_module" class="sek-module " title=""> <div class="sek-module-inner">
<span class="sek-divider"></span> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__004a3f62741a" data-sek-module-type="czr_widget_area_module" class="sek-module " title=""> <div class="sek-module-inner">
<aside id="block-3" class="widget widget_block"><p><strong>Jobs on Jooble</strong><br>
<a target="_blank" href="https://jooble.org"><img src="https://www.techbeatly.com/wp-content/uploads/2021/05/jooble-logo.png" border="0" alt="Jobs on Jooble" style="height: 40px;"></a></p></aside><aside id="block-5" class="widget widget_block"><a href="https://click.linksynergy.com/fs-bin/click?id=*6VVFTf6u7k&offerid=507388.21309&subid=0&type=4"><IMG border="0" alt="Sharpen your skills with cutting-edge courses starting at just 12,99 €." src="https://ad.linksynergy.com/fs-bin/show?id=*6VVFTf6u7k&bids=507388.21309&subid=0&type=4&gridnum=19"></a></aside> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__6f3cf33cbb91" data-sek-module-type="czr_simple_html_module" class="sek-module " title=""> <div class="sek-module-inner">
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-1676785078101005" data-ad-slot="1486828835" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
</script> </div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__9c479e388605" class="sek-section ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__5442fc51264b" class="sek-column sek-col-base sek-col-100 "> <div class="sek-column-inner ">
<div data-sek-level="section" data-sek-id="__nimble__3d6a9ef4a9cc" data-sek-is-nested="true" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__fd43952f2614" class="sek-column sek-col-base sek-col-50 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__bc1b1fb36c62" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><img alt='' src='https://secure.gravatar.com/avatar/1558aaf0c06196e6b9cb24c21e5ca858?s=85&d=monsterid&r=g' srcset='https://secure.gravatar.com/avatar/1558aaf0c06196e6b9cb24c21e5ca858?s=170&d=monsterid&r=g 2x' class='avatar avatar-85 photo' height='85' width='85' /></p>
</div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__aa57529b1267" class="sek-column sek-col-base sek-col-50 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__f0379886e7b9" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><span style="color: #ff6600;"><strong><a href="https://www.techbeatly.com/author/gini/" title="Posts by Gineesh Mada Pparambath" class="sek-author-link" rel="author">Gineesh Mada Pparambath</a><br />
</strong><span style="color: #000000;"><span class="sek-author-description">Gineesh has worked as a Systems Engineer, Automation Specialist, and content author. His primary focus is on Ansible Automation, Containerisation (OpenShift & Kubernetes), and Infrastructure as Code (Terraform).
(aka <strong>Gini Gangadharan</strong> - <a href="https://www.iamgini.com">iamgini.com</a>)</span></span></span></p>
</div>
</div> </div>
</div> </div>
</div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__95f5a3a70e82" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__036b813ebd91" class="sek-column sek-col-base sek-col-50 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__95c293730d7f" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<div>
<div><span class="sek-previous-post-link"><a href="https://www.techbeatly.com/ansible-collections/" rel="prev">Ansible Collections [LIVE]</a></span></div>
</div>
</div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__49445dcc8175" class="sek-column sek-col-base sek-col-50 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__f7c5037e1a31" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<div>
<div><span class="sek-next-post-link"><a href="https://www.techbeatly.com/ansible-convert-list-to-string/" rel="next">Ansible Convert List to String</a></span></div>
</div>
</div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__2ba113139478" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__6bdb72959a6c" class="sek-column sek-col-base sek-col-100 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__8bb5099721f2" data-sek-module-type="czr_simple_html_module" class="sek-module " title=""> <div class="sek-module-inner">
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-1676785078101005" data-ad-slot="5058070814" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
</script> </div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__968e7fc7a3d1" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__2b4798690dd0" class="sek-column sek-col-base sek-col-100 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__fbd86554a224" data-sek-module-type="czr_heading_module" class="sek-module " title=""> <div class="sek-module-inner">
<h1 class="sek-heading">Comments</h1> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__3e0fbb63f6c9" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title="" id="nimble-comments"> <div class="sek-module-inner">
<p>
<section id="sek-comments" class="sek-themeform">
<h3>7 Responses</h3>
<div id="sek-commentlist-container" class="comment-tab">
<ol class="sek-commentlist">
<li class="pingback even thread-even depth-1" id="comment-1746">
<div id="div-comment-1746" class="comment-body">
<div class="comment-author vcard">
<cite class="fn"><a href='https://blog.mambot.io/pins/devops/terraform-cheat-sheet-techbeatly-250/' rel='external nofollow ugc' class='url'>Terraform Cheat Sheet – techbeatly - Mambot</a></cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata">
<a href="https://www.techbeatly.com/terraform-cheat-sheet/#comment-1746">November 25, 2021 at 4:10 am</a> </div>
<p>[…] <a href="https://www.techbeatly.com/terraform-cheat-sheet/" rel="nofollow ugc">https://www.techbeatly.com/terraform-cheat-sheet/</a> […]</p>
<div class='jetpack-comment-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-comment-wrapper-147587587-1746-62f3766409d06' data-src='https://widgets.wp.com/likes/#blog_id=147587587&comment_id=1746&origin=www.techbeatly.com&obj_id=147587587-1746-62f3766409d06' data-name='like-comment-frame-147587587-1746-62f3766409d06'>
<div class='likes-widget-placeholder comment-likes-widget-placeholder comment-likes'><span class='loading'>Loading...</span></div>
<div class='comment-likes-widget jetpack-likes-widget comment-likes'><span class='comment-like-feedback'></span><span class='sd-text-color'></span><a class='sd-link-color'></a></div>
</div>
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='https://www.techbeatly.com/terraform-cheat-sheet/?replytocom=1746#respond' data-commentid="1746" data-postid="10240" data-belowelement="div-comment-1746" data-respondelement="respond" data-replyto="Reply to Terraform Cheat Sheet – techbeatly - Mambot" aria-label='Reply to Terraform Cheat Sheet – techbeatly - Mambot'>Reply</a></div>
</div>
</li>
<li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-1747">
<div id="div-comment-1747" class="comment-body">
<div class="comment-author vcard">
<img alt='' src='https://secure.gravatar.com/avatar/6f6bc3462aed85486e1df39c9b3c6c09?s=48&d=monsterid&r=g' srcset='https://secure.gravatar.com/avatar/6f6bc3462aed85486e1df39c9b3c6c09?s=96&d=monsterid&r=g 2x' class='avatar avatar-48 photo' height='48' width='48' /> <cite class="fn">alexis</cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata">
<a href="https://www.techbeatly.com/terraform-cheat-sheet/#comment-1747">November 25, 2021 at 5:38 pm</a> </div>
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='https://www.techbeatly.com/terraform-cheat-sheet/?replytocom=1747#respond' data-commentid="1747" data-postid="10240" data-belowelement="div-comment-1747" data-respondelement="respond" data-replyto="Reply to alexis" aria-label='Reply to alexis'>Reply</a></div>
</div>
<ul class="children">
<li class="comment byuser comment-author-gini bypostauthor even depth-2" id="comment-1757">
<div id="div-comment-1757" class="comment-body">
<div class="comment-author vcard">
<img alt='' src='https://secure.gravatar.com/avatar/1558aaf0c06196e6b9cb24c21e5ca858?s=48&d=monsterid&r=g' srcset='https://secure.gravatar.com/avatar/1558aaf0c06196e6b9cb24c21e5ca858?s=96&d=monsterid&r=g 2x' class='avatar avatar-48 photo' height='48' width='48' /> <cite class="fn"><a href="https://bit.ly/gineesh" rel='external nofollow ugc' class='url'>Gineesh Madapparambath</a></cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata">
<a href="https://www.techbeatly.com/terraform-cheat-sheet/#comment-1757">November 27, 2021 at 4:28 pm</a> </div>
<p>Thank you</p>
<div class='jetpack-comment-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-comment-wrapper-147587587-1757-62f376640a27a' data-src='https://widgets.wp.com/likes/#blog_id=147587587&comment_id=1757&origin=www.techbeatly.com&obj_id=147587587-1757-62f376640a27a' data-name='like-comment-frame-147587587-1757-62f376640a27a'>
<div class='likes-widget-placeholder comment-likes-widget-placeholder comment-likes'><span class='loading'>Loading...</span></div>
<div class='comment-likes-widget jetpack-likes-widget comment-likes'><span class='comment-like-feedback'></span><span class='sd-text-color'></span><a class='sd-link-color'></a></div>
</div>
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='https://www.techbeatly.com/terraform-cheat-sheet/?replytocom=1757#respond' data-commentid="1757" data-postid="10240" data-belowelement="div-comment-1757" data-respondelement="respond" data-replyto="Reply to Gineesh Madapparambath" aria-label='Reply to Gineesh Madapparambath'>Reply</a></div>
</div>
</li>
</ul>
</li>
<li class="comment odd alt thread-even depth-1 parent" id="comment-1750">
<div id="div-comment-1750" class="comment-body">
<div class="comment-author vcard">
<img alt='' src='https://secure.gravatar.com/avatar/d7322a84eeebdc929ecf977ee7d8c8a2?s=48&d=monsterid&r=g' srcset='https://secure.gravatar.com/avatar/d7322a84eeebdc929ecf977ee7d8c8a2?s=96&d=monsterid&r=g 2x' class='avatar avatar-48 photo' height='48' width='48' /> <cite class="fn"><a href='https://www.linkedin.com/in/damien-vergnaud-0471b9159/' rel='external nofollow ugc' class='url'>Vergnaud Damien</a></cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata">
<a href="https://www.techbeatly.com/terraform-cheat-sheet/#comment-1750">November 26, 2021 at 11:16 pm</a> </div>
<p>Hey, Thank you dude for this usefull piece of information 🙂</p>
<p>Would you consider adding :<br />
${terraform.workspace} variable inside your “terraform workspace” section ?</p>
<p>This variable is SOOO usefull, because you have multiples .tfstate … right … but you only have 1 .tf plan.</p>
<p>So you need sometimes to changes small things according to the workspace you’re in, right ? (I said small things, not the whole stack)<br />
At least the name of the instances or the VPC you are connected to or others things like that.</p>
<p>I recommand you to make a small mention of it if you share my though 🙂<br />
<a href="https://www.terraform.io/docs/language/state/workspaces.html" rel="nofollow ugc">https://www.terraform.io/docs/language/state/workspaces.html</a></p>
<p>Have a great day 🙂</p>
<div class='jetpack-comment-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-comment-wrapper-147587587-1750-62f376640a552' data-src='https://widgets.wp.com/likes/#blog_id=147587587&comment_id=1750&origin=www.techbeatly.com&obj_id=147587587-1750-62f376640a552' data-name='like-comment-frame-147587587-1750-62f376640a552'>
<div class='likes-widget-placeholder comment-likes-widget-placeholder comment-likes'><span class='loading'>Loading...</span></div>
<div class='comment-likes-widget jetpack-likes-widget comment-likes'><span class='comment-like-feedback'></span><span class='sd-text-color'></span><a class='sd-link-color'></a></div>
</div>
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='https://www.techbeatly.com/terraform-cheat-sheet/?replytocom=1750#respond' data-commentid="1750" data-postid="10240" data-belowelement="div-comment-1750" data-respondelement="respond" data-replyto="Reply to Vergnaud Damien" aria-label='Reply to Vergnaud Damien'>Reply</a></div>
</div>
<ul class="children">
<li class="comment byuser comment-author-gini bypostauthor even depth-2" id="comment-1756">
<div id="div-comment-1756" class="comment-body">
<div class="comment-author vcard">
<img alt='' src='https://secure.gravatar.com/avatar/1558aaf0c06196e6b9cb24c21e5ca858?s=48&d=monsterid&r=g' srcset='https://secure.gravatar.com/avatar/1558aaf0c06196e6b9cb24c21e5ca858?s=96&d=monsterid&r=g 2x' class='avatar avatar-48 photo' height='48' width='48' /> <cite class="fn"><a href="https://bit.ly/gineesh" rel='external nofollow ugc' class='url'>Gineesh Madapparambath</a></cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata">
<a href="https://www.techbeatly.com/terraform-cheat-sheet/#comment-1756">November 27, 2021 at 4:27 pm</a> </div>
<p>Thank you so much Damien,<br />
Appreciate your suggestion and feedback. I have added the same under Workspace section.</p>
<div class='jetpack-comment-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-comment-wrapper-147587587-1756-62f376640a865' data-src='https://widgets.wp.com/likes/#blog_id=147587587&comment_id=1756&origin=www.techbeatly.com&obj_id=147587587-1756-62f376640a865' data-name='like-comment-frame-147587587-1756-62f376640a865'>
<div class='likes-widget-placeholder comment-likes-widget-placeholder comment-likes'><span class='loading'>Loading...</span></div>
<div class='comment-likes-widget jetpack-likes-widget comment-likes'><span class='comment-like-feedback'></span><span class='sd-text-color'></span><a class='sd-link-color'></a></div>
</div>
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='https://www.techbeatly.com/terraform-cheat-sheet/?replytocom=1756#respond' data-commentid="1756" data-postid="10240" data-belowelement="div-comment-1756" data-respondelement="respond" data-replyto="Reply to Gineesh Madapparambath" aria-label='Reply to Gineesh Madapparambath'>Reply</a></div>
</div>
</li>
</ul>
</li>
<li class="comment odd alt thread-odd thread-alt depth-1" id="comment-2122">
<div id="div-comment-2122" class="comment-body">
<div class="comment-author vcard">
<img alt='' src='https://secure.gravatar.com/avatar/78696860cbb5c0e6e35a28ec9a721471?s=48&d=monsterid&r=g' srcset='https://secure.gravatar.com/avatar/78696860cbb5c0e6e35a28ec9a721471?s=96&d=monsterid&r=g 2x' class='avatar avatar-48 photo' height='48' width='48' /> <cite class="fn">Vaishnavi</cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata">
<a href="https://www.techbeatly.com/terraform-cheat-sheet/#comment-2122">February 6, 2022 at 3:25 pm</a> </div>
<p>thanks for the great article!!</p>
<div class='jetpack-comment-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-comment-wrapper-147587587-2122-62f376640aae4' data-src='https://widgets.wp.com/likes/#blog_id=147587587&comment_id=2122&origin=www.techbeatly.com&obj_id=147587587-2122-62f376640aae4' data-name='like-comment-frame-147587587-2122-62f376640aae4'>
<div class='likes-widget-placeholder comment-likes-widget-placeholder comment-likes'><span class='loading'>Loading...</span></div>
<div class='comment-likes-widget jetpack-likes-widget comment-likes'><span class='comment-like-feedback'></span><span class='sd-text-color'></span><a class='sd-link-color'></a></div>
</div>
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='https://www.techbeatly.com/terraform-cheat-sheet/?replytocom=2122#respond' data-commentid="2122" data-postid="10240" data-belowelement="div-comment-2122" data-respondelement="respond" data-replyto="Reply to Vaishnavi" aria-label='Reply to Vaishnavi'>Reply</a></div>
</div>
</li>
<li class="pingback even thread-even depth-1" id="comment-2242">
<div id="div-comment-2242" class="comment-body">
<div class="comment-author vcard">
<cite class="fn"><a href='https://www.techbeatly.com/terraform-free-courses/' rel='external nofollow ugc' class='url'>10 Free Courses to Learn Terraform – techbeatly</a></cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata">
<a href="https://www.techbeatly.com/terraform-cheat-sheet/#comment-2242">February 24, 2022 at 8:53 pm</a> </div>
<p>[…] Terraform? Check this Terraform cheat sheet for quick […]</p>
<div class='jetpack-comment-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-comment-wrapper-147587587-2242-62f376640ad7c' data-src='https://widgets.wp.com/likes/#blog_id=147587587&comment_id=2242&origin=www.techbeatly.com&obj_id=147587587-2242-62f376640ad7c' data-name='like-comment-frame-147587587-2242-62f376640ad7c'>
<div class='likes-widget-placeholder comment-likes-widget-placeholder comment-likes'><span class='loading'>Loading...</span></div>
<div class='comment-likes-widget jetpack-likes-widget comment-likes'><span class='comment-like-feedback'></span><span class='sd-text-color'></span><a class='sd-link-color'></a></div>
</div>
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='https://www.techbeatly.com/terraform-cheat-sheet/?replytocom=2242#respond' data-commentid="2242" data-postid="10240" data-belowelement="div-comment-2242" data-respondelement="respond" data-replyto="Reply to 10 Free Courses to Learn Terraform – techbeatly" aria-label='Reply to 10 Free Courses to Learn Terraform – techbeatly'>Reply</a></div>
</div>
</li>
</ol>
</div>
<div id="respond" class="comment-respond">
<h3 id="reply-title" class="comment-reply-title">Leave a Reply <small><a rel="nofollow" id="cancel-comment-reply-link" href="/terraform-cheat-sheet/#respond" style="display:none;">Cancel reply</a></small></h3><form action="https://www.techbeatly.com/wp-comments-post.php" method="post" id="commentform" class="comment-form"><p class="comment-notes"><span id="email-notes">Your email address will not be published.</span> <span class="required-field-message" aria-hidden="true">Required fields are marked <span class="required" aria-hidden="true">*</span></span></p><p class="comment-form-comment"><label for="comment">Comment <span class="required" aria-hidden="true">*</span></label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p><p class="comment-form-author"><label for="author">Name <span class="required" aria-hidden="true">*</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" required="required" /></p>
<p class="comment-form-email"><label for="email">Email <span class="required" aria-hidden="true">*</span></label> <input id="email" name="email" type="text" value="" size="30" maxlength="100" aria-describedby="email-notes" required="required" /></p>
<p class="comment-form-url"><label for="url">Website</label> <input id="url" name="url" type="text" value="" size="30" maxlength="200" /></p>
<p class="comment-subscription-form"><input type="checkbox" name="subscribe_comments" id="subscribe_comments" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;" /> <label class="subscribe-label" id="subscribe-label" for="subscribe_comments">Notify me of follow-up comments by email.</label></p><p class="comment-subscription-form"><input type="checkbox" name="subscribe_blog" id="subscribe_blog" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;" /> <label class="subscribe-label" id="subscribe-blog-label" for="subscribe_blog">Notify me of new posts by email.</label></p><p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="Post Comment" /> <input type='hidden' name='comment_post_ID' value='10240' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='0' />
</p><p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="b43c89626d" /></p><p style="display: none !important;"><label>Δ<textarea name="ak_hp_textarea" cols="45" rows="8" maxlength="100"></textarea></label><input type="hidden" id="ak_js_1" name="ak_js" value="60" /><script type="92814b2e02b11c1b32c775f9-text/javascript">document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() );</script></p></form> </div>
<p class="akismet_comment_form_privacy_notice">This site uses Akismet to reduce spam. <a href="https://akismet.com/privacy/" target="_blank" rel="nofollow noopener">Learn how your comment data is processed</a>.</p>
</section></p>
</div>
</div> </div>
</div> </div>
</div>
</div> </div> </div>
<footer id="nimble-footer" class="">
<div class="sektion-wrapper nb-loc " data-sek-level="location" data-sek-id="nimble_global_footer" data-sek-is-global-location="true" data-sek-is-footer-location="true"> <div data-sek-level="section" data-sek-id="__nimble__6e3aec199310" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__8dfdf4e60eba" class="sek-column sek-col-base sek-col-100 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__6ddcbd06a0fd" data-sek-module-type="czr_simple_html_module" class="sek-module " title=""> <div class="sek-module-inner">
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-1676785078101005" data-ad-slot="4201989068" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
</script> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__2dfb3c986a52" data-sek-module-type="czr_widget_area_module" class="sek-module " title=""> <div class="sek-module-inner">
<aside id="block-7" class="widget widget_block"></aside> </div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__884f8992a2e2" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__58f6b33630a7" class="sek-column sek-col-base sek-col-33 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__fd17d30be11a" data-sek-module-type="czr_heading_module" class="sek-module " title=""> <div class="sek-module-inner">
<h2 class="sek-heading">Ansible</h2> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__1de5cee682db" data-sek-module-type="czr_post_grid_module" class="sek-module " title=""> <div class="sek-module-inner">
<div class="sek-post-grid-wrapper sek-has-mobile-breakpoint" id="__nimble__1de5cee682db">
<div class="sek-grid-items sek-list-layout sek-thumb-custom-height ">
<article id="sek-pg-4662" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/ansible-extra-variables/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/01/ansible-general-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/ansible-extra-variables/" rel="bookmark">How to pass extra variables to an Ansible playbook</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">January 18, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-10973" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/ansible-gmail/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/01/google-myaccount-security-poster-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/ansible-gmail/" rel="bookmark">How to send email using Ansible and Gmail</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">January 11, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-10623" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/ansible-navigator-cheat-sheet/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/12/ansible-navigator-cheatsheet-techbeatly-new-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/ansible-navigator-cheat-sheet/" rel="bookmark">Ansible Navigator Cheat Sheet</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">December 12, 2021</span>
</aside>
</div> </article>
<article id="sek-pg-10524" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/ansible-and-vscode-remote-development/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/11/ansible-vscode-remote-development-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/ansible-and-vscode-remote-development/" rel="bookmark">Ansible and VSCode Remote Development [LIVE]</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">November 30, 2021</span>
</aside>
</div> </article>
<article id="sek-pg-10423" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/ansible-convert-list-to-string/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/11/ansible-list-to-string-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/ansible-convert-list-to-string/" rel="bookmark">Ansible Convert List to String</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">November 26, 2021</span>
</aside>
</div> </article>
</div>
</div> </div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__43db08f96700" class="sek-column sek-col-base sek-col-33 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__8f7390830e43" data-sek-module-type="czr_heading_module" class="sek-module " title=""> <div class="sek-module-inner">
<h2 class="sek-heading">OpenShift</h2> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__e9a32aa82e20" data-sek-module-type="czr_post_grid_module" class="sek-module " title=""> <div class="sek-module-inner">
<div class="sek-post-grid-wrapper sek-has-mobile-breakpoint" id="__nimble__e9a32aa82e20">
<div class="sek-grid-items sek-list-layout sek-thumb-custom-height ">
<article id="sek-pg-12574" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/learn-openshift/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/04/redhat-openshift-courses-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/learn-openshift/" rel="bookmark">Learn OpenShift – A Comprehensive Guide for OpenShift Courses and Exams</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">April 12, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-12453" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/kubernetes-networking-fundamentals/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/03/kubernetes-networking-dark-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/kubernetes-networking-fundamentals/" rel="bookmark">Kubernetes Networking Fundamentals</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">March 13, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-11899" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/openshift-4-pushing-my-cluster-to-the-limit/">
<img width="768" height="512" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/07/QT-Sea-port-768x512.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/openshift-4-pushing-my-cluster-to-the-limit/" rel="bookmark">OpenShift 4: Pushing my cluster to the limit</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">February 8, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-10163" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/sigstore-securing-my-software-with-a-new-standard/">
<img width="320" height="212" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2009/09/111.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/sigstore-securing-my-software-with-a-new-standard/" rel="bookmark">SigStore: Securing my software with a new standard</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">November 15, 2021</span>
</aside>
</div> </article>
<article id="sek-pg-9942" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/openshift-operators-kubernetes-operators/">
<img width="768" height="432" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/10/openshift-bootcamp-operators-768x432.png" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/openshift-operators-kubernetes-operators/" rel="bookmark">OpenShift Operators (Kubernetes Operators)</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">October 30, 2021</span>
</aside>
</div> </article>
</div>
</div> </div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__c036503f8fd5" class="sek-column sek-col-base sek-col-33 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__43c421be0915" data-sek-module-type="czr_heading_module" class="sek-module " title=""> <div class="sek-module-inner">
<h2 class="sek-heading">DevOps</h2> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__911137c72348" data-sek-module-type="czr_post_grid_module" class="sek-module " title=""> <div class="sek-module-inner">
<div class="sek-post-grid-wrapper sek-has-mobile-breakpoint" id="__nimble__911137c72348">
<div class="sek-grid-items sek-list-layout sek-thumb-custom-height ">
<article id="sek-pg-12795" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/no-code-app-development/">
<img width="768" height="513" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/06/pexels-christina-morillo-1181472-coding-768x513.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/no-code-app-development/" rel="bookmark">All You Need To Know About No-Code App Development</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">June 24, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-12762" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/7-devops-trends-in-2022/">
<img width="768" height="512" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/05/pexels-realtoughcandycom-11035393_1920-768x512.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/7-devops-trends-in-2022/" rel="bookmark">7 DevOps Trends in 2022</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">May 22, 2022</span>
</aside>
</div> </article>
<article id="sek-pg-12750" class="sek-has-thumb">
<figure class="sek-pg-thumbnail">
<a href="https://www.techbeatly.com/4-common-devops-challenges/">
<img width="768" height="504" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2022/05/annie-spratt-hCb3lIB8L8E-unsplash-devops-mistakes-chatty-768x504.jpg" class="attachment-medium_large size-medium_large no-lazy" alt="" /> </a>
</figure>
<div class="sek-pg-content">
<h2 class="sek-pg-title">
<a href="https://www.techbeatly.com/4-common-devops-challenges/" rel="bookmark">4 Common DevOps Challenges and How Developers Can Overcome Them</a>
</h2>
<aside class="sek-pg-metas">
<span class="published updated">May 11, 2022</span>
</aside>
</div> </article>
</div>
</div> </div>
</div> <div data-sek-level="module" data-sek-id="__nimble__8586d69490c5" data-sek-module-type="czr_widget_area_module" class="sek-module " title=""> <div class="sek-module-inner">
<aside id="block-3" class="widget widget_block"><p><strong>Jobs on Jooble</strong><br>
<a target="_blank" href="https://jooble.org"><img src="https://www.techbeatly.com/wp-content/uploads/2021/05/jooble-logo.png" border="0" alt="Jobs on Jooble" style="height: 40px;"></a></p></aside><aside id="block-5" class="widget widget_block"><a href="https://click.linksynergy.com/fs-bin/click?id=*6VVFTf6u7k&offerid=507388.21309&subid=0&type=4"><IMG border="0" alt="Sharpen your skills with cutting-edge courses starting at just 12,99 €." src="https://ad.linksynergy.com/fs-bin/show?id=*6VVFTf6u7k&bids=507388.21309&subid=0&type=4&gridnum=19"></a></aside> </div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__64096c93c451" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__26f8a3b4821c" class="sek-column sek-col-base sek-col-100 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__2f037a87d6e4" data-sek-module-type="czr_simple_html_module" class="sek-module " title=""> <div class="sek-module-inner">
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-1676785078101005" data-ad-slot="6650994718" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
</script> </div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__2a37f46b8c13" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__8239a7b8fab0" class="sek-column sek-col-base sek-section-custom-breakpoint-col-25 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__62d9bb31fba2" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><a href="https://www.techbeatly.com/comment-policy" rel="noopener">Privacy Policy</a></p>
<p><a href="https://www.techbeatly.com/comment-policy" rel="noopener">Comment Policy</a></p>
<p><a href="https://www.techbeatly.com/affiliate-policy" rel="noopener">Affiliate Policy</a></p>
<p> </p>
</div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__35a78a068992" class="sek-column sek-col-base sek-section-custom-breakpoint-col-25 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__4158a1fb3ace" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><a href="https://www.techbeatly.com/editorial">Editorial</a></p>
<p><a href="https://www.techbeatly.com/sponsored/" rel="noopener">Advertisements</a></p>
<p><a href="https://www.techbeatly.com/about" rel="noopener">About</a></p>
<p><a href="https://www.techbeatly.com/contribute" rel="noopener">Contribute</a></p>
</div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__0de10e800bd8" class="sek-column sek-col-base sek-section-custom-breakpoint-col-25 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__0d279d61ad33" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><a href="https://www.techbeatly.com/category/ansible">Ansible</a></p>
<p><a href="https://www.techbeatly.com/category/openshift">OpenShift</a></p>
<p><a href="https://www.techbeatly.com/category/kubernetes">Kubernetes</a></p>
<p><a href="https://www.techbeatly.com/category/terraform">Terraform</a></p>
</div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__9d4e515298a5" class="sek-column sek-col-base sek-section-custom-breakpoint-col-25 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__d30c0fe27575" data-sek-module-type="czr_tiny_mce_editor_module" class="sek-module " title=""> <div class="sek-module-inner">
<p><a href="https://www.techbeatly.com/category/devops">DevOps</a></p>
<p><a href="https://www.techbeatly.com/category/cloud">Cloud</a></p>
<p><a href="https://www.techbeatly.com/category/videos">Videos</a></p>
</div>
</div> </div>
</div> </div>
</div>
</div><div data-sek-level="section" data-sek-id="__nimble__154332b51f20" class="sek-section sek-has-modules ">
<div class="sek-container-fluid">
<div class="sek-row sek-sektion-inner">
<div data-sek-level="column" data-sek-id="__nimble__9e7963876a82" class="sek-column sek-col-base sek-section-custom-breakpoint-col-33 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__400b8557aa06" data-sek-module-type="czr_image_module" class="sek-module " title=""> <div class="sek-module-inner">
<a class="sek-link-to-url " href="https://www.techbeatly.com"><figure class=" sek-img" title="techbeatly-logo-v4.1-gray"><img width="1000" height="300" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/09/techbeatly-logo-v4.1-gray-1.png" class="attachment-original size-original no-lazy" alt="" /></figure></a> </div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__d89bcba835ec" class="sek-column sek-col-base sek-section-custom-breakpoint-col-33 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__673ccc5c49b5" data-sek-module-type="czr_heading_module" class="sek-module " title=""> <div class="sek-module-inner">
<h1 class="sek-heading">© 2022 | techbeatly</h1> </div>
</div> </div>
</div><div data-sek-level="column" data-sek-id="__nimble__4c899df27bd7" class="sek-column sek-col-base sek-section-custom-breakpoint-col-33 "> <div class="sek-column-inner ">
<div data-sek-level="module" data-sek-id="__nimble__e69a9539c9b8" data-sek-module-type="czr_social_icons_module" class="sek-module " title=""> <div class="sek-module-inner">
<ul class="sek-social-icons-wrapper"><li data-sek-item-id="aab11906bf12"><a title="" aria-label="" href="https://www.facebook.com/techbeatly" rel="nofollow"><i class="sek-social-icon fab fa-facebook"></i><span class="screen-reader-text">fab fa-facebook</span></a></li><li data-sek-item-id="b05e51d64440"><a title="" aria-label="" href="https://twitter.com/techbeatly" rel="nofollow"><i class="sek-social-icon fab fa-twitter"></i><span class="screen-reader-text">fab fa-twitter</span></a></li><li data-sek-item-id="60be5cf45d9b"><a title="" aria-label="" href="https://www.instagram.com/techbeatly/" rel="nofollow"><i class="sek-social-icon fab fa-instagram"></i><span class="screen-reader-text">fab fa-instagram</span></a></li><li data-sek-item-id="6bdf3556f7f7"><a title="" aria-label="" href="https://www.linkedin.com/company/techbeatly/" rel="nofollow"><i class="sek-social-icon fab fa-linkedin"></i><span class="screen-reader-text">fab fa-linkedin</span></a></li><li data-sek-item-id="a2e2b4b2fe74"><a title="" aria-label="" href="https://www.youtube.com/techbeatly" rel="nofollow"><i class="sek-social-icon fab fa-youtube"></i><span class="screen-reader-text">fab fa-youtube</span></a></li><li data-sek-item-id="2b6e300afab9"><a title="Telegram" aria-label="Telegram" href="https://t.me/techbeatly" target="_blank" rel="nofollow noopener noreferrer"><i class="sek-social-icon fab fa-telegram-plane"></i><span class="screen-reader-text">fab fa-telegram-plane</span></a></li></ul> </div>
</div> </div>
</div> </div>
</div>
</div> </div> </footer>
</div>
<div class="simple-banner simple-banner-text" style="display:none !important"></div>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
window.WPCOM_sharing_counts = {"https:\/\/www.techbeatly.com\/terraform-cheat-sheet\/":10240};
</script>
<style id='nimble-global-inline-style-inline-css'>
[data-sek-level="section"] > .sek-container-fluid > .sek-sektion-inner{max-width:1140px;margin:0 auto;}[data-sek-level="section"] > .sek-container-fluid{padding-left:inherit;padding-right:inherit;}@media(max-width:767px){[data-sek-level="section"] > .sek-container-fluid{padding-left:inherit;padding-right:inherit;}}@media(max-width:575px){[data-sek-level="section"] > .sek-container-fluid{padding-left:inherit;padding-right:inherit;}}
</style>
<link rel='stylesheet' id='lwptoc-main-css' href='https://www.techbeatly.com/wp-content/plugins/luckywp-table-of-contents/front/assets/main.min.css?ver=2.1.4' media='all' />
<script src='https://c0.wp.com/p/jetpack/11.2/modules/likes/queuehandler.js' id='jetpack_likes_queuehandler-js' type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script id='nb_emit_nb-needs-menu-js-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
(function(){if(window.nb_){nb_.emit("nb-needs-menu-js");}})();
</script>
<script src='https://www.techbeatly.com/wp-content/plugins/luckywp-table-of-contents/front/assets/main.min.js?ver=2.1.4' id='lwptoc-main-js' type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script id='nb_module_custom_js___nimble__f42d6388016e-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
;
</script>
<script id='nb_module_custom_js___nimble__6f3cf33cbb91-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
;
</script>
<script id='nb_module_custom_js___nimble__8bb5099721f2-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
;
</script>
<script defer src='https://www.techbeatly.com/wp-content/plugins/akismet/_inc/akismet-frontend.js?ver=1658855962' id='akismet-frontend-js' type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script id='nb_module_custom_js___nimble__6ddcbd06a0fd-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
;
</script>
<script id='nb_module_custom_js___nimble__2f037a87d6e4-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
;
</script>
<script id='nb_emit_nb-needs-fa-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
(function(){if(window.nb_){nb_.emit("nb-needs-fa");}})();
</script>
<script id='sharing-js-js-extra' type="92814b2e02b11c1b32c775f9-text/javascript">
var sharing_js_options = {"lang":"en","counts":"1","is_stats_active":"1"};
</script>
<script src='https://c0.wp.com/p/jetpack/11.2/_inc/build/sharedaddy/sharing.min.js' id='sharing-js-js' type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script id='sharing-js-js-after' type="92814b2e02b11c1b32c775f9-text/javascript">
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}
document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}
var el;
if ( matches( event.target, 'a.share-twitter' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-twitter' ) ) {
el = event.target.parentNode;
}
if ( el ) {
event.preventDefault();
// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomtwitter', 'menubar=1,resizable=1,width=600,height=350' );
return false;
}
} );
} )();
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}
document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}
var el;
if ( matches( event.target, 'a.share-facebook' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-facebook' ) ) {
el = event.target.parentNode;
}
if ( el ) {
event.preventDefault();
// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomfacebook', 'menubar=1,resizable=1,width=600,height=400' );
return false;
}
} );
} )();
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}
document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}
var el;
if ( matches( event.target, 'a.share-linkedin' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-linkedin' ) ) {
el = event.target.parentNode;
}
if ( el ) {
event.preventDefault();
// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomlinkedin', 'menubar=1,resizable=1,width=580,height=450' );
return false;
}
} );
} )();
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}
document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}
var el;
if ( matches( event.target, 'a.share-tumblr' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-tumblr' ) ) {
el = event.target.parentNode;
}
if ( el ) {
event.preventDefault();
// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomtumblr', 'menubar=1,resizable=1,width=450,height=450' );
return false;
}
} );
} )();
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}
document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}
var el;
if ( matches( event.target, 'a.share-pocket' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-pocket' ) ) {
el = event.target.parentNode;
}
if ( el ) {
event.preventDefault();
// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcompocket', 'menubar=1,resizable=1,width=450,height=450' );
return false;
}
} );
} )();
</script>
<!--[if lt IE 9]>
<script src="https://www.techbeatly.com/wp-content/themes/hueman/assets/front/js/ie/respond.js"></script>
<![endif]-->
<iframe src='https://widgets.wp.com/likes/master.html?ver=202232#ver=202232' scrolling='no' id='likes-master' name='likes-master' style='display:none;'></iframe>
<div id='likes-other-gravatars'><div class="likes-text"><span>%d</span> bloggers like this:</div><ul class="wpl-avatars sd-like-gravatars"></ul></div>
<script src='https://stats.wp.com/e-202232.js' defer type="92814b2e02b11c1b32c775f9-text/javascript"></script>
<script type="92814b2e02b11c1b32c775f9-text/javascript">
_stq = window._stq || [];
_stq.push([ 'view', {v:'ext',j:'1:11.2',blog:'147587587',post:'10240',tz:'8',srv:'www.techbeatly.com'} ]);
_stq.push([ 'clickTrackerInit', '147587587', '10240' ]);
</script>
<script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="92814b2e02b11c1b32c775f9-|49" defer=""></script></body>
</html>
In [2]:
import requests
from readability import Document
response = requests.get("https://www.techbeatly.com/terraform-cheat-sheet")
doc = Document(response.text)
print(doc.title())
print(doc.summary())
Terraform Cheat Sheet - techbeatly
<html><body><div><div class="sek-module-inner">
<p>
<figure class="wp-block-image size-large"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new-1024x576.png" alt="" class="wp-image-10366" data-sek-srcset="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new-1024x576.png 1024w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new-300x169.png 300w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new-768x432.png 768w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-cheat-sheet-techbeatly-new.png 1280w" data-sek-sizes="(max-width: 1024px) 100vw, 1024px"></figure></p><h2><span id="What_is_Terraform">What is Terraform</span></h2>
<p>Terraform is an open-source software tool to manage end to end lifecycle of your IT infrastructure. Terraform provides a consistent CLI workflow to manage hundreds of cloud services. </p>
<h3><span id="Latest_Terraform_Articles">Latest Terraform Articles </span></h3>
<h2><span id="Installing_Terraform">Installing Terraform</span></h2>
<p>You can download the Terraform software from <strong><a rel="noreferrer noopener" href="https://www.terraform.io/downloads.html" data-type="URL" data-id="https://www.terraform.io/downloads.html" target="_blank">HashiCorp’s download</a></strong> page and use native installation methods for your operating system. Also you can install Terraform using the package managers like <code>yum</code>, <code>apt</code>, <code>homebrew</code>, Chocolatey (<code>choco</code>) etc. Refer <strong><a rel="noreferrer noopener" href="https://learn.hashicorp.com/tutorials/terraform/install-cli" data-type="URL" data-id="https://learn.hashicorp.com/tutorials/terraform/install-cli" target="_blank">install Terraform </a></strong>page for the appropriate method for your operating system.</p>
<figure class="wp-block-image size-full"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-sek-src="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-installation-methods.png" alt="" class="wp-image-10340" data-sek-srcset="https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-installation-methods.png 821w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-installation-methods-300x200.png 300w, https://www.techbeatly.com/wp-content/uploads/2021/11/terraform-installation-methods-768x511.png 768w" data-sek-sizes="(max-width: 821px) 100vw, 821px"></figure><h2><span id="Terraform_CLI_Cheat_Sheet">Terraform CLI Cheat Sheet</span></h2>
<p>Please note, this cheat sheet is a living document and I will make changes whenever there is an update or changes in the Terraform CLI options or versions. This cheat sheet does not written in an alphabetical order or based on workflow.</p>
<p>Planning <strong><a href="https://www.youtube.com/watch?v=cozEYDS9Ajg&t=226s" data-type="URL" data-id="https://www.youtube.com/watch?v=cozEYDS9Ajg&t=226s" target="_blank" rel="noreferrer noopener">HashiCorp Certified Terraform Associate Certification</a></strong> ? Watch the video for details.</p>
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"></figure><h3><span id="terraform_version">terraform version</span></h3>
<pre class="wp-block-code"><code>$ terraform version
Terraform v1.0.1
on darwin_amd64</code></pre>
<h3><span id="terraform_init">terraform init</span></h3>
<pre class="wp-block-code"><code>$ terraform init</code></pre>
<p><meta charset="utf-8">Ask for input if necessary. If false, will error if input was required.</p>
<pre class="wp-block-code"><code>$ terraform init -input=false</code></pre>
<p>You can also change the backend details using <code>-backend-config</code> option. <code>-reconfigure</code> will reconfigure the backend, ignoring any saved configuration.</p>
<pre class="wp-block-code"><code>$ terraform init -backend-config=PATH/TO/CONFIGURATION_FILE -reconfigure</code></pre>
<h3><span id="terraform_plan">terraform plan</span></h3>
<p>The<strong> </strong><code>plan</code> will check the configuration files (basically all the <code>*.tf</code> files in the directory) and will show you the items or changes going to made on target infrastructure or resources. Please note, this command will not actually perform the planned actions.</p>
<pre class="wp-block-code"><code><meta charset="utf-8">$ terraform plan</code></pre>
<p>You can optionally save the plan to a file, which you can then pass to the <code>apply</code> command to perform exactly the actions described in the plan.</p>
<pre class="wp-block-code"><code>$ terraform plan -out plan.out</code></pre>
<h3><span id="terraform_get">terraform get</span></h3>
<p>Downloads and installs modules needed for the configuration given by PATH. <code>get</code> recursively downloads all modules needed, such as modules imported by modules imported by the root and so on. Module installation also happens automatically by default as part of<br>the “terraform init” command, so <span>you should rarely need to run this command separately.</span></p>
<pre class="wp-block-code"><code>$ terraform get</code></pre>
<p>You can update the already downloaded modules using <code>-update=true</code> option.</p>
<pre class="wp-block-code"><code><meta charset="utf-8">$ terraform get -update=true</code></pre>
<h3><span id="terraform_apply">terraform apply</span></h3>
<p><code>apply</code> will do the actual operation on the infrastructure resources. <code>apply</code> will show the plan and actions in detail. </p>
<pre class="wp-block-code"><code>$ terraform apply</code></pre>
<p><code>apply</code> will ask for your confirmation to proceed with changes. You can use <code>-auto-approve</code> for auto-confirmation.</p>
<pre class="wp-block-code"><code>$ terraform apply -auto-approve</code></pre>
<p>You can pass different variables or variable files.</p>
<pre class="wp-block-code"><code>$ terraform plan -var="instancetype=t2.small"
$ terraform plan -var-file="custom.tfvars</code></pre>
<p>You can use <code>-target</code> option to target specific resources, modules, or collections of resources.</p>
<pre class="wp-block-code"><code>$ terraform apply -target="aws_s3_bucket_object.objects"</code></pre>
<h3><span id="terraform_destroy">terraform destroy</span></h3>
<p>Warning: <code>destroy</code> will delete all resource but with confirmation.</p>
<pre class="wp-block-code"><code>$ terraform destroy</code></pre>
<p>You can create a deletion plan as below.</p>
<pre class="wp-block-code"><code>$ terraform plan –destroy</code></pre>
<p>Use the <code>-target</code> to destroy a specific resource.</p>
<pre class="wp-block-code"><code>$ terraform destroy -target<meta charset="utf-8">="aws_s3_bucket_object.objects"</code></pre>
<p>Also note, you can comment out the resource, then terraform will detect it as not part of config and will remove when you do <code>plan</code> or <code>apply</code>.</p>
<h3><span id="terraform_refresh">terraform refresh</span></h3>
<p>You can update the terraform state file with metadata that matches the physical resources they are tracking.</p>
<pre class="wp-block-code"><code>$ terraform refresh</code></pre>
<h3><span id="terraform_show">terraform show</span></h3>
<p>Show the terraform state information in a human readable format. You can also use it for displaying information from plan file.</p>
<pre class="wp-block-code"><code>$ terraform show</code></pre>
<h3><span id="terraform_validate">terraform validate</span></h3>
<p>You can check the syntax and validate the configuration using <code>validate</code> subcommand.</p>
<pre class="wp-block-code"><code>$ terraform validate
Success! The configuration is valid.</code></pre>
<h3><span id="terraform_providers">terraform providers</span></h3>
<p>You can see the providers in use by the modules and configurations in your Terraform files. </p>
<pre class="wp-block-code"><code>$ terraform providers
Providers required by configuration:
.
└── provider[registry.terraform.io/hashicorp/aws]</code></pre>
<h3><span id="terraform_state">terraform state</span></h3>
<p><code>terraform state</code> has multiple subcommands to manage the terraform state. You can <code>move</code>, <code>rm</code> (delete), <code>list</code> or <code>show</code> the resource state.</p>
<pre class="wp-block-code"><code>Subcommands:
list List resources in the state
mv Move an item in the state
pull Pull current state and output to stdout
push Update remote state from a local state file
replace-provider Replace provider in the state
rm Remove instances from the state
show Show a resource in the state</code></pre>
<p>Example usages</p>
<pre class="wp-block-code"><code># List state
$ terraform state list
aws_iam_user.lb
aws_instance.myec2
# Show resource
$ terraform state show aws_instance.myec2
# Push terraform state to remote backend
$ tarraform state push
# Pull the remote terraform state to a local copy
$ terraform state pull > terraform.tfstate
# Update and tell terraform that <strong>packet_device.worker</strong> has been renamed to <meta charset="utf-8"><strong>packet_device.helper</strong>
$ terraform state mv <strong>packet_device.worker packet_device.helper</strong>
# Move the resource block into the child module configuration
$ terraform state mv <strong>packet_device.worker</strong> <strong>module.worker.packet_device.worker</strong>
# Remove the resource from state but it will not remove the resource from cloud/provider.
$ terraform state rm aws_instance.myec2</code></pre>
<p>Remove the resource from state but it will not remove the resource from cloud/provider. But next time when you run <code>terraform plan</code> or <code>apply</code>, Terraform will recreate the instance as again as the resource definition is still there.</p>
<pre class="wp-block-code"><code>$ terraform state rm aws_instance.myec2
Removed aws_instance.myec2
Successfully removed 1 resource instance(s).</code></pre>
<h3><span id="terraform_graph">terraform graph</span></h3>
<p><code>graph</code> will generate the visual graph of your infrastructure based on Terraform configuration files. </p>
<p>Outputs the visual execution graph of Terraform resources according to<br>either the current configuration or an execution plan.</p>
<pre class="wp-block-code"><code>$ terraform graph</code></pre>
<p>The output of terraform graph will be in DOT format and you can use tools like dot to generate image files from dot files. </p>
<pre class="wp-block-code"><code>sudo apt-get install graphviz
# or
sudo yum install graphviz
$ terraform graph | dot –Tpng > graph.png</code></pre>
<h3><span id="terraform_fmt">terraform fmt</span></h3>
<p>Rewrites all Terraform configuration files to a canonical format with appropriate indentation and styling. (JSON files (.tf.json or .tfvars.json) are not modified.)</p>
<pre class="wp-block-code"><code>$ terraform fmt</code></pre>
<h3><span id="terraform_taint">terraform taint</span></h3>
<p>You can manually mark a terraform managed resource as tainted and forcing it to be destroyed and recreated on the next apply. <code>terraform taint</code> command will make modification in the <code>tfstate</code> file and recreate action will happen in next apply. Please note, <code>terraform taint</code> command will not modify the <code>.tf</code> file or the infrastructure.</p>
<pre class="wp-block-code"><code>$ terraform taint aws_instance.myec2</code></pre>
<h3><span id="terraform_import">terraform import</span></h3>
<p>You can import your existing infrastructure into Terraform and manage using Terraform.</p>
<pre class="wp-block-code"><code># Importing VMWare VM to terraform
$ terraform import vsphere_virtual_machine.vm /DC1/vm/DEV/DEV2</code></pre>
<p>Read our detailed guide: <strong><a rel="noreferrer noopener" href="https://www.techbeatly.com/how-to-import-existing-vmware-vm-in-to-terraform/" data-type="URL" data-id="https://www.techbeatly.com/how-to-import-existing-vmware-vm-in-to-terraform/" target="_blank">How to Import Existing VMWare VM’s into Terraform</a></strong></p>
<h3><span id="terraform_workspaces">terraform workspaces</span></h3>
<p><strong><a rel="noreferrer noopener" href="https://www.terraform.io/docs/cli/workspaces/index.html" data-type="URL" data-id="https://www.terraform.io/docs/cli/workspaces/index.html" target="_blank">Terraform Workspaces</a></strong> will help to manage same terraform configurations for different environments (eg: dev, staging, production) in the same project directory. </p>
<pre class="wp-block-code"><code># Check the workspace
$ terraform workspace show
default
# Create new workspace
$ terraform workspace new dev
Created and switched to workspace "dev"!
# List all workspaces
$ terraform workspace list
default
* dev
# Switch to a specific workspace
$ terraform workspace select dev
Switched to workspace "dev".</code></pre>
<p>Terraform will create separate <code>terraform.tfstate</code> files in <code>terraform.tfstate.d/WORKSPACE_NAME/ </code>directories in the project directory.</p>
<pre class="wp-block-code"><code>$ tree terraform.tfstate.d/
terraform.tfstate.d/
├── dev
│ └── terraform.tfstate
├── prod
└── stage
└── terraform.tfstate
3 directories, 2 files</code></pre>
<p>You can use <code>${terraform.workspace}</code> interpolation to dynamically use the workspace name inside your terraform configuration (<code>*.tf</code>). Eg: you can use it for selecting instance type from an array based on workspace.</p>
<pre class="wp-block-code"><code>resource "aws_instance" "myec2" {
ami = "ami-0cd31be676780afa7"
instance_type = lookup(var.instance_type,terraform.workspace)
}
variable "instance_type" {
type = map
default = {
default = "t2.nano"
stage = "t2.nano"
dev = "t2.micro"
prod = "t2.large"
}
}</code></pre>
<p>Or you can use this <meta charset="utf-8"><code>${terraform.workspace}</code> for tagging the instance.</p>
<pre class="wp-block-code"><code>resource "aws_instance" "example" {
# ... other arguments
tags = {
Name = "web-${terraform.workspace}"
}
}</code></pre>
<p>Refer <strong><a href="https://www.terraform.io/docs/language/state/workspaces.html" data-type="URL" data-id="https://www.terraform.io/docs/language/state/workspaces.html" target="_blank" rel="noreferrer noopener">Terraform Workspaces</a></strong> documentation for more details.</p>
<p></p>
<h3><span id="Terraform_Default_Plugin_Directories">Terraform Default Plugin Directories</span></h3>
<ul><li>Windows: %APPDATA%\terraform.d\plugins</li><li>All other systems: ~/.terraform.d/plugins</li></ul><h3><span id="Terraform_Variable_Assignment">Terraform Variable Assignment</span></h3>
<p>You can pass variables to Terraform in different methods. </p>
<p>1. Environment variables – with a prefix <code>TF_VAR_</code></p>
<pre class="wp-block-code"><code>$ export TF_VAR_instance_type=t2.micro</code></pre>
<p>2. Command Line Flags</p>
<pre class="wp-block-code"><code><meta charset="utf-8">$ terraform plan -var="instancetype=t2.small"</code></pre>
<p>3. From a variable file – use <code>terraform.tfvars</code> – terraform will load all variables from this file. If different var files to be used then,</p>
<pre class="wp-block-code"><code>$ terraform plan -var-file="custom.tfvars</code></pre>
<p>4. Variable Defaults – can keep variable default in another <code>.tf</code> file.</p>
<pre class="wp-block-code"><code>$ cat variables.tf
variable "my_ip" {
default = "10.1.10.10/32"
}</code></pre>
<ul><li>if no value mentioned, then <code>default</code> value will be used.</li><li>if <code>default</code> value not defined, then terraform will ask for variable when you do <code>apply</code> or <code>plan</code> operation.</li></ul><h2><span id="Resources">Resources</span></h2>
<div class="sharedaddy sd-sharing-enabled"><div class="robots-nocontent sd-block sd-social sd-social-icon sd-sharing"><h3 class="sd-title"><span id="Share_this_to_your_network">Share this to your network:</span></h3></div></div>
<p id="jp-relatedposts" class="jp-relatedposts">
<h3 class="jp-relatedposts-headline"><em>Related</em></h3>
</p>
</div>
</div></body></html>
Create Book if it doesn't exist¶
In [29]:
import requests
import os
payload = {
"name": "terraform-cheatsheet",
"description": "terraform-cheatsheet",
"tags": [
{"name": "Platform", "value": "terraform"},
{"name": "Category", "value": "Code"},
{"name": "Type", "value": "Cheatsheet"},
],
}
headers = {
"X-API-KEY": os.getenv(X_API_KEY),
"Authorization": os.getenv(BOOKSTACK_API_TOKEN),
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
{"name":"python-cheatsheet","description":"python-cheatsheet","created_by":1,"updated_by":1,"owned_by":1,"slug":"python-cheatsheet","updated_at":"2022-08-10T00:14:32.000000Z","created_at":"2022-08-10T00:14:32.000000Z","id":3}
Create Chapters¶
List folders to map to chapters¶
In [23]:
import requests
chapters = ["cheatsheet", "modules", "builtin"]
url = "https://donavanaldrich.com/api/bookstack/chapters"
for chapter_name in chapters:
payload = {
"book_id": 2,
"name": chapter_name,
"description": chapter_name,
"tags": [{"name": "chapter", "value": chapter_name}],
}
headers = {
"X-API-KEY": os.getenv(X_API_KEY),
"Authorization": os.getenv(BOOKSTACK_API_TOKEN),
}
response = requests.request("POST", url, json=payload, headers=headers)
response_json = response.json()
chapter_id = response_json["id"]
print(chapter_id)
18 19 20
Add Pages¶
In [32]:
from pathlib import Path
import requests
import frontmatter
chapters = ["cheatsheet", "modules", "builtin"]
# The Python interpreter has a number of functions and types built into it that are always available.
# Standard Library
headers = {
"X-API-KEY": os.getenv(X_API_KEY),
"Authorization": os.getenv(BOOKSTACK_API_TOKEN),
}
url = "https://donavanaldrich.com/api/bookstack/books"
payload = {
"name": "python-cheatsheet",
"description": "python-cheatsheet",
"tags": [
{"name": "Platform", "value": "Python"},
{"name": "Category", "value": "Code"},
{"name": "Type", "value": "Cheatsheet"},
],
}
response = requests.request("POST", url, json=payload, headers=headers)
response_json = response.json()
book_id = response_json["id"]
# book_id = xs
#
for chapter in chapters:
payload = {
"book_id": book_id,
"name": chapter,
"description": chapter,
"tags": [{"name": "chapter", "value": chapter}],
}
url = "https://donavanaldrich.com/api/bookstack/chapters"
response = requests.request("POST", url, json=payload, headers=headers)
response_json = response.json()
chapter_id = response_json["id"]
print(chapter_id)
for page in Path("../temp/python-cheatsheets/" + chapter).iterdir():
url = "https://donavanaldrich.com/api/bookstack/pages"
with open(page, "r") as f:
# text = f.read()
# post = frontmatter.load(page)
metadata, content = frontmatter.parse(f.read())
try:
page_name = metadata["title"]
except:
page_name = str(page)
payload = {
"book_id": book_id,
"chapter_id": chapter_id,
"name": page_name,
"markdown": content,
"tags": [{"name": "chapter", "value": chapter}],
}
response = requests.request("POST", url, json=payload, headers=headers)
# print(response.text)
26 27 28
Development/Sandboxing¶
In [28]:
# for page in Path('../temp/python-cheatsheets/' + chapter).iterdir():
page = "../temp/python-cheatsheets/cheatsheet/debugging.md"
url = "https://donavanaldrich.com/api/bookstack/pages"
# print(page)
with open(page, "r") as f:
# text = f.read()
# post = frontmatter.load(page)
metadata, content = frontmatter.parse(f.read())
print(content)
# Python Debugging
<base-disclaimer>
<base-disclaimer-title>
<a target="_blank" href="https://en.wikipedia.org/wiki/Debugging">Finding and resolving bugs</a>
</base-disclaimer-title>
<base-disclaimer-content>
In computer programming and software development, debugging is the process of finding and resolving bugs (defects or problems that prevent correct operation) within computer programs, software, or systems.
</base-disclaimer-content>
</base-disclaimer>
## Raising Exceptions
Exceptions are raised with a raise statement. In code, a raise statement consists of the following:
- The `raise` keyword
- A call to the `Exception()` function
- A string with a helpful error message passed to the `Exception()` function
```python
>>> raise Exception('This is the error message.')
# Traceback (most recent call last):
# File "<pyshell#191>", line 1, in <module>
# raise Exception('This is the error message.')
# Exception: This is the error message.
```
Typically, it’s the code that calls the function, not the function itself, that knows how to handle an exception. So, you will commonly see a raise statement inside a function and the `try` and `except` statements in the code calling the function.
```python
>>> def box_print(symbol, width, height):
... if len(symbol) != 1:
... raise Exception('Symbol must be a single character string.')
... if width <= 2:
... raise Exception('Width must be greater than 2.')
... if height <= 2:
... raise Exception('Height must be greater than 2.')
... print(symbol * width)
... for i in range(height - 2):
... print(symbol + (' ' * (width - 2)) + symbol)
... print(symbol * width)
...
>>> for sym, w, h in (('*', 4, 4), ('O', 20, 5), ('x', 1, 3), ('ZZ', 3, 3)):
... try:
... box_print(sym, w, h)
... except Exception as err:
... print('An exception happened: ' + str(err))
...
# ****
# * *
# * *
# ****
# OOOOOOOOOOOOOOOOOOOO
# O O
# O O
# O O
# OOOOOOOOOOOOOOOOOOOO
# An exception happened: Width must be greater than 2.
# An exception happened: Symbol must be a single character string.
```
Read more about [Exception Handling](/cheatsheet/exception-handling).
## Getting the Traceback as a string
The `traceback` is displayed by Python whenever a raised exception goes unhandled. But can also obtain it as a string by calling traceback.format_exc(). This function is useful if you want the information from an exception’s traceback but also want an except statement to gracefully handle the exception. You will need to import Python’s traceback module before calling this function.
```python
>>> import traceback
>>> try:
... raise Exception('This is the error message.')
>>> except:
... with open('errorInfo.txt', 'w') as error_file:
... error_file.write(traceback.format_exc())
... print('The traceback info was written to errorInfo.txt.')
...
# 116
# The traceback info was written to errorInfo.txt.
```
The 116 is the return value from the `write()` method, since 116 characters were written to the file. The `traceback` text was written to errorInfo.txt.
Traceback (most recent call last):
File "<pyshell#28>", line 2, in <module>
Exception: This is the error message.
## Assertions
An assertion is a sanity check to make sure your code isn’t doing something obviously wrong. These sanity checks are performed by `assert` statements. If the sanity check fails, then an `AssertionError` exception is raised. In code, an `assert` statement consists of the following:
- The `assert` keyword
- A condition (that is, an expression that evaluates to `True` or `False`)
- A comma
- A `string` to display when the condition is `False`
```python
>>> pod_bay_door_status = 'open'
>>> assert pod_bay_door_status == 'open', 'The pod bay doors need to be "open".'
>>> pod_bay_door_status = 'I\'m sorry, Dave. I\'m afraid I can\'t do that.'
>>> assert pod_bay_door_status == 'open', 'The pod bay doors need to be "open".'
# Traceback (most recent call last):
# File "<pyshell#10>", line 1, in <module>
# assert pod_bay_door_status == 'open', 'The pod bay doors need to be "open".'
# AssertionError: The pod bay doors need to be "open".
```
In plain English, an assert statement says, “I assert that this condition holds true, and if not, there is a bug somewhere in the program.” Unlike exceptions, your code should not handle assert statements with try and except; if an assert fails, your program should crash. By failing fast like this, you shorten the time between the original cause of the bug and when you first notice the bug. This will reduce the amount of code you will have to check before finding the code that’s causing the bug.
### Disabling Assertions
Assertions can be disabled by passing the `-O` option when running Python.
## Logging
To enable the `logging` module to display log messages on your screen as your program runs, copy the following to the top of your program:
```python
>>> import logging
>>> logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s- %(message)s')
```
Say you wrote a function to calculate the factorial of a number. In mathematics, factorial 4 is 1 × 2 × 3 × 4, or 24. Factorial 7 is 1 × 2 × 3 × 4 × 5 × 6 × 7, or 5,040. Open a new file editor window and enter the following code. It has a bug in it, but you will also enter several log messages to help yourself figure out what is going wrong. Save the program as factorialLog.py.
```python
>>> import logging
>>> logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s- %(message)s')
>>> logging.debug('Start of program')
>>> def factorial(n):
... logging.debug('Start of factorial(%s)' % (n))
... total = 1
... for i in range(1, n + 1):
... total *= i
... logging.debug('i is ' + str(i) + ', total is ' + str(total))
... logging.debug('End of factorial(%s)' % (n))
... return total
...
>>> print(factorial(5))
>>> logging.debug('End of program')
# 2015-05-23 16:20:12,664 - DEBUG - Start of program
# 2015-05-23 16:20:12,664 - DEBUG - Start of factorial(5)
# 2015-05-23 16:20:12,665 - DEBUG - i is 0, total is 0
# 2015-05-23 16:20:12,668 - DEBUG - i is 1, total is 0
# 2015-05-23 16:20:12,670 - DEBUG - i is 2, total is 0
# 2015-05-23 16:20:12,673 - DEBUG - i is 3, total is 0
# 2015-05-23 16:20:12,675 - DEBUG - i is 4, total is 0
# 2015-05-23 16:20:12,678 - DEBUG - i is 5, total is 0
# 2015-05-23 16:20:12,680 - DEBUG - End of factorial(5)
# 0
# 2015-05-23 16:20:12,684 - DEBUG - End of program
```
## Logging Levels
Logging levels provide a way to categorize your log messages by importance. There are five logging levels, described in Table 10-1 from least to most important. Messages can be logged at each level using a different logging function.
| Level | Logging Function | Description |
| ---------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `DEBUG` | `logging.debug()` | The lowest level. Used for small details. Usually you care about these messages only when diagnosing problems. |
| `INFO` | `logging.info()` | Used to record information on general events in your program or confirm that things are working at their point in the program. |
| `WARNING` | `logging.warning()` | Used to indicate a potential problem that doesn’t prevent the program from working but might do so in the future. |
| `ERROR` | `logging.error()` | Used to record an error that caused the program to fail to do something. |
| `CRITICAL` | `logging.critical()` | The highest level. Used to indicate a fatal error that has caused or is about to cause the program to stop running entirely. |
## Disabling Logging
After you’ve debugged your program, you probably don’t want all these log messages cluttering the screen. The logging.disable() function disables these so that you don’t have to go into your program and remove all the logging calls by hand.
```python
>>> import logging
>>> logging.basicConfig(level=logging.INFO, format=' %(asctime)s -%(levelname)s - %(message)s')
>>> logging.critical('Critical error! Critical error!')
# 2015-05-22 11:10:48,054 - CRITICAL - Critical error! Critical error!
>>> logging.disable(logging.CRITICAL)
>>> logging.critical('Critical error! Critical error!')
>>> logging.error('Error! Error!')
```
## Logging to a File
Instead of displaying the log messages to the screen, you can write them to a text file. The `logging.basicConfig()` function takes a filename keyword argument, like so:
```python
>>> import logging
>>> logging.basicConfig(filename='myProgramLog.txt', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
```
Reference¶
Payloads¶
book¶
{
"name": "python-cheatsheet",
"description": "python-cheatsheet",
"tags": [
{ "name": "Platform", "value": "Python" },
{ "name": "Category", "value": "Code" },
{ "name": "Type", "value": "Cheatsheet" }
]
}
Chapter¶
{
"book_id": 1,
"name": "My fantastic new chapter",
"description": "This is a great new chapter that I've created via the API",
"tags": [
{ "name": "Category", "value": "Top Content" },
{ "name": "Rating", "value": "Highest" }
]
}
Page¶
{
"book_id": 1,
"name": "My API Page",
"markdown": "<p>my new API page</p>",
"tags": [
{ "name": "Category", "value": "Not Bad Content" },
{ "name": "Rating", "value": "Average" }
]
}
In [12]:
import frontmatter # https://pypi.org/project/python-frontmatter/
import markdown
def parse_markdown(filepath):
# markdown_parser = markdown.Markdown(extensions=markdown_extensions)
file_parts = frontmatter.load(filepath)
return {
# 'html': markdown_parser.convert(file_parts.content),
"metadata": file_parts.metadata
}
parse_markdown("../temp/python-cheatsheets/cheatsheet/debugging.md")
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb Cell 19 in <cell line: 13>() <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=5'>6</a> file_parts = frontmatter.load(filepath) <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=7'>8</a> return { <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=8'>9</a> # 'html': markdown_parser.convert(file_parts.content), <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=9'>10</a> 'metadata': file_parts.metadata <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=10'>11</a> } ---> <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=12'>13</a> parse_markdown('../temp/python-cheatsheets/cheatsheet/debugging.md') /home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb Cell 19 in parse_markdown(filepath) <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=3'>4</a> def parse_markdown(filepath): <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=4'>5</a> # markdown_parser = markdown.Markdown(extensions=markdown_extensions) ----> <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=5'>6</a> file_parts = frontmatter.load(filepath) <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=7'>8</a> return { <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=8'>9</a> # 'html': markdown_parser.convert(file_parts.content), <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=9'>10</a> 'metadata': file_parts.metadata <a href='vscode-notebook-cell://ssh-remote%2Bwebserver/home/donaldrich/projects/secrets/jupyter-notebooks/documentation/python-cheatsheet.ipynb#X23sdnNjb2RlLXJlbW90ZQ%3D%3D?line=10'>11</a> } AttributeError: module 'frontmatter' has no attribute 'load'