<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ryan Fang on Medium]]></title>
        <description><![CDATA[Stories by Ryan Fang on Medium]]></description>
        <link>https://medium.com/@ryanfangk?source=rss-6f6a4a306e80------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_ngacUFTdwhqTvGYPamejQ.jpeg</url>
            <title>Stories by Ryan Fang on Medium</title>
            <link>https://medium.com/@ryanfangk?source=rss-6f6a4a306e80------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:07:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ryanfangk/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[60 Terraform questions and answers]]></title>
            <link>https://ryanfangk.medium.com/60-questions-to-help-you-pass-the-terraform-associate-exam-eec2848c5798?source=rss-6f6a4a306e80------2</link>
            <guid isPermaLink="false">https://medium.com/p/eec2848c5798</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Ryan Fang]]></dc:creator>
            <pubDate>Mon, 07 Jun 2021 00:49:43 GMT</pubDate>
            <atom:updated>2022-04-11T02:01:32.226Z</atom:updated>
            <content:encoded><![CDATA[<h4>Last Updated: Feb 17, 2022</h4><h3><strong>Disclaimer:</strong></h3><p>These questions are completely brainstormed on my own and are not from the terraform associate exam. These questions may or may not be relevant to topics tested on the terraform associate exam, and they may or may not be 100% up to date. They are aimed to be an additional data point for you to test your knowledge with terraform rather than to test your exam readiness. The questions will be listed first, and the answers will be listed at the end of the page.</p><p>For a comprehensive and official list of exam topics, please visit:</p><p><a href="https://learn.hashicorp.com/tutorials/terraform/associate-study?in=terraform/certification">Study Guide - Terraform Associate Certification | Terraform - HashiCorp Learn</a></p><p>Question 1. Which of the complex types below are collection types in Terraform? (2 correct answers)</p><pre>a) lists<br>b) numbers<br>c) tuple<br>d) maps<br>e) objects</pre><p>Question 2. Which commands below runs terraform refresh as a part of their functions? (3 correct answers)</p><pre>a) terraform plan<br>b) terraform import<br>c) terraform login<br>d) terraform destroy<br>e) terraform apply</pre><p>Question 3. What is state locking?</p><pre>a) State locking prevents write operations on your state file<br>b) State locking prevents read operations on your state file<br>c) State locking locks in your terraform resources so they cannot be deleted from the managed environment<br>d) State locking prevents terraform from unauthorized access to your state</pre><p>Question 4. Fill in the blank, what is the difference between a provisioner and a provider?</p><p>A _______ is a plugin that adds a set of resource types and data sources that terraform can manage, while a _______ is used to model specific actions on a _______ machine in order to prepare servers or other infrastructure for service</p><pre>a) provisioner, provider, local<br>b) provider, provisioner, local or remote<br>c) provisioner, provider, local or remote<br>d) provider, provisioner, local <br>e) provisioner, provider, remote</pre><p>Question 5. Can you specify a provider for a module to use?</p><pre>a) Yes<br>b) No</pre><p>Question 6. What are locals block?</p><pre>a) locals block is a block which adds additional functionalities to a terraform module<br>b) locals block assigns expressions to variables that can be used repeatedly across a module<br>c) locals block provision resources that are to be used on the local machine<br>d) locals block stores a list of resources that are provisioned by the current module</pre><p>Question 7. Where can locals be referred from?</p><pre>a) It&#39;s global to all modules in terraform<br>b) From within the specific file which they are written in<br>c) From within the specific workspace they&#39;re in<br>d) From within the directory which they exist<br>e) From within the module in which they exist</pre><p>Question 8. Which files make up a module composition? (2 correct answers)</p><pre>a) main.tf <br>b) terraform.tfstate<br>c) terraform.d<br>d) modules<br>e) variables.tf</pre><p>Question 9. What is the function to translate a given value to a string into json or yaml?</p><pre>a) jsonify or yamlify<br>b) convjson or convyaml<br>c) jsonencode or yamlencode<br>d) tojson or toyaml</pre><p>Question 10. What is the symbol for whitespace stripping?</p><pre>a) ~<br>b) @<br>c) #<br>d) $<br>e) %</pre><p>Question 11. What does terraform refresh do?</p><pre>a) The terraform refresh command updates terraform to the latest version<br>b) The terraform refresh command updates terraform modules to the latest version<br>c) The terraform refresh command updates terraform modules to the latest version<br>d) The terraform refresh command reads the current settings in the terraform.rc file and refreshes your terraform behaviour<br>e) The terraform refresh command reads the current settings from all managed remote objects and updates the terraform state to match.</pre><p>Question 12. What are 3 benefits of having a remote backend? (3 correct answers)</p><pre>a) Version Control<br>b) Better Security<br>c) Faster loading speed<br>d) Easier to access<br>e) Multiple read operations</pre><p>Question 13. What is terraform private module registry?</p><pre>a) Terraform Cloud’s private module registry acts as a repository which only you can access that offers provider versioning, module versioning and remote state file storage. It allows you to store your current terraform configuration to feel as if you are working on a local machine. <br>b) Terraform Cloud’s private module registry acts as a repository which you can store modules across your organization. It offers module versioning that includes both the root module as well as the child module so you may download the entire package at once to bootstrap your terraform workspace.<br>c) Terraform Cloud’s private module registry helps you share Terraform modules across your organization. It includes support for module versioning, a searchable and filterable list of available modules, and a configuration designer to help you build new workspaces faster.</pre><p>Question 14. What is an orphaned resource in terraform?</p><pre>a) An orphaned resource is a resource that was created by the user but is not associated with any state<br>b) An orphaned resource is a resource that had its configuration file deleted<br>c) An orphaned resource is a resource that was provisioned by the user but not from the root module<br>d) An orphaned resource is a resource that was provisioned by terraform but is not associated with any state</pre><p>Question 15. What is a terraform run?</p><pre>a) Terraform runs are managed remote operations in terraform cloud<br>b) Terraform run is an other version of terraform apply<br>c) Terraform run is a terraform cloud specific command that runs your local configuration<br>d) Terraform run runs additional plugins you specify and adds additional functionality to your terraform<br>e) Terraform run causes your terraform to run away from your system</pre><p>Question 16. What is Hashicorp sentinel?</p><pre>a) Sentinel is a policy-as-code framework thats built into terraform<br>b) Sentinel is the name given to a specific terraform module<br>c) Sentinel is an embedded policy-as-code framework integrated with the HashiCorp Enterprise products.<br>d) Sentinel allows secure storage of your terraform secrets</pre><p>Question 17. How is terraform workspace different in local and in terraform cloud?</p><pre>a) Workspace in local allows different state files with the same configuration whereas workspace in terraform cloud hosts different configurations<br>b) They are the same<br>c) Workspace in local hosts different configuration files whereas workspace in terraform cloud hosts different state files<br>d) Workspace in local are a representation of workspaces in terraform cloud</pre><p>Question 18. How do you disable a remote operation in terraform ?</p><pre>a) Remote operations cannot be disabled<br>b) Remote operations can be disabled by going into the terraform cloud command line and type in terraform remote disable<br>c) Remote operations can be disabled by logging into terraform cloud via terraform login and type in terraform remote disable<br>d) Remote operations can be disabled for any workspace by changing its “Execution Mode” setting to “Local”</pre><p>Question 19. What is the command for upgrading terraform providers?</p><pre>a) terraform apply -upgrade<br>b) terraform plan -upgrade<br>c) terraform init -upgrade<br>d) terraform refresh -upgrade<br>e) terraform upgrade</pre><p>Question 20. Which of the following is terraform v0.12 provider syntax?</p><pre>a) terraform {<br>  required_providers {<br>    mycloud <strong>=</strong> {<br>      source  <strong>=</strong> &quot;hashicorp/aws&quot;<br>      version <strong>=</strong> &quot;&gt;= 1.0&quot;<br>    }<br>  }<br>}</pre><pre>b) terraform {<br>  required_providers {<br>    aws <strong>=</strong> &quot;~&gt; 1.0&quot;<br>  }<br>}</pre><pre>c) terraform {<br>  required_providers &quot;aws&quot; {<br>      source  <strong>=</strong> &quot;hashicorp/aws&quot;<br>      version <strong>=</strong> &quot;&gt;= 1.0&quot;<br>    }<br>  }<br>}</pre><pre>d) terraform {<br>  required_providers &quot;aws&quot; {<br>      source  <strong>=</strong> &quot;hashicorp/aws ~&gt; 1.0&quot;<br>    }<br>  }<br>}</pre><p>Question 21. What is the underlying language terraform is written in?</p><pre>a) Python<br>b) Java<br>c) Javascript<br>d) Go<br>e) C++</pre><p>Question 22. What is terraform cloud’s pricing structure?</p><pre>a) Basic $5/user/month, Team $20/user/month, Business $50/user/month<br>b) Free, Team $20/user/month, Business $50/user/month<br>c) Basic $5/user/month, Team $20/user/month, Business Contact Sales<br>d) Free, Team $20/user/month, Business Contact Sales<br>e) Flat $20/user/month across platform</pre><p>Question 23. Do you need Go as pre-requisite for terraform installation?</p><pre>a) Yes<br>b) No<br>c) Maybe</pre><p>Question 24. What are the two connection types supported by a remote-exec provisioner? (2 correct answers)</p><pre>a) git<br>b) ssh<br>c) winrm<br>d) https<br>e) http</pre><p>Question 25. Do provisioners only work in resource blocks?</p><pre>a) Yes, they only work within resource blocks that specify a valid resource<br>b) No, they can work outside of resource blocks<br>c) Yes, they can work within resource blocks that do or do not specify a valid resource<br>d) No, they can work outside of resource blocks but only if referenced in a provider block elsewhere in the root module</pre><p>Question 26. What is the difference between the provider block and the required_providers block? (2 correct answers)</p><pre>a) Required providers block specify providers that must be installed, provider block specify providers that are only installed when they are called upon in a module<br>b) They are the same<br>c) Required providers block must be nested inside a terraform block<br>d) provider block are &quot;instances&quot; of the required provider block and can specify different configurations of the required provider block<br>e) Provider blocks are nested in terraform block and are the &quot;instances&quot; of the required provider block</pre><p>Question 27. What is the difference between terraform apply -replace and terraform taint?</p><pre>a) They are the same<br>b) terraform apply -replace replaces the underlying resource with a new resource of the same configuration where as terraform taint taints the resource to be replaced on the next apply<br>c) terraform apply -replace is not a valid command<br>d) terraform apply -replace replaces the entire configuration with newly provided resources<br>e) terraform taint makes the underlying resource un-interactable</pre><p>Question 28. What does TF_IN_AUTOMATION environment variable do?</p><pre>a) If set to true, it causes Terraform to automate your terraform plan, and apply sequence as soon as you terraform init<br>b) If set to any non-empty value, Terraform adjusts its output to avoid suggesting specific commands to run next<br>c) If set to false, Terraform disables its output<br>d) If set to any non-empty value, Terraform adjusts its automated CLI commands such as plan or apply to run in stages</pre><p>Question 29. Which takes precedence? Terraform.auto.tfvars or terraform.tfvars?</p><pre>a) Terraform.auto.tfvars &gt; Terraform.tfvars<br>b) Terraform.tfvars &lt; Terraform.auto.tfvars<br>c) They take the same precedence</pre><p>Question 30. Can multiple local values be present in a terraform configuration?</p><pre>a) True<br>b) False</pre><p>Question 31. What is the difference between dynamic block and a locals block? (2 correct answers)</p><pre>a) Locals block allows us to construct nested blocks within another block, whereas dynamic block allows us to provide values to existing blocks which will be used over and over again<br>b) Dynamic block exists only within top-level block constructs whereas locals block can exist on its own<br>c) Dynamic block allows us to construct nested blocks within another block, whereas locals block allows us to provide values to existing blocks which will be used over and over again<br>d) You can have multiple locals block in a configuration but not multiple dynamic blocks<br>e) You can have multiple dynamic blocks in a configuration but not multiple locals blocks</pre><p>Question 32. Does a module require a provider?</p><pre>a) True<br>b) False</pre><p>Question 33. Which of the below is a valid string in terraform?</p><pre>a) &quot;hello&quot;<br>b) &#39;hello&#39;<br>c) hello</pre><p>Question 34. What are are structural types in terraform? What are collection types?</p><pre>a) They are the same<br>b) Collection types must have the same typed values whereas structural types can have different typed values<br>c) Structural types must have the same typed values whereas collection types can have different typed values</pre><p>Question 35. Can locals block refer to other locals blocks?</p><pre>a) Yes<br>b) No<br>c) Only under certain circumstances</pre><p>Question 36. If you want to display a list of every managed resources, which command do you use? terraform state list, terraform show, or terraform state show?</p><pre>a) terraform state list<br>b) terraform show<br>c) terraform state show<br>d) terraform state show or terraform state list<br>e) terraform show or terraform state list</pre><p>Question 37. Does terraform force every state modification command to write a backup file?</p><pre>a) Yes<br>b) No</pre><p>Question 38. What command does terraform use to print information about the provider used in the current configuration?</p><pre>a) Terraform providers<br>b) Terraform providers show<br>c) Terraform providers list<br>d) Terraform providers<br>e) Terraform version</pre><p>Question 39. What does terraform state mv command do?</p><pre>a) It moves a single resource into a terraform state file<br>b) It detects all the unmanaged resources in the cloud and move them into the terraform state file<br>c) It moves the state file from one workspace to another<br>d) It moves the state file from the current workspace to terraform cloud</pre><p>Question 40. What happens when you use terraform apply after you change the resource label of an existing resource?</p><pre>a) The underlying resource is destroyed and recreated on the next apply<br>b) The underlying resource is updated on the next apply<br>c) The existing resource is preserved, terraform creates a new resource with the new name<br>d) The existing resource is preserved, only the state file is updated to reflect this change<br>e) The existing resource is preserved, the state file does not change since the change is only for configuration</pre><p>Question 41. What happens when you use terraform apply after you change the resource configuration of an existing resource?</p><pre>a) The underlying resource is destroyed and recreated on the next apply<br>b) The underlying resource is updated on the next apply<br>c) The existing resource is preserved, terraform creates a new resource with the new name<br>d) The existing resource is preserved, only the state file is updated to reflect this change<br>e) The existing resource is preserved, the state file does not change since the change is only for configuration</pre><p>Question 42. What happens when you use terraform apply after you change the value of an existing resource?</p><pre>a) The underlying resource is destroyed and recreated on the next apply<br>b) The underlying resource is updated on the next apply<br>c) The existing resource is preserved, terraform creates a new resource with the new name<br>d) The existing resource is preserved, only the state file is updated to reflect this change<br>e) The existing resource is preserved, the state file does not change since the change is only for configuration</pre><p>Question 43. How do you rename resources? (2 correct answers)</p><pre>a) You change the resource label<br>b) You change the variable &quot;name&quot; in the resource configuration<br>c) You use terraform state mv to move the resource with the new name from one state to another<br>d) You manually change the resource name in the console and use terraform apply -refresh to reflect this change<br>e) You delete the existing state and recreate it </pre><p>Question 44. Can another process unlock local state files?</p><pre>a) Yes<br>b) No</pre><p>Question 45. Where is the state file stored when it is created in another workspace on a local machine?</p><pre>a) It is stored as as another state file in the same directory, you can get to it by using terraform workspace select<br>b) It is stored in the terraform.tfstate.d folder<br>c) It is stored in the .terraform/terraform.tfstate.d folder<br>d) It is stored in the .terraform/ folder<br>e) It is stored in the terraform.d folder</pre><p>Question 46. Implicit Dependency in terraform is when terraform _____ in a terraform configuration. Explicit dependency is when when terraform _____ in a terraform configuration.</p><pre>a) automatically recognize a dependency, uses depends_on to specify a dependency <br>b) uses depends_on to specify a dependency, automatically recognize a dependency<br>c) uses for_each to specify a list of resources, uses depends_on to specify a dependency<br>d) uses depends_on to specify a dependency, uses for_each to specify a list of resources</pre><p>Question 47. What is the command for supplying a plan file to terraform apply?</p><pre>a) -target=&lt;plan-file&gt;<br>b) -var=&lt;plan-file&gt;<br>c) -plan=&lt;plan-file&gt;<br>d) -input=&lt;plan-file&gt;<br>e) -file=&lt;plan-file&gt;</pre><p>Question 48. What is the difference between locals and input variable?</p><pre>a) Input variables can be used across modules whereas locals block only apply to the current module<br>b) They have the same function, they both supply values to terraform modules.<br>c) Input variables serve as parameters for a Terraform module. Local values assign a name to an expression.<br>d) local value serve as parameters for a Terraform module. Input variables assigns a name to an expression.<br>e) local values are a subset of input variables which only apply to the current module</pre><p>Question 49. Can input variable and providers be inherited to child modules?</p><pre>a) Yes<br>b) No<br>c) Input variables can be inherited but only in a specific way, providers cannot<br>d) Providers can be inherited but only in a specific way, input variables cannot</pre><p>Question 50. If you have a large terraform configuration file with over 100+ resource configurations, applying them to the cloud takes over 3 hours to complete. What can you do to speed up the process?</p><pre>a) Break the configuration up into smaller modules to speed up the process<br>b) Disable refresh when you use terraform <br>c) Use multiple service accounts to deploy resources concurrently<br>d) Since most resource provisioning make API calls prior to provisioning, contact the cloud vendor to increase your limit to help speed up the process</pre><p>Question 51. What happens if you have both the credential_helper and credential block in a terraform config file?</p><pre>a) The credential helper block and credential block merge their credentials together and attempt logins twice<br>b) The credential block overrides the credential helper block<br>c) The credential helper block overrides the credential block<br>d) Whichever comes last wins<br>e) Whichever comes first wins</pre><p>Question 52. Which of the following are valid remote backends for terraform? (2 correct answers)</p><pre>a) github<br>b) bitbucket<br>c) GCS<br>d) S3<br>e) Terraform registry</pre><p>Question 53. What types of provisioners exist in terraform? (3 correct answers)</p><pre>a) file<br>b) system <br>c) local-exec <br>d) remote-exec<br>e) ssh</pre><p>Question 54. Will terraform update stored cache on its own?</p><pre>a) yes<br>b) no</pre><p>Question 55. Which of the following is a valid module source? (2 correct answers)</p><pre>a) source <strong>=</strong> &quot;app.terraform.com/example-corp/k8s-cluster/azurerm&quot;<br>b) source <strong>=</strong> &quot;git::ssh://username@example.com/storage.git&quot;<br>c) source <strong>=</strong> &quot;git::https://example.com/vpc.git#ref=v1.2.0&quot;<br>d) source <strong>=</strong> &quot;./consul&quot;</pre><p>Question 56. Which of the following are valid references to named resources in terraform? (2 correct answers)</p><pre>a) resource.aws_instance.instance_one<br>b) aws_instance.instance_one<br>c) aws_instance.instance_one.[*]<br>d) aws_instance.example[&quot;a&quot;].id<br>e) aws_instance.count.[1].id</pre><p>Question 57. If an output is marked as sensitive, where will you ever see its value?</p><pre>a) When you supply the -sensitive=false flag to terraform apply<br>b) In the state file<br>c) In another module&#39;s output when you reference the sensitive output<br>d) Nowhere except the configuration where it&#39;s written<br>e) In the metadata of the deployed resource</pre><p>Question 58. Which of the following are valid lists in terraform? (2 correct answers)</p><pre>a) [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]<br>b) [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;]<br>c) [true, 12, &quot;c&quot;]<br>d) [&quot;a&quot;,{},&quot;c&quot;]</pre><p>Question 59. Which file does terraform create when you use terraform login?</p><pre>a) credentials.json<br>b) terraform.d<br>c) terraform.rc<br>d) credentials.tfrc.json</pre><p>Question 60. If you want to enable logging in terraform with the most verbose option, what do you do?</p><pre>a) set TF_LOG=Trace<br>b) set TF_LOG=DEBUG<br>c) set TF_TRACE=LOG<br>d) set TF_LOG=true<br>e) set TF_TRACE=true</pre><p><strong>Bonus Question:</strong></p><p>Question 61. How confident do you feel about the terraform associate exam after doing this mock test?</p><pre>a) I&#39;m ready to take on the actual exam<br>b) I still have some studying to do, maybe a couple more days could help<br>c) I&#39;m boned man.... time to get back to studying<br>d) Terraform associate exam? What&#39;s that?<br>e) Let&#39;s go! My exam is within the hour, this is nothing to me<br>f) I&#39;m just doing this for fun, I already passed my exam</pre><h3>Coffee Break :)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tj2lAPwru6IwuAeIi4o1Jw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@clemono?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Clem Onojeghuo</a> on <a href="https://unsplash.com/s/photos/relax?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Answers:</h3><pre>1. a,d<br>2. a,d,e<br>3. a<br>4. b<br>5. b<br>6. b<br>7. d<br>8. a,e<br>9. c<br>10. a<br>11. e<br>12. a,b,e<br>13. c<br>14. b<br>15. a<br>16. c<br>17. a<br>18. d<br>19. c<br>20. b<br>21. d<br>22. d<br>23. b<br>24. b,c<br>25. c<br>26. c,d <br>27. b <br>28. b<br>29. a<br>30. a<br>31. b,c <br>32. b<br>33. a<br>34. b<br>35. a<br>36. d<br>37. a<br>38. a<br>39. a<br>40. a<br>41. b<br>42. b<br>43. b,c <br>44. b<br>45. b<br>46. a<br>47. c<br>48. c<br>49. d<br>50. b<br>51. b<br>52. c,d<br>53. a,c,d<br>54. b<br>55. a,c<br>56. b,d<br>57. b<br>58. a,c<br>59. a,d <br>60. a</pre><p>Good luck on your terraform associate exam :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eec2848c5798" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My experience with HashiCorp Certified: Terraform Associate 2021]]></title>
            <link>https://ryanfangk.medium.com/my-experience-with-hashicorp-certified-terraform-associate-2021-a235b9b67a47?source=rss-6f6a4a306e80------2</link>
            <guid isPermaLink="false">https://medium.com/p/a235b9b67a47</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Ryan Fang]]></dc:creator>
            <pubDate>Sun, 30 May 2021 20:50:14 GMT</pubDate>
            <atom:updated>2021-05-30T20:50:14.240Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>As a DevOps professional, we deal with various cloud providers on a daily basis, and is often responsible for setting up landing zones or provisioning cloud infrastructure on behalf of our clients. One of the most used IaC (Infrastructure as Code) tools at the moment is Terraform by Hashicorp. It’s open source, cloud agnostic, and has a growing community behind them. Here is my experience on passing the Terraform Associate exam if you plan on taking it in 2021.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*5Qpz9tisouykjV062QtEbg.png" /></figure><h3>Preparation Time Frame</h3><p>Luckily terraform isn’t as complex of a tool as Kubernetes. Their documentation is fairly short and easy to digest. If you have experience working with terraform CLI in any capacity or even if you are starting from scratch, it shouldn’t take you any longer than 1 month to understand the tool and pass your exam. Here is my estimation of the time it may take for someone to complete this certification. Your results may vary depending on how much time you dedicate towards this endeavor and how efficiently you study.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*kUmy1KTO42WbB7QE0Z6Zwg.jpeg" /><figcaption>My estimation of the time required for acquiring Terraform Associate certification</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivcANW3FbSz5Ss0PL2g8pw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@surface?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Surface</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>My Learning Stack</h3><p>There are plenty of learning resources out there for the Certified Terraform Associate Exam. I’m going to share with you the resources I have personally used. As with any exams, the most important aspect about preparing for the exam is to get your hands-on practice as soon as possible.</p><p><a href="https://learn.acloud.guru/course/hashicorp-certified-terraform-associate-1/"><strong>HashiCorp Certified Terraform Associate Course on ACloudGuru</strong></a><strong> </strong><br>This was the course I took as a precursor to the exam, though I do not think it went as in depth and as comprehensive as other ACloudGuru courses on other topics, it was a good introduction to terraform.</p><p><a href="https://www.testpreptraining.com/hashicorp-certified-terraform-associate-free-practice-test"><strong>Testpreptraining.com</strong></a><strong> <em>(</em></strong><em>Highly Recommend)</em><br>It is always a good idea to test your knowledge before an exam with a set of practice questions, these are the ones I’ve used and I highly recommend the paid version.</p><p><a href="https://learn.hashicorp.com/tutorials/terraform/associate-review"><strong>Exam Review by Hashicorp</strong></a><strong> </strong><em>(Highly Recommend)</em><strong><br></strong>Official material is always better than unofficial material in many situations as they will provide you exactly what you need to know. You can either use this as the main structure to your study or supplement your study with it.</p><p><a href="https://learn.hashicorp.com/tutorials/terraform/associate-review"><strong>Exam Review by Hashicorp</strong></a><strong> </strong><em>(Highly Recommend)</em><strong><br></strong>Another learning material by Hashicorp.</p><p>Other learning materials do exist out there such as PluralSight, Udemy etc. I have not dabbled in those so I cannot provide you with my opinion, but I have heard other succeed with them so feel free to check them out.</p><h3>Example Questions</h3><p>I do plan to write a comprehensive list of questions on Terraform Associate which I came up on my own. <strong>Follow me</strong> if you would like to see them in the near future.</p><ol><li><strong>What does terraform refresh do to terraform state?</strong></li></ol><pre>Refreshing a terraform state updates the attributes of managed resources in the cloud with your current state file<br><a href="https://www.terraform.io/docs/cli/commands/refresh.html">https://www.terraform.io/docs/cli/commands/refresh.html</a></pre><p><strong>2. What is the difference between a provisioner and a provider?</strong></p><pre>A provider is a plugin that adds a set of resource types and data sources that terraform can manage, while a provisioner is used to model specific actions on a local or remote machine in order to prepare servers or other infrastructure for service<br><a href="https://www.terraform.io/docs/language/resources/provisioners/syntax.html">https://www.terraform.io/docs/language/resources/provisioners/syntax.html</a><br><a href="https://www.terraform.io/docs/providers/index.html">https://www.terraform.io/docs/providers/index.html</a></pre><p><strong>3. What is the difference between terraform state list and terraform show and terraform state show?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*ZS_-nW_Fb-2QHo15251Fdw.jpeg" /></figure><p><strong>4. Where is the state file stored when it is created in another workspace in the CLI?</strong></p><pre>It is stored under $WORKING_DIRECTORY/terraform.tfstate.d/WORKSPACE_NAME/terraform.tfstate<br><a href="https://www.terraform.io/docs/language/state/workspaces.html">https://www.terraform.io/docs/language/state/workspaces.html</a></pre><p><strong>5. What is the difference between locals and input variable?</strong></p><pre>Input variables serve as parameters for a Terraform module. A local value assigns a name to an expression, so you can use it multiple times within a module without repeating it.</pre><h3>Conclusion</h3><p>Hashicorp Terraform Associate exam is an exam that tests your theoretical knowledge working with terraform. If you have some hands on experience using terraform that will definitely help you pass the exam but it is not necessary. The tool itself has a large community behind it and each cloud provider has its own modules which is a whole different set of documentations which truly unlocks the power of IaC. All in all, terraform associate is not the hardest exam out there and can be completed in a short amount of time to add some sense of accomplishment / credential to your profile. Execution is everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MFaulB3GsdSUSi-1IS9tTw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@littleforestowl?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Katrina Wright</a> on <a href="https://unsplash.com/s/photos/good-luck?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a235b9b67a47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I passed the 2021 CKAD in 7 days]]></title>
            <link>https://ryanfangk.medium.com/how-i-passed-the-2021-ckad-in-7-days-2a19b02e7a90?source=rss-6f6a4a306e80------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a19b02e7a90</guid>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[ckad]]></category>
            <category><![CDATA[linux-foundation]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Ryan Fang]]></dc:creator>
            <pubDate>Wed, 28 Apr 2021 17:08:16 GMT</pubDate>
            <atom:updated>2021-04-29T03:37:28.948Z</atom:updated>
            <content:encoded><![CDATA[<p>The CKAD is a certification designed to test a candidate’s ability to manage objects within a kubernetes cluster. It is part of the suite of Kubernetes certifications offered by the Linux Foundation, which are CKAD, CKA, and CKS. Unlike the CKA, the CKAD is not a prerequisite for taking the CKS, which many consider to be the pinnacle of the Kubernetes certifications.</p><p>If you are more interested in taking the CKA after the CKAD, be sure to checkout <em>my guide</em> on passing the CKA <a href="https://ryanfangk.medium.com/my-experience-with-the-cka-2021-4fc7ddc4eb29">here</a>.</p><p>With that being said, let’s jump into what you need to know for passing the CKAD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mj48D7OQMYewYdw-Y4MhRQ.jpeg" /><figcaption>Image by <a href="https://unsplash.com/@maxweisbecker">Maximilian Weisbecker</a></figcaption></figure><h3>Topics on the CKAD</h3><p>Unlike the CKA, the CKAD does not deal with kubernetes cluster administrative tasks such as kubeadm, etcd, or kubelet. It is purely on how to create and manipulate kubernetes objects. Because of that, make sure you are familiar with concepts such as:</p><ol><li>Pod Spec</li><li>Workloads (CronJob, Deployment, Daemonsets)</li><li>Secrets and ConfigMaps</li><li>Network Policies</li><li>PersistentVolumes, PersistentVolumeClaims, StorageClasses</li><li>Roles/Rolebinding, Clusterrole and Clusterrolebindings</li><li>Services and Ingresses</li></ol><p>Since you will be working on your own browser, I would highly suggest that you keep a list of bookmarks for the exam which contains a list of documentations you can refer to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*8dxq3tbtds7maspNcVeHow.png" /><figcaption>Bookmarks I used for CKA/CKAD</figcaption></figure><h3>Preparation Material</h3><p>Prior to completing the CKAD, I spent a good amount of time preparing for the CKA thinking it would be a harder exam. However, I actually found the CKAD exam to be more difficult than the CKA exam. I’m not going to bore you with a list of resources, instead I’ll share with you the 2 core resources I’ve used to prepare for this exam:</p><p><a href="https://killer.sh/"><strong>killer.sh</strong></a><strong>: </strong>A CKA/CKAD/CKS exam simulator that offers the closest experience to the real exam. (You can use <strong><em>walidshaari</em></strong> for a 20% discount, last tried April 14th 2021)</p><p><a href="https://github.com/dgkanatsios/CKAD-exercises"><strong>CKAD Practices</strong></a><strong>:</strong> A github repo that contains a set of scenarios for various kubernetes objects creation and manipulations.</p><p>If you are interested in the resources I’ve used for the CKA exam, which are the same resources I’ve used for the CKAD exam, you can find them <a href="https://ryanfangk.medium.com/my-experience-with-the-cka-2021-4fc7ddc4eb29">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zbzEZvQZqpkptJlppLn5Tg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@gaspo3?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">gaspar manuel zaldo</a> on <a href="https://unsplash.com/s/photos/military-backpack?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Example Questions</h3><ol><li>How do you import a configMap object into your Kubernetes pod as an environment variable?</li></ol><pre>env:<br>  - name: SPECIAL_LEVEL_KEY #Name of the Environment Variable<br>    valueFrom:<br>      configMapKeyRef: #Name of the ConfigMap Object<br>        name: special-config<br>        key: special.how</pre><pre><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/">https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap</a>/</pre><p>2. What is the syntax for creating a CronJob that executes once every minute? What about once every hour?</p><pre>spec:<br>  schedule: &quot;*/1 * * * *&quot; #Every minute</pre><pre>spec:<br>  schedule: &quot;0 * * * *&quot; #Every hour at the beginning of the hour</pre><pre><a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/">https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/</a></pre><p>3. How does a Network Policy select which pods its rules apply to? Can the pods be in a different namespace?</p><pre>podSelector:<br>    matchLabels:<br>      role: db #The label on the pod</pre><pre>The Networkpolicy is a namespaced object (kubectl api-resources --namespaced), therefore pods must exist in the same namespace as the network policy<br> <br><a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/">https://kubernetes.io/docs/concepts/services-networking/network-policies/</a><br></pre><h3>Closing thoughts</h3><p>The CKAD in my opinion is a harder exam to pass than the CKA exam but the CKA exam covers more in scope than the CKAD. If your end goal is to pass the CKA I would suggest that you go through the CKA exam first before the CKAD as your CKA training would prepare you for both exams.</p><p>As always, best of luck on your certification journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a19b02e7a90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My experience with the CKA 2021]]></title>
            <link>https://ryanfangk.medium.com/my-experience-with-the-cka-2021-4fc7ddc4eb29?source=rss-6f6a4a306e80------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fc7ddc4eb29</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ckad]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cka]]></category>
            <category><![CDATA[linux-foundation]]></category>
            <dc:creator><![CDATA[Ryan Fang]]></dc:creator>
            <pubDate>Thu, 22 Apr 2021 22:00:01 GMT</pubDate>
            <atom:updated>2021-04-23T15:41:24.870Z</atom:updated>
            <content:encoded><![CDATA[<p>If you didn’t know, Kubernetes or k8s is a container orchestration platform that manages container workloads across a set of VMs. Moving forward, containerized applications are becoming more relevant due to the fact that they consume less system resources and are easier to manage and deploy. The Certified Kubernetes Administrator (CKA) is designed to test your competency working with k8s by completing a series of hands-on questions based on real life scenarios. Here is how I passed the Certified Kubernetes Exam with a score of <a href="https://www.credly.com/badges/adb27c2e-0f81-49ba-a2e4-c152dbdeeeca/linked_in"><strong>88%</strong></a> on my first attempt<strong>.</strong></p><blockquote>The easiest way to pass the CKA, is to be a Certified Kubernetes Administrator.</blockquote><p><a href="https://training.linuxfoundation.org/certification/certified-kubernetes-administrator-cka/">Certified Kubernetes Administrator (CKA) | Linux Foundation Education</a></p><h3>Preparation Time Frame</h3><p>Before we go into the study material, I just want to give you a sense of the time it may take an individual to prepare and pass the exam on their first try (Based on my estimation and experience).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*G9IyJHmnO-0fDMJ0-Vc83w.jpeg" /><figcaption>My estimation of the time required for acquiring the CKA certification</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zqk9SXBRdwmuaxd_phazag.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@boxedwater?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Boxed Water Is Better</a> on <a href="https://unsplash.com/s/photos/nature?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3><strong>My Learning Stack</strong></h3><p>There are plenty of learning resources out there for the Certified Kubernetes Administrator exam. I’m going to share with you the resources I have personally used. I think the most important aspect about preparing for the CKA is reading the documentations, and practicing kubectl on the command line with a kubernetes cluster. <strong>You should practice daily if you want faster results. </strong>Here is my learning stack:</p><h4><a href="https://acloudguru.com/course/certified-kubernetes-administrator-cka"><strong>Certified Kubernetes Administrator Course on LinuxAcademy</strong></a></h4><p>This was the course I took to pass the exam. It covers most of the concepts tested on the exam. I used this course as an introduction to Kubernetes and to supplement my readings and practices.</p><h4><a href="https://killer.sh/"><strong>killer.sh</strong></a></h4><p>Hands down the best CKA/CKAD/CKS exam simulator. It is definitely worth the money. I would not recommend going into the exam without going through it at least once.</p><h4><a href="https://github.com/dgkanatsios/CKAD-exercises">CKAD Practices</a></h4><p>Definitely go through this once, or twice. It is a set of scenarios to validate your knowledge using kubectl and writing yaml files for various kubernetes objects.</p><h4><a href="https://acloudguru.com/">VM playground on Linux Academy/ACG</a></h4><p>With a paid membership, you gain access to a set of VMs which you can use to host your own kubernetes cluster. This was the option I used for practicing kubectl and playing around different components in kubernetes.</p><p>I have also included additional resources at the bottom of the page in case you need exposure to more learning materials than the options I stated above.</p><h3><strong>Tips and Pointers</strong></h3><p>For the exam, there are many things I originally wanted to share with you but felt it would make the article too long, so instead I summarized the 4 most important tips and pointers for the exam which I believe anyone who is taking the exam should consider beforehand. If you want to speak to me personally about the CKA, feel free to reach out to me on <a href="https://www.linkedin.com/in/ryan-fangk/">Linkedin</a>.</p><ol><li><strong>Bookmark important documentations on your browser</strong></li></ol><p>Since you will be using your own browser, bookmarking Kubernetes documentation is a quick and easy way to save time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*8dxq3tbtds7maspNcVeHow.png" /></figure><p><strong>2. Learn tmux</strong></p><p>The exam terminal bugged out on me when I was about an hour in. It did not show anything I typed after that point nor did it displayed the output to my commands so I ended up panicking. Luckily I went through a very brief tutorial on using tmux, and I was able to bring up another terminal to finish the remaining questions.</p><p>Here is a <a href="https://www.youtube.com/watch?v=Yl7NFenTgIo">video tutorial</a> on tmux, as well as a <a href="https://gist.github.com/MohamedAlaa/2961058">summary</a>.</p><p><strong>3. Learn vim</strong></p><p>If you have read other medium articles this should go without saying that vim is the default editor of kubectl edit and should be your go to editor of choice. I was a big nano user before passing the CKA, but after learning vim I stopped using nano. Spend 20 minutes and go through vimtutor at least once.</p><pre>vimtutor</pre><p><strong>4. Set up your environment</strong></p><p>On the exam you will be given access to several VMs which at one point you will have to ssh into. You will also have access to a notepad which you can use to record anything you want (Even write a medium article like this). I would highly suggest that you set up your environment in a certain way that is most comfortable for you.</p><pre>echo &quot;alias k=&#39;kubectl&#39;&quot; &gt;&gt; $HOME/.bashrc<br>echo &quot;:set number paste tabstop=2 shiftwidth=1 expandtab&quot; &gt;&gt; $HOME/.vimrc<br>echo &quot;ETCDCTL_API=3&quot; &gt;&gt; $HOME/.profile<br>echo &quot;do=&#39;--dry-run=client -o yaml&#39;&quot; &gt;&gt; $HOME/.profile<br>source $HOME/.bashrc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2iv2YFxBSIBUth85D0Ozg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@karsten116?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Karsten Winegeart</a> on <a href="https://unsplash.com/s/photos/dog?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3><strong>Example Questions</strong></h3><p><strong>Q1. How do you back up and restore an etcd cluster?</strong></p><pre>sudo etcdctl snapshot save &lt;file&gt; --cacert=$CACERT --cert=$CERT --key=$KEY<br>sudo systemctl stop etcd<br>sudo etcdctl snapshot restore &lt;file&gt; --data-dir &lt;directory&gt; <br>sudo systemctl start etcd<br>sudo systemctl daemon-reload</pre><p><a href="https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/">Operating etcd clusters for Kubernetes</a></p><p><strong>Q2. How do you upgrade kubeadm, kubectl, and kubelet on a worker node?</strong></p><pre>kubeadm upgrade apply (control plane)<br>kubeadm upgrade node (worker node)</pre><pre>apt-get install -y --allow-change-held-packages kubeadm=1.20.1–00 kubectl=1.20.1–00 kubelet=1.20.1–00</pre><p><a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/">Upgrading kubeadm clusters</a></p><p><strong>Q3. How do you fix a broken worker node?</strong></p><p>Typically worker nodes are broken due to the kubelet service malfunctioning. A common cause is because the kubelet service was not enabled/started on the server.</p><pre>sudo systemctl status kubelet<br>sudo systemctl enable kubelet<br>sudo systemctl start kubelet<br>sudo systemctl daemon-reload</pre><p>Though sometimes this may not be the case, you can inspect kubelet logs using journalctl.</p><pre>sudo journalctl -u &lt;service-name&gt;<br>Press Shift+G to scroll to the bottom of the log where the most recent event occurred</pre><h3>Closing thoughts and other study materials</h3><p>The CKA is a fair and relatively straight forward exam. If English is not your first language (or even if it is), definitely read the questions twice because there have been times when I was confused by what the question is asking for. If you practice <strong>daily </strong>you should have no issue finishing the exam with time to spare.</p><blockquote><strong>Competence brings forth confidence</strong></blockquote><p>As promised, here are some additional study materials I have found from other sources which I have attached my own personal opinions to so you can best judge what you need to pass the exam.</p><h4><a href="https://github.com/kelseyhightower/kubernetes-the-hard-way">Kubernetes the hard way</a></h4><p>Though I did go through Kubernetes the hard way once, after the exam I realized that it wasn’t necessary to create a kubernetes cluster from scratch unlike other guides suggest. This is because on the exam there isn’t any in-depth questions asking you to install different components from scratch. However, I would still recommend reading it once to get a better understanding of what is going on behind the scenes.</p><h4><a href="https://www.udemy.com/course/certified-kubernetes-administrator-with-practice-tests/">Udemy CKA course</a> or <a href="https://kodekloud.com/p/certified-kubernetes-administrator-with-practice-tests">KodeCloud CKA Course</a></h4><p>I am pretty sure these two courses are the same (because I did not take them). There are plenty of other articles praising this Udemy course or this KodeCloud course.</p><h4><a href="https://www.katacoda.com/">Katakoda</a></h4><p>I have not used, but it was mentioned on some medium posts I’ve read come across.</p><h4><a href="https://console.cloud.google.com/home">Google Cloud VMs</a></h4><p>You get $300 dollars in credit to host a set of VMs and gain access to the Google Kubernetes Engine to practice your command lines. This is the free option I would’ve used if I did not have access to ACG/Linux Academy VMs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZtCj_6RW_7YhIsgV8ISV2g.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@edvinjohansson?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Edvin Johansson</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3><strong>Best of luck on your exam!</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fc7ddc4eb29" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>