WorksheetsIntro to Terraform
Total questions: 10
Worksheet time: 20mins
Which of the following best describes a Terraform provider?
A container for multiple resources that are used together
Serves as a parameter for a Terraform module that allows a module to be customized
Describes an infrastructure object, such as a virtual network, compute instance, or other component
A plugin that Terraform uses to translate the API interactions with the service
What happens when a terraform apply is executed?
Reconciles the state Terraform knows about with the real-world infrastructure
Creates the execution plan for the deployment of resources
The backend is initialized and the working directory is prepped
Applies the changes required in the target infrastructure in order to reach the desired configuration
Which flag would be used within a Terraform configuration block to identify the specific version of a provider required?
required-provider
required-version
required_versions
required_providers
True or False: You can migrate the Terraform backend but only if there are no resources currently being managed.
True
False
In regards to Terraform state file, select all the statements below which are correct: (select 3)
The state file is always encrypted at rest
The Terraform state can contain sensitive data, therefore the state file should be treated as sensitive
Storing state remotely can provide better security
When using local state, the state file is stored in plain-text
Using the mask feature, you can instruct Terraform to mask sensitive data in the state file
Before a new provider can be used, it must be ______ (Select 2)
Approved by HashiCorp
Initialized
Uploaded to source control
Declared in the configuration
What are some of the problems of how infrastructure was traditionally managed before Infrastructure as Code?
Pointing and clicking in a management console isn't scalable as businesses move to a multi-cloud deployment model
Requests for infrastructure or hardware required a ticket, increasing the time required to deploy applications
Traditional deployment methods are not able to meet the demands of the modern business where resources tend to live days to weeks, rather than months to years
Traditionally managed infrastructure can't keep up with cyclic or elastic applications
All of the above
By default, where does Terraform store its state file?
remotely using Terraform Cloud
current working directory
shared directory
Amazon S3 bucket
What happens when a terraform plan is executed?
It creates an execution plan and determines what changes are required to achieve the desired state in the configuration files.
It applies the changes required in the target infrastructure in order to reach the desired configuration
It reconciles the state Terraform knows about with the real-world infrastructure
The backend is initialized and the working directory is prepped
Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?
terraform taint
terrform fmt
terraform destroy
terraform refresh
