Terraform Associate Complete Practice Exam 2025

Question: 1 / 400

What is a safe way to inject sensitive variables into a Terraform run in a CI/CD pipeline?

Embed them directly in the configuration files

Pass variables using a 'var' flag

Passing variables using a 'var' flag is a secure method to handle sensitive information in a Terraform run within a CI/CD pipeline. This approach allows you to send sensitive variables without hardcoding them in the configuration files, which poses a risk of exposure. Using the 'var' flag integrates well with CI/CD systems, as it enables the dynamic allocation of sensitive data during execution time.

In CI/CD scenarios, sensitive variables should ideally not be showcased in logs or version control systems, hence utilizing the 'var' flag helps keep the values secure during the pipeline execution. This method allows for injecting these variables safely from external sources, like secrets management tools or environment configurations, reducing the risk of leakage.

Embedding sensitive variables directly in configuration files is risky because it can lead to unintentional exposure through version control systems or in logs. Storing sensitive variables in plaintext files also poses a significant risk, as anyone with access to the file could view the sensitive information. Sharing through environment variables can be a viable option; however, it must be managed cautiously, as improperly configured environment variables can lead to leaks, especially if CI/CD logs capture them. Therefore, using the 'var' flag strikes a balance between ease of use and maintaining the confidentiality of sensitive information.

Get further explanation with Examzify DeepDiveBeta

Store them in a plaintext file

Share them through environment variables

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy