Exhibit:
resource "aws_instance" "example" {
ami = "ami-0a123456789abcdef"
instance_type = "t3.micro"
}
You are updating a child module with the resource block shown in the exhibit. The public_ip attribute of the resource needs to be accessible to the parent module. How do you meet this requirement?
What type of information can be found on the Terraform Registry when using published modules?
You can develop a custom provider to manage its resources using Terraform.
You need to destroy all of the resources in your Terraform workspace, except for aws_instance.ubuntu[1], which you want to keep. How can you tell Terraform to stop managing that specific resource without destroying it?
The -refresh-only parameter will update your state file when used with terraform plan.
A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.
How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?
When using multiple configuration of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
Which command generates DOT (Document Template) formatted data to visualize Terraform dependencies?
A developer launched a VM outside of the Terraform workflow and ended up with two servers with the same name. They are unsure which VM is managed with Terraform, but they do have a list of all active VM IDs. Which method could you use to determine which instance Terraform manages?
You ate making changes to existing Terraform code to add some new infrastructure. When is the best time to run terraform validate?
You corrected a typo in a resource name, changing it from aws_s3_bucket.photoes to aws_s3_bucket.photos. You want to update the Terraform state so that the existing resource is recognized under the new name, without destroying and recreating it. Which configuration should you use?
Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.
You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully. What should you do to delete the newly-created VM with Terraform?
Which option cannot be used to keep secrets out of Terraform configuration files?
Exhibit.
You need to deploy resources into two different regions in the same Terraform configuration. To do this, you declare multiple provider configurations as shown in the Exhibit space on this page.
What meta-argument do you need to configure in a resource block to deploy the resource to the us-west-2 AWS region?
You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?
A Terraform backend determines how Terraform loads state and stores updates when you execute which command?
You want to use API tokens and other secrets within your team's Terraform workspaces. Where does HashiCorp recommend you store these sensitive values? (Pick 3)
Your team often uses API calls to create and manage cloud infrastructure. In what ways does Terraform differ from conventional infrastructure management approaches?
terraform validate uses provider APIs to verify your infrastructure settings.
Which provider authentication method prevents credentials from being stored in the state file?
Exhibit:
data "vsphere_datacenter" "dc" {}
resource "vsphere_folder" "parent" {
path = "Production"
type = "vm"
datacenter_id = _________
}
You want to pass the id of the vsphere_datacenter data source to the datacenter_id argument of the vsphere_folder resource. Which reference would you use?
When using a remote backend or terraform Cloud integration, where does Terraform save resource sate?
You created infrastructure outside the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?
The HCP Terraform private registry keeps the module configurations confidential within your organization.
What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?
Which of the following module source paths does not specify a remote module?
terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?
Error:
yaml
CopyEdit
Error loading state: AccessDenied: Access Denied
status code: 403, request id: 288766CE5CCA24A0, host id: web.example.com
You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.
You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.
How will Terraform choose which version of the provider to use?
What functionality do providers offer in Terraform? (Pick the 3 correct responses below.)
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
As a member of an operations team that uses infrastructure as code (lac) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would follow laC best practices for making a change?
Which of these are benefits of using Sentinel with HCP Terraform/Terraform Cloud? (Pick the 3 correct responses)
You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully.
What will happen if you delete the VM using the cloud provider console, then run terraform apply again without changing any Terraform code?
Which of the following should you add in the required_providers block to define a provider version constraint?
You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (* files). You need to enable additional logging messages to find this out. Which of the following would achieve this?
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
You are tasked with making a change to an infrastructure stack running in a public cloud using HCP Terraform/Terraform Cloud. Which pattern follows IaC best practices?
Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
All standard backend types support state locking, and remote operations like plan, apply, and destroy.
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
You’ve enabled DEBUG-level logging for Terraform, and you’d like to send the log data to a file. Which action should you take?
You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.
Which of these is the correct way to define the output value?
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
You can configure Terraform to log to a file using the TF_LOG environment variable.
Exhibit:
data "aws_ami" "web" {
most_recent = true
owners = ["self"]
tags = {
Name = "web-server"
}
}
A data source is shown in the exhibit. How do you reference the id attribute of this data source?
When you use a backend that requires authentication, it is best practice to:
The Terraform binary version and provider versions must match each other in a single configuration.
You have used Terraform lo create an ephemeral development environment in the (loud and are now ready to destroy all the Infrastructure described by your Terraform configuration To be safe, you would like to first see all the infrastructure that Terraform will delete.
Which command should you use to show all of the resources that mil be deleted? Choose two correct answers.
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?
terraform apply will fail if you have not run terraform plan first to update the plan output.
You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.
Which command will migrate your current state file to the new S3 remote backend?
What type of block is used to construct a collection of nested configuration blocks?
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?
Which of the following is availableonlyinHCP Terraform workspacesandnot in Terraform CLI?