2025年02月最新のHashiCorp Terraform-Associate-003問題集で更新された195問あります [Q78-Q94]

Share

2025年02月最新のHashiCorp Terraform-Associate-003問題集で更新された195問あります

PDF無料ダウンロードにはTerraform-Associate-003有効な練習テスト問題

質問 # 78
How is terraform import run?

  • A. As a part of terraform init
  • B. All of the above
  • C. By an explicit call
  • D. As a part of terraform plan
  • E. As a part of terraform refresh

正解:C

解説:
The terraform import command is not part of any other Terraform workflow. It must be explicitly invoked by the user with the appropriate arguments, such as the resource address and the ID of the existing infrastructure to import. References = [Importing Infrastructure]


質問 # 79
What does state looking accomplish?

  • A. Blocks Terraform commands from modifying, the state file
  • B. Copies the state file from memory to disk
  • C. Encrypts any credentials stored within the state file
  • D. Prevent accidental Prevent accident deletion of the state file

正解:A

解説:
Explanation
This is what state locking accomplishes, by preventing other users from modifying the state file while a Terraform operation is in progress. This prevents conflicts and data loss.


質問 # 80
Which of the following should you put into the required_providers block?

  • A. version = ">= 3.1"
  • B. version >= 3.1
  • C. version ~> 3.1

正解:A

解説:
The required_providers block is used to specify the provider versions that the configuration can work with. The version argument accepts a version constraint string, which must be enclosed in double quotes. The version constraint string can use operators such as >=, ~>, =, etc. to specify the minimum, maximum, or exact version of the provider. For example, version = ">= 3.1" means that the configuration can work with any provider version that is 3.1 or higher. References = [Provider Requirements] and [Version Constraints]


質問 # 81
Where can Terraform not load a provider from?

  • A. Official HashCrop Distribution on releases.hashcrop.com
  • B. Provider plugin chance
  • C. Plugins directory
  • D. Source code

正解:D

解説:
This is where Terraform cannot load a provider from, as it requires a compiled binary file that implements the provider protocol. You can load a provider from a plugins directory, a provider plugin cache, or the official HashiCorp distribution on releases.hashicorp.com.


質問 # 82
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)

  • A. The .terraform directory
  • B. The execution plan
  • C. State file
  • D. Cloud infrastructure Most Voted
  • E. Terraform code

正解:C、D

解説:
The terraform apply command changes both the cloud infrastructure and the state file after you approve the execution plan. The command creates, updates, or destroys the infrastructure resources to match the configuration. It also updates the state file to reflect the new state of the infrastructure. The .terraform directory, the execution plan, and the Terraform code are not changed by the terraform apply command.
References = Command: apply and Purpose of Terraform State


質問 # 83
You are using a networking module in your Terraform configuration with the name label my-network. In your main configuration you have the following code:

When you run terraform validate, you get the following error:

What must you do to successfully retrieve this value from your networking module?

  • A. Change the reference value module.my,network,outputs,vnet_id
  • B. Define the attribute vnet_id as an output in the networking module
  • C. Define the attribute vmet_id as a variable in the networking modeule
  • D. Change the reference value to my-network,outputs,vmet_id

正解:B

解説:
Explanation
This is what you must do to successfully retrieve this value from your networking module, as it will expose the attribute as an output value that can be referenced by other modules or resources. The error message indicates that the networking module does not have an output value named vnet_id, which causes the reference to fail.


質問 # 84
_______backends support state locking.

  • A. Only local
  • B. No
  • C. Some
  • D. All

正解:C

解説:
Explanation
Some backends support state locking, which prevents other users from modifying the state file while a Terraform operation is in progress. This prevents conflicts and data loss. Not all backends support this feature, and you can check the documentation for each backend type to see if it does.


質問 # 85
You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?

  • A. Run the terraform fmt command during the code linting phase of your CI/CD process Most Voted
  • B. Designate one person in each team to review and format everyone's code
  • C. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed
  • D. Manually apply two spaces indentation and align equal sign "=" characters in every Terraform file (*.tf)

正解:A

解説:
The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style. This command applies a subset of the Terraform language style conventions, along with other minor adjustments for readability. Running this command on your configuration files before committing them to source control can help ensure consistency of style between different Terraform codebases, and can also make diffs easier to read. You can also use the -check and -diff options to check if the files are formatted and display the formatting changes respectively2. Running the terraform fmt command during the code linting phase of your CI/CD process can help automate this process and enforce the formatting standards for your team.
References = [Command: fmt]2


質問 # 86
You have a list of numbers that represents the number of free CPU cores on each virtual cluster:

What Terraform function could you use to select the largest number from the list?

  • A. max(numcpus)
  • B. hight[numcpus]
  • C. top(numcpus)
  • D. ceil (numcpus)

正解:A

解説:
In Terraform, the max function can be used to select the largest number from a list of numbers. The max function takes multiple arguments and returns the highest one. For the list numcpus = [18, 3, 7, 11, 2], using max(numcpus...) will return 18, which is the largest number in the list.
Reference:
Terraform documentation on max function: Terraform Functions - max


質問 # 87
Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files.
How can you protect that data?

  • A. Edit your state file to scrub out the sensitive data
  • B. Always store your secrets in a secrets.tfvars file
  • C. Delete the state file every time you run Terraform
  • D. Store the state in an encrypted backend

正解:D

解説:
Explanation
This is a secure way to protect sensitive data in the state file, as it will be encrypted at rest and in transit2. The other options are not recommended, as they could lead to data loss, errors, or security breaches.


質問 # 88
Which of the following is not a way to trigger terraform destroy?

  • A. Running terraform destroy from the correct directory and then typing yes when prompted in the CLI.
  • B. Passing --destroy at the end of a plan request.
  • C. Using the destroy command with auto-approve.

正解:B

解説:
Destroy Command Options: The terraform destroy command is the correct method to destroy resources, and it requires either manual approval or the -auto-approve flag.
Unsupported Triggering Method: The --destroy flag is not a recognized option for plan or apply commands, making B the correct answer as it is not a valid way to initiate resource destruction.
For more on destroying resources, refer to the terraform destroy command documentation in the Terraform CLI reference.


質問 # 89
You can configure Terraform to log to a file using the TF_LOG environment variable.

  • A. False
  • B. True

正解:B

解説:
Explanation
You can configure Terraform to log to a file using the TF_LOG environment variable. This variable can be set to one of the log levels: TRACE, DEBUG, INFO, WARN or ERROR. You can also use the TF_LOG_PATH environment variable to specify a custom log file location. References = : Debugging Terraform


質問 # 90
How could you reference an attribute from the vsphere_datacenter data source for use with the datacenter_id argument within the vsphere_folder resource in the following configuration?

  • A. Data.vsphere_datacenter.DC.id
  • B. Data.vsphere_datacenter,dc
  • C. Data,dc,id
  • D. Vsphere_datacenter.dc.id

正解:A

解説:
The correct way to reference an attribute from the vsphere_datacenter data source for use with the datacenter_id argument within the vsphere_folder resource in the following configuration is data.vsphere_datacenter.dc.id. This follows the syntax for accessing data source attributes, which is data.TYPE.NAME.ATTRIBUTE. In this case, the data source type is vsphere_datacenter, the data source name is dc, and the attribute we want to access is id. The other options are incorrect because they either use the wrong syntax, the wrong punctuation, or the wrong case. Reference = [Data Source: vsphere_datacenter], [Data Source: vsphere_folder], [Expressions: Data Source Reference]


質問 # 91
You are using a networking module in your Terraform configuration with the name label my-network. In your main configuration you have the following code:
When you run terraform validate, you get the following error:
What must you do to successfully retrieve this value from your networking module?

  • A. Change the reference value module.my,network,outputs,vnet_id
  • B. Define the attribute vnet_id as an output in the networking module
  • C. Define the attribute vmet_id as a variable in the networking modeule
  • D. Change the reference value to my-network,outputs,vmet_id

正解:B

解説:
This is what you must do to successfully retrieve this value from your networking module, as it will expose the attribute as an output value that can be referenced by other modules or resources. The error message indicates that the networking module does not have an output value named vnet_id, which causes the reference to fail.


質問 # 92
Which of these actions are forbidden when the Terraform state file is locked? (Pick the 3 correct responses)

  • A. terraform fmt
  • B. terraform destroy
  • C. terraform state list
  • D. terraform apply

正解:B、C、D

解説:
When the state file is locked, operations that modify or depend on the state (like terraform apply, terraform destroy, and terraform state list) are blocked. terraform fmt only formats the configuration files and does not interact with the state, so it is allowed.
References:
Terraform State Locking


質問 # 93
You have used Terraform lo create an ephemeral development environment in the (loud and are now ready to destroy all the Infrastructure described by your Terraform configuration To be safe, you would like to first see all the infrastructure that Terraform will delete.
Which command should you use to show all of the resources that mil be deleted? Choose two correct answers.

  • A. Run terraform show :destroy
  • B. Run terraform plan .destory
  • C. Run terraform state rm '
  • D. Run terraform destroy and it will first output all the resource that will be deleted before prompting for approval

正解:B、D

解説:
To see all the resources that Terraform will delete, you can use either of these two commands:
terraform destroy will show the plan of destruction and ask for your confirmation before proceeding. You can cancel the command if you do not want to destroy the resources.
terraform plan -destroy will show the plan of destruction without asking for confirmation. You can use this command to review the changes before running terraform destroy. References = : Destroy Infrastructure : Plan Command: Options


質問 # 94
......


HashiCorp Terraform-Associate-003 認定試験の出題範囲:

トピック出題範囲
トピック 1
  • HCP Terraform を使用してインフラストラクチャをコードとして共同作業する: このセクションでは、HCP Terraform 実行ワークフローの分析、HCP Terraform ワークスペースの役割とその構成オプション、HCP Terraform でのプロバイダー資格情報の管理などのトピックについて説明します。
トピック 2
  • リソース ライフサイクルの管理: このセクションでは、terraform init とそのオプションを使用した構成の初期化や、terraform plan とそのオプションを使用した実行プランの生成などのトピックについて説明します。また、Terraform Apply とそのオプションを使用した構成の変更についても説明します。
トピック 3
  • 動的構成の開発とトラブルシューティング: このセクションでは、言語機能を使用してデータ ソースを使用して構成クエリ プロバイダーを検証する方法、HCL 関数を使用してデータを計算および補間する方法、構成でメタ引数を使用する方法などのトピックについて説明します。

 

Terraform-Associate-003テストエンジンお試しセット、Terraform-Associate-003問題集PDF:https://www.passtest.jp/HashiCorp/Terraform-Associate-003-shiken.html

最新のHashiCorp Terraform-Associate-003のPDFと問題集で(2025)無料試験問題解答はここ:https://drive.google.com/open?id=1j3upgzGfuonWnt2P2r8_iV7EGbbsJYQc