Free preview mode
Enjoy the free questions and consider upgrading to gain full access!
Terraform Associate
Free trial
Verified
Question 51
You're writing a Terraform configuration that needs to read input from a local file called id_rsa.pub.
Which built-in Terraform function can you use to import the file's contents as a string?
- A: fileset("id_rsa.pub")
- B: filebase64("id_rsa.pub")
- C: templatefile("id_rsa.pub")
- D: file("id_rsa.pub")
Question 52
What does Terraform use providers for? (Choose three.)
- A: Provision resources for on-premises infrastructure services
- B: Simplify API interactions
- C: Provision resources for public cloud infrastructure services
- D: Enforce security and compliance policies
- E: Group a collection of Terraform configuration files that map to a single state file
Question 53
You can reference a resource created with for_each using a Splat (*) expression.
- A: True
- B: False
Question 54
How does Terraform determine dependencies between resources?
- A: Terraform automatically builds a resource graph based on resources, provisioners, special meta-parameters, and the state file, if present.
- B: Terraform requires all dependencies between resources to be specified using the depends_on parameter
- C: Terraform requires resources in a configuration to be listed in the order they will be created to determine dependencies
- D: Terraform requires resource dependencies to be defined as modules and sourced in order
Question 55
Which parameters does terraform import require? (Choose two.)
- A: Path
- B: Provider
- C: Resource ID
- D: Resource address
Question 56
Once a new Terraform backend is configured with a Terraform code block, which command(s) is (are) used to migrate the state file?
- A: terraform apply
- B: terraform push
- C: terraform destroy, then terraform apply
- D: terraform init
Question 57
What is not processed when running a terraform refresh?
- A: State file
- B: Configuration file
- C: Credentials
- D: Cloud provider
Question 58
What does this code do?
- A: Requires any version of the AWS provider >= 3.0 and < 4.0
- B: Requires any version of the AWS provider >= 3.0
- C: Requires any version of the AWS provider after the 3.0 major release, like 4.1
- D: Requires any version of the AWS provider > 3.0
Question 59
What does terraform refresh modify?
- A: Your cloud infrastructure
- B: Your state file
- C: Your Terraform plan
- D: Your Terraform configuration
Question 60
Which of the following is not valid source path for specifying a module?
- A: source = "./modulelversion=v1.0.0"
- B: source = "github.com/hashicorp/example?ref=v1.0.0"
- C: source = "./module"
- D: source = "hashicorp/consul/aws"
Question 61
Which of the following is true about terraform apply? (Choose two.)
- A: It only operates on infrastructure defined in the current working directory or workspace
- B: You must pass the output of a terraform plan command to it
- C: Depending on provider specification, Terraform may need to destroy and recreate your infrastructure resources
- D: By default, it does not refresh your state file to reflect current infrastructure configuration
- E: You cannot target specific resources for the operation
Question 62
Which of the following statements about local modules is incorrect?
- A: Local modules are not cached by terraform init command
- B: Local modules are sourced from a directory on disk
- C: Local modules support versions
- D: All of the above (all statements above are incorrect)
- E: None of the above (all statements above are correct)
Question 63
Which of the following is true about Terraform's implementation of infrastructure as code? (Choose two.)
- A: It is only compatible with AWS infrastructure management
- B: You cannot reuse infrastructure configuration
- C: You can version your infrastructure configuration
- D: It requires manual configuration of infrastructure resources
- E: It allows you to automate infrastructure provisioning
Question 64
You need to write some Terraform code that adds 42 firewall rules to a security group as shown in the example.
What can you use to avoid writing 42 different nested ingress config blocks by hand?
- A: A count loop
- B: A for block
- C: A for each block
- D: A dynamic block
Question 65
Which of the following is the safest way to inject sensitive values into a Terraform Cloud workspace?
- A: Write the value to a file and specify the file with the -var-file flag
- B: Set a value for the variable in the UI and check the "Sensitive" check box
- C: Edit the state file directly just before running terraform apply
- D: Set the variable value on the command line with the -var flag
Question 66
terraform apply will fail if you have not am terraform plan first to update the plan output.
- A: True
- B: False
Question 67
How would you reference the attribute "name" of this fictitious resource in HCL?
- A: resource.kubernetes_namespace.example.name
- B: kubernetes_namespace.test.name
- C: kubernetes_namespace.example.name
- D: data.kubernetes_namespace.name
- E: None of the above
Question 68
What information does the public Terraform Module Registry automatically expose about published modules?
- A: Required input variables
- B: Optional inputs variables and default values
- C: Outputs
- D: All of the above
- E: None of the above
Question 69
A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.
- A: True
- B: False
Question 70
Which are forbidden actions when the Terraform state file is locked? (Choose three.)
- A: terraform destroy
- B: terraform fmt
- C: terraform state list
- D: terraform apply
- E: terraform plan
- F: terraform validate
Question 71
Terraform installs its providers during which phase?
- A: Plan
- B: Init
- C: Refresh
- D: All of the above
Question 72
When does Sentinel enforce policy logic during a Terraform Enterprise run?
- A: Before the plan phase
- B: During the plan phase
- C: Before the apply phase
- D: After the apply phase
That’s the end of your free questions
You’ve reached the preview limit for Terraform AssociateConsider upgrading to gain full access!
Free preview mode
Enjoy the free questions and consider upgrading to gain full access!