Font size
WorksheetsTerraform Day 3 Accenture
Total questions: 24
Worksheet time: 9mins
You write a new Terraform configuration and immediately run terraform apply in the CLI using the local backend. Why will the apply fail?
Terraform needs you to format your code according to best practices first
Terraform needs to install the necessary plugins first
The Terraform CLI needs you to log into Terraform cloud first
Terraform requires you to manually run terraform plan first
Your team is collaborating on a Terraform project, and you're concerned about potential conflicts when multiple team members try to apply changes simultaneously. Which feature of Terraform helps prevent such conflicts?
State management
Locking
State commands
Terraform Cloud
You want to inspect the details of resources managed by Terraform within your project. Which Terraform command should you use?
terraform plan
terraform apply
terraform show
terraform state list
You want to list all resources tracked by Terraform within your project. Which Terraform command would provide you with this information?
terraform state list
terraform state show
terraform state pull
terraform state refresh
In your Terraform project, you have accidentally deleted an EC2 resource outside of Terraform, and now you need to remove it from Terraform's state file to avoid conflicts. Which Terraform command should you use to remove the resource from the state file?
terraform state remove aws_instance.example
terraform state rm aws_instance.example
terraform state delete aws_instance.example
terraform state clean aws_instance.example
Where in your Terraform configuration do you specify a state backend?
The terraform block
The resource block
The provider block
The datasource block
You suspect there might be issues with your current state file and want to manually inspect its contents. Which command would you use to download and view the state file in JSON format?
terraform state show
terraform state pull
terraform plan
terraform state list
You need to inspect the details of a specific resource within your state file to verify its attributes. Which command should you use?
terraform state list
terraform state show
terraform plan
terraform state mv
You want to clean up your state file by removing resources that are no longer needed, but you want to confirm the exact resource names first. Which sequence of commands should you use?
terraform plan followed by terraform destroy
terraform state list followed by terraform state rm
terraform state show followed by terraform state rm
terraform apply followed by terraform state rm
What is the default backends used by terraform CLI?
Terraform Cloud
Consul
Remote
Local
What does the default "local" Terraform backend store?
tfplan files
Terraform binary
Provider plugins
State file
what contains a terraform state?
The mapping of the resource's configuration
Information of the real infrastructure
Metadata of the resources created
Why is it useful to use remote backends?
To work in a team
for remote operations
for state locking
By default, where does Terraform store its state file?
remotely using Terraform Cloud
current working directory
shared directory
Amazon S3 bucket
Which of these provisioners can execute a command on the machine where Terraform is run?
remote-exec
local-exec
script-exec
manual-exec
Which provisioner would you use to transfer files to a remote machine in Terraform?
file
upload-exec
remote-exec
local-exec
What is the key difference between local-exec and remote-exec provisioners in Terraform?
local-exec runs on the target resource, and remote-exec runs on the local machine
local-exec runs on the local machine, and remote-exec runs on the target resource
local-exec runs before resource creation, while remote-exec runs after
There is no difference; both run the same commands
When using the file provisioner in Terraform, which parameter specifies the file to be uploaded?
source
destination
content
remote_path
Which command is used to initialize a backend configuration in Terraform?
terraform init
terraform backend
terraform state
terraform configure
What is the default locking mechanism used by Terraform when using a remote backend to prevent simultaneous state file changes when using S3 backend.
File locks
Resource locks
DynamoDB locks
Terraform does not support locking for remote
Which connection type is supported by Terraform for connecting to a remote machine for provisioning?
ssh
ftp
http
rdp
Which GCP service is typically used for storing remote state files in Terraform?
Google Cloud Datastore
Google Cloud Storage (GCS)
Google Cloud Bigtable
Google Cloud Functions
Where is the backend block typically located within a Terraform configuration file?
Inside the provider block
At the beginning of the file, outside of any block.
Inside the terraform block.
After the resource definitions
Which of the following actions will NOT trigger a reinitialization of the backend in Terraform?
Changing the backend configuration values
Running terraform plan
Running terraform init -reconfigure
Switching from a local backend to a remote backend
