0
0
Terraformcloud~5 mins

Remote-exec provisioner in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the remote-exec provisioner in Terraform?
The remote-exec provisioner runs commands on a remote machine after it is created, allowing you to configure the machine or install software.
Click to reveal answer
beginner
Which connection methods can remote-exec use to connect to the remote machine?
It can use SSH for Linux machines or WinRM for Windows machines to connect and run commands remotely.
Click to reveal answer
beginner
How do you specify commands to run with remote-exec?
You specify commands inside the inline argument as a list of strings, each string is a command to run in order.
Click to reveal answer
intermediate
What happens if a command in remote-exec fails during execution?
Terraform stops the provisioning process and reports an error, so you can fix the issue before continuing.
Click to reveal answer
beginner
Why is it important to configure the connection block correctly when using remote-exec?
Because Terraform needs the right credentials and network access to connect to the remote machine and run commands successfully.
Click to reveal answer
What does the remote-exec provisioner do in Terraform?
ARuns commands on a remote machine after creation
BCreates a remote machine
CDeletes remote resources
DManages Terraform state files
Which protocol is commonly used by remote-exec to connect to Linux machines?
AWinRM
BFTP
CHTTP
DSSH
Where do you list the commands to run in a remote-exec provisioner?
AIn the provider block
BInside the <code>connection</code> block
CInside the <code>inline</code> block
DIn the Terraform backend configuration
What must you configure to allow remote-exec to connect to the remote machine?
AThe Terraform backend
BThe <code>connection</code> block with credentials and host info
CThe provider version
DThe output variables
If a command in remote-exec fails, what does Terraform do?
AStops and reports an error
BIgnores the error and continues
CRetries the command indefinitely
DDeletes the remote machine
Explain how the remote-exec provisioner works in Terraform and why it is useful.
Think about how you would set up a new computer remotely after turning it on.
You got /4 concepts.
    Describe the role of the connection block when using remote-exec and what happens if it is misconfigured.
    Imagine trying to call a friend but dialing the wrong number.
    You got /3 concepts.