
[2023年11月]更新のHashiCorp TA-002-P公式認定ガイドPDF
試験TA-002-P HashiCorp Certified: Terraform Associate
質問 # 25
You have deployed a new webapp with a public IP address on a clod provider. However, you did not create
any outputs for your code.
What is the best method to quickly find the IP address of the resource you deployed?
- A. Run terraform output ip_address to view the result
- B. Run terraform destroy then terraform apply and look for the IP address in stdout
- C. Run terraform state list to find the name of the resource, then terraform state show to find the attributes
including public IP address - D. In a new folder, use the terraform_remote_state data source to load in the state file, then write an output
for each resource that you find the state file
正解:C
解説:
Explanation
https://www.terraform.io/cli/commands/state/show
質問 # 26
Which task does teraform init not perform?
- A. Validates all required variables are present
- B. Sources all providers present in the configuration and ensures they are downloaded and available locally
- C. Connects to the backend
- D. Sources any modules and copies the configuration locally
正解:A
質問 # 27
Terraform has detailed logs which can be enabled by setting the _________ environmental variable.
- A. TF_INFO
- B. TF_TRACE
- C. TF_DEBUG
- D. TF_LOG
正解:D
解説:
Explanation
Terraform has detailed logs that can be enabled by setting the TF_LOG environment variable to any value.
This will cause detailed logs to appear on stderr.
You can set TF_LOG to one of the log levels TRACE, DEBUG, INFO, WARN or ERROR to change the verbosity of the logs. TRACE is the most verbose and it is the default if TF_LOG is set to something other than a log level name.
https://www.terraform.io/docs/internals/debugging.html
質問 # 28
Complete the following sentence:
For local state, the workspaces are stored directly in a ___________.
- A. a file called terraform.tfstate
- B. directory called terraform.workspaces.tfstate
- C. a file called terraform.tfstate.backup
- D. directory called terraform.tfstate.d
正解:D
解説:
Explanation
For local state, Terraform stores the workspace states in a directory called terraform.tfstate.d.
https://www.terraform.io/docs/state/workspaces.html#workspace-internals
質問 # 29
Refer to the following terraform variable definition
variable "track_tag" { type = list default = ["data_ec2","integration_ec2","digital_ec2"]} track_tag = { Name =
element(var.track_tag,count.index)}
If count.index is set to 2, which of the following values will be assigned to the name attribute of track_tag
variable?
- A. data_ec2
- B. digital_ec2
- C. track_tag
- D. integration_ec2
正解:B
質問 # 30
Anyone can publish and share modules on the Terraform Public Module Registry, and meeting the requirements for publishing a module is extremely easy. Select from the following list all valid requirements. (select three)
- A. The module must be on GitHub and must be a public repo.
Explanation
https://www.terraform.io/docs/registry/modules/publish.html#requirements - B. The module must be PCI/HIPPA compliant.
- C. Module repositories must use this three-part name format, terraform-- .
- D. The registry uses tags to identify module versions.
- E. Release tag names must be for the format x.y.z, and can optionally be prefixed with a v .
正解:A、D、E
質問 # 31
Your team uses terraform OSS . You have created a number of resuable modules for important , independent network components that you want to share with your team to enhance consistency . What is the correct option/way to do that?
- A. Upload your modules with proper versioning in the terraform public module registry . Terraform OSS is directly integrated with the public module registry , and can reference the modules from the code in the main tf file.
- B. Terraform module sharing is only available in Enterprise version via terraform private module registry , so no way to enable it in OSS version.
- C. Store your modules in a NAS/ shared file server , and ask your team members to directly reference the code from there. This is the only viable option in terraform OSS ,which is better than individually maintaining module versions for every developer.
- D. Terraform modules cannot be shared in OSS version . Each developer needs to maintain their own modules and leverage them in the main tf file.
正解:A
解説:
Software development encourages code reuse through reusable artifacts, such as libraries, packages and modules. Most programming languages enable developers to package and publish these reusable components and make them available on a registry or feed. For example, Python has Python Package Index and PowerShell has PowerShell Gallery.
For Terraform users, the Terraform Registry enables the distribution of Terraform modules, which are reusable configurations. The Terraform Registry acts as a centralized repository for module sharing, making modules easier to discover and reuse.
The Registry is available in two variants:
* Public Registry houses official Terraform providers -- which are services that interact with an API to expose and manage a specific resource -- and community-contributed modules.
* Private Registry is available as part of the Terraform Cloud, and can host modules internally within an organization.
https://www.terraform.io/docs/registry/index.html
質問 # 32
Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource. What command will do this?
- A. terraform apply
- B. terraform refresh
- C. terraform graph
- D. terraform taint
正解:D
解説:
The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply.
This command will not modify infrastructure, but does modify the state file in order to mark a resource as tainted. Once a resource is marked as tainted, the next plan will show that the resource will be destroyed and recreated and the next apply will implement this change.
Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource. For example: re-running provisioners will cause the node to be different or rebooting the machine from a base image will cause new startup scripts to run.
Note that tainting a resource for recreation may affect resources that depend on the newly tainted resource. For example, a DNS resource that uses the IP address of a server may need to be modified to reflect the potentially new IP address of a tainted server. The plan command will show this if this is the case.
This example will taint a single resource:
$ terraform taint aws_security_group.allow_all
The resource aws_security_group.allow_all in the module root has been marked as tainted.
https://www.terraform.io/docs/commands/taint.html
質問 # 33
You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (files). You need to enable debug messages to find this out.
Which of the following would achieve this?
- A. Set the environment variable TF_LOG_PATH
- B. Set verbose logging for each provider in your Terraform configuration
- C. Set the environment variable TF_LOG=TRACE
- D. Set the environment variable TF_VAR_log=TRACE
正解:C
質問 # 34
Terraform plan updates your state file.
- A. False
- B. True
正解:A
質問 # 35
What does terrafom plan do ?
- A. Create an execution plan by evaluating the difference between configuration file and state file.
- B. Checks whether the execution plan for a set of changes matches your expectations by making changes to real resources or to the state.
- C. Performs a refresh, unless explicitly disabled, and then apply the changes that are necessary to achieve the desired state specified in the configuration files.
- D. Create an execution plan by evaluating the difference between configuration file and actual infrastructure.
正解:A
質問 # 36
Terraform works well in Windows but a Windows server is required.
- A. False
- B. True
正解:A
質問 # 37
Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers?
- A. servers = num_servers
- B. servers = var(num_servers)
- C. servers = var.num_servers
- D. servers = variable.num_servers
正解:A
質問 # 38
Terraform variables and outputs that set the "description" argument will store that description in the state file.
- A. False
- B. True
正解:A
解説:
Explanation/Reference: https://www.terraform.io/docs/language/values/outputs.html
質問 # 39
A single terraform resource file that defines an aws_instance resource can simply be renamed to
vsphere_virtual_machine in order to switch cloud providers.
- A. False
- B. True
正解:A
解説:
Explanation
Every provider has its own required and allowed declarations none of which match between cloud providers.
質問 # 40
What feature stops multiple users from operating on the Terraform state at the same time?
- A. State locking
- B. Version control
- C. Remote backends
- D. Provider constraints
正解:A
解説:
State locking prevents other users from modifying the state file while a Terraform operation is in progress. This prevents conflicts and data loss1.
質問 # 41
What value does the Terraform Cloud/Terraform Enterprise private module registry provide over the public Terraform Module Registry?
- A. The ability to share modules publicly with any user of Terraform
- B. The ability to share modules with public Terraform users and members of Terraform Enterprise Organizations
- C. The ability to tag modules by version or release
- D. The ability to restrict modules to members of Terraform Cloud or Enterprise organizations
正解:A
解説:
Terraform Registry is an index of modules shared publicly using this protocol. This public registry is the easiest way to get started with Terraform and find modules created by others in the community.
Reference: https://www.terraform.io/docs/language/modules/sources.html
質問 # 42
......
Hashicorp TA-002 Pertification試験は、57の複数選択の質問で構成されるリモートの提案された試験です。試験時間は1時間30分で、合格スコアは70%です。この試験では、Terraformの基本、構成言語、リソース管理、データソース、モジュールなど、さまざまなトピックをカバーしています。
HashiCorp TA-002-P(Hashicorp Certified:Terraform Associate)認定試験は、インフラストラクチャの構築、変更、バージョンのバージョンに使用されるオープンソースツールであるTerraformを使用する専門家の知識とスキルを測定するように設計されています。この認定は、インフラストラクチャオートメーションソフトウェアの大手プロバイダーであるHashicorpによって提供されており、Terraformの使用に関する専門知識を実証したい個人に最適です。
無料TA-002-P試験問題集試験点数を伸ばそう:https://www.passtest.jp/HashiCorp/TA-002-P-shiken.html
2023年最新の実際に出るTA-002-P問題集には試験のコツがあるPDF試験材料:https://drive.google.com/open?id=19V1dT3Rv5fmrOxLgs3h4qX_VTTSGWQUG