ExamGecko
Question list
Search
Search

Question 147 - Terraform Associate 003 discussion

Report
Export

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.
file('id_rsa.pub')
Answers
A.
file('id_rsa.pub')
B.
templaTefil('id_rsa.pub')
Answers
B.
templaTefil('id_rsa.pub')
C.
filebase64('id_rsa.pub')
Answers
C.
filebase64('id_rsa.pub')
D.
fileset<'id_rsa.pub')
Answers
D.
fileset<'id_rsa.pub')
Suggested answer: A

Explanation:

To import the contents of a local file as a string in Terraform, you can use the built-in file function. By specifying file('id_rsa.pub'), Terraform reads the contents of the id_rsa.pub file and uses it as a string within your Terraform configuration. This function is particularly useful for scenarios where you need to include file data directly into your configuration, such as including an SSH public key for provisioning cloud instances. Reference = This information is a standard part of Terraform's functionality with built-in functions, as outlined in Terraform's official documentation and commonly used in various Terraform configurations.

asked 18/09/2024
Lars Bleckmann
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first