Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Terraform Associate topic 1 question 43 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 43
Topic #: 1
[All Terraform Associate Questions]

Which option can not be used to keep secrets out of Terraform configuration files?

  • A. A Terraform provider
  • B. Environment variables
  • C. A -var flag
  • D. secure string
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Reference:
https://secrethub.io/blog/secret-management-for-terraform/

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
hip9k
Highly Voted 1 year, 8 months ago
Selected Answer: D
It's D We can use providers to supply variable values (vault for example). We can provide input variable value in parameter for apply command. We can use environment variables. HashiCorp is not mentioning anything about secure strings. Reference: https://www.terraform.io/language/values/variables
upvoted 25 times
[Removed]
10 months ago
Terraform does not have a built-in concept of a "secure string". This means that you cannot use the secure_string keyword to define a secret in your Terraform configuration file. Link below recommends the three options. A. e.g. Vault B. e.g. export TF_VAR_db_username=admin TF_VAR_db_password=adifferentpassword C. -var-file="secret.tfvars" https://developer.hashicorp.com/terraform/tutorials/configuration-language/sensitive-variables
upvoted 1 times
...
...
stalk98
Highly Voted 1 year, 10 months ago
i think D
upvoted 8 times
...
CryptoShade
Most Recent 1 week, 1 day ago
Answer is: A. Terraform provider It says: to Hide secrets and not include secrets. Here's why the other options are suitable for hiding secrets: B. Environment variables: Environment variables store sensitive information outside of Terraform code, and Terraform can access them during execution. C. A -var flag: The -var flag allows passing secrets as command-line arguments when running terraform apply or other commands. These arguments aren't stored in the configuration files. D. Secure string: Some Terraform providers (like AWS) offer functionality to store secrets securely within the provider itself (e.g., AWS Secrets Manager). This keeps them out of the configuration files.
upvoted 1 times
...
Felienator
1 week, 4 days ago
swear to god these questions are worded so fking poorly
upvoted 1 times
...
Bolgarwow
4 weeks ago
can not be used to keep secrets D - Secret String
upvoted 1 times
...
vibzr2023
1 month ago
D is correct.. In Terraform, the term "secure string" isn't a specific built-in type or feature by that name. However, the concept of treating certain strings as "secure" or sensitive is indeed present in Terraform, particularly through the use of the sensitive attribute for variables and outputs. When we refer to a "secure string" in the context of Terraform, it's generally about handling sensitive values such as passwords, secret keys, or any confidential data that should not be exposed in logs or CLI output. Here's how you can declare a variable as sensitive: variable "api_secret_key" { type = string sensitive = true }
upvoted 1 times
...
imkhan
5 months, 3 weeks ago
I will go for A. All other options are to keep secrets out of Terraform configuration files, you typically use environment variables, a -var flag, or secure string variables.
upvoted 2 times
...
gofavad926
7 months ago
Selected Answer: D
D, "secure string"
upvoted 1 times
...
Pradh
7 months ago
C is the answer
upvoted 1 times
...
Spandrop
7 months, 4 weeks ago
Bad answers for this question. Definitely you cannot use a terraform provider to keep secrets out of your terraform configuration. Even if you use Vault, you must provide the Vault itself secrets and or you save to a file, in an environment variable, or within the provider itself. So "A" is wrong. The issue is that "D" is also wrong. A and D should be the answers for this question in my opinion.
upvoted 2 times
...
BtotheJ
8 months, 2 weeks ago
Selected Answer: D
D is correct because all other options can be used to keep secrets out of terraform config files
upvoted 1 times
...
Bere
9 months ago
Selected Answer: D
Answer is D. A. Terraform Provider: You can use sensitive variables in Terraform Cloud (below link) or other secrets management solutions (e.g. AWS Secrets Manager). Sensitive variables / sensitive values is described here: https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables/managing-variables#sensitive-values B. Environment Variables: You can use environment variables. Terraform will read environment variables that start with TF_VAR_, followed by the name of a declared variable in your configuration. C. -var flag: You can use the -var command line flag. This is useful for setting sensitive data that should not be stored in your configuration. e.g. terraform apply -var 'db_password=My$ecretP@ssw0rd' D. "secure string" is not a valid option for keeping secrets out of Terraform configuration files. The term "secure string" is not a recognized or standard feature in Terraform.
upvoted 1 times
...
Jlee7
10 months ago
Answer is A A Terraform provider is a software library that allows Terraform to interact with a particular cloud provider or other infrastructure service. Terraform providers do not have the ability to store secrets, so they cannot be used to keep secrets out of Terraform configuration files.
upvoted 4 times
...
March2023
10 months, 2 weeks ago
Selected Answer: D
Terraform does not have a built-in "secure string" option
upvoted 1 times
...
milan92stankovic
10 months, 2 weeks ago
Selected Answer: D
It's D.
upvoted 1 times
...
mememu
12 months ago
A is incorrect, A provider can also declare an attribute as sensitive, which will cause Terraform to hide it from regular output regardless of how you assign it a value. Ref. https://developer.hashicorp.com/terraform/language/values/variables
upvoted 2 times
...
Ni33
12 months ago
Selected Answer: A
I think it is A. Provider has nothing to do with secret Managment.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...