Exam 1 Review Flashcards
Using terraform apply -replace is how you
tag a resource for replacement.
True or False? A provider block is required in every configuration file so Terraform can download the proper plugin.
You don’t have to specify a provider block since Terraform is smart enough to download the right provider based on the specified resources.
Can the child modules refer to any of the variables declared in the parent module?
Child modules can only access variables that are passed in the calling module block
If an engineer makes a change outside of Terraform, what command can you run to detect drift and update the state file?
terraform apply -refresh-only
Note that terraform refresh used to be the correct command here, but that command is deprecated. It might show up on the exam though.
Which of the features below is not available in the free version of Terraform Cloud?
Private Module Registry
State Management
Remote Operations
Single Sign-On
Single Sign-On is a feature of Terraform Enterprise and Terraform Cloud for Business. It is NOT available in Terraform Cloud (free tier)
A child module created a new subnet for some new workloads. What Terraform block type would allow you to pass the subnet ID back to the parent module?
You need to use an output block to be able to export any data back to the parent/calling module
A user manually logged into the AWS console and updated a resource managed by Terraform, but you also updated that same resource using the code. What will happen when you run Terraform apply since the change was already made?
A terraform apply will run its own state refresh and TF will see the configuration matches the deployed infrastructure. Nothing will happen as a result.
What is a Private Module Registry and what are its features? (2)
- You can store and distribute Terraform modules within an organization, making it easier to share code and ensure consistency across multiple projects.
- Some of its features include versioning, access controls, and integration with existing CI/CD pipelines.
When you run a terraform init, where does Terraform OSS download and store the modules locally?
When plugins and modules are downloaded, they are stored under their respective directory in the .terraform/modules folder within the current working directory.
What is the syntax to refer to a resource?
To refer to a resource, you’d use <block type>.<resource type>.<name>
What is the syntax to set the value of an input variable using environment variables?
You need to use TF_VAR_
to set an environment variable for use with Terraformexport TF_VAR_<variable name>=<desired_input>
export TF_VAR_user=dbadmin101
Workspaces in OSS are often used within the ____ _______ _________ while workspaces in Enterprise/Cloud are often (but not required) mapped to _____ ______
Workspaces in OSS are often used within the same working directory while workspaces in Enterprise/Cloud are often (but not required) mapped to specific repos.
True or False? When you are referencing a module, you must specify the version of the module in the calling module block.`
While it’s not required, it is highly recommended to specify the version for each module to avoid issues with newer versions of the module that could break your configuration
Explain how the local-exec provisioner works.
The local-exec provisioner executes a local command after creating a resource. It runs on the machine where Terraform is running, not on the resource itself.
Explain parallelism in Terraform.
Parallelism is the way Terraform can deploy many resources at the same time to speed up the deployment