
合格させるTA-002-Pテスト問題集で[2024年06月21日]に更新された94問あります
HashiCorp TA-002-P実際の問題と100%カバー率でリアル試験問題
Hashicorp TA-002-P(HashiCorp Certified:Terraform Associate)認定は、インフラストラクチャオートメーションの分野でキャリアを前進させようとするITプロフェッショナルにとって貴重な資格です。この認定は、候補者の知識とスキルを検証するように設計されており、テラフォームを使用してインフラストラクチャ管理タスクを自動化します。 Terraformは、ユーザーがインフラストラクチャをコードとして定義、提供、および管理できる人気のあるオープンソースツールです。
質問 # 20
You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead. What are the two things you must do to achieve this? Choose two correct answers.
- A. Run the terraform Import-gcp command
- B. Write Terraform configuration for the existing VMs
- C. Use the terraform import command for the existing VMs
- D. Provision new VMs using Terraform with the same VM names
正解:B、C
解説:
To import existing resources into Terraform, you need to do two things1:
Write a resource configuration block for each resource, matching the type and name used in your state file.
Run terraform import for each resource, specifying its address and ID. There is no such command as terraform Import-gcp, and provisioning new VMs with the same names will not import them into Terraform.
質問 # 21
terraform validate validates the syntax of Terraform files.
- A. False
- B. True
正解:B
解説:
Explanation
The terraform validate command validates the syntax and arguments of the Terraform configuration files.
Reference: https://www.terraform.io/docs/cli/code/index.html
質問 # 22
Terraform providers are always installed from the Internet.
- A. False
- B. True
正解:A
解説:
Explanation
Terraform configurations must declare which providers they require, so that Terraform can install and use
them.
Reference: https://www.terraform.io/docs/language/providers/configuration.html
質問 # 23
How can you ensure that the engineering team who has access to git repo will not create any non-compliant resources that might lead to a security audit failure in future. your team is using Hashicorp Terraform Enterprise Edition.
- A. Use Terraform OSS Sentinel Lite version , which will save cost , since there is no charge for OSS , but it can still check for most non-compliant rules using Policy-As-Code.
- B. Since your team is using Hashicorp Terraform Enterprise Edition , enable Sentinel , and write Policy-As-Code rules that will check for non-compliant resource provisioning , and prevent/report them.
- C. Implement a review process where every code will be reviewed before merging to the master branch.
- D. Create a design /security document (in PDF) and share to the team , and ask them to always follow that document , and never deviate from it.
正解:B
解説:
https://www.terraform.io/docs/cloud/sentinel/index.html
質問 # 24
You need to specify a dependency manually. What resource meta-parameter can you use lo make sure Terraform respects thee dependency?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.
正解:
解説:
dependson
質問 # 25
Why might a user opt to include the following snippet in their configuration file?
- A. this ensures that all Terraform providers are above a certain version to match the application being
deployed - B. Terraform 0.12 introduced substantial changes to the syntax used to write Terraform configuration
- C. The user wants to ensure that the application being deployed is a minimum version of 0.12
- D. versions before Terraform 0.12 were not approved by HashiCorp to be used in production
正解:B
質問 # 26
HashiCorp Configuration Language (HCL) supports user-defined functions.
- A. False
- B. True
正解:A
質問 # 27
You're building a CI/CD (continuous integration/continuous delivery) pipeline and need to inject sensitive variables into your Terraform run. How can you do this safely?
- A. Store the sensitive variables in a secure_varS.tf file
- B. Pass variables to Terraform with a -var flag
- C. Copy the sensitive variables into your Terraform code
- D. Store the sensitive variables as plain text in a source code repository
正解:B
解説:
his is a secure way to inject sensitive variables into your Terraform run, as they will not be stored in any file or source code repository. You can also use environment variables or variable files with encryption to pass sensitive variables to Terraform.
質問 # 28
Given the Terraform configuration below, in which order will the resources be created?
- A. Larger image
- B. aws_instance will be created first aws_eip will be created second
- C. aws_eip will be created first aws_instance will be created second
- D. resources will be created simultaneously
正解:B
解説:
Explanation
The aws_instance will be created first, and then aws_eip will be created second due to the aws_eip's resource
dependency of the aws_instance id
質問 # 29
Terraform import command can import resources into modules as well directly into the root of your state.
- A. False
- B. True
正解:B
解説:
Explanation
Import will find the existing resource from ID and import it into your Terraform state at the given ADDRESS.
ADDRESS must be a valid resource address. Because any resource address is valid, the import command can
import resources into modules as well directly into the root of your state.
Terraform is able to import existing infrastructure. This allows us take resources we've created by some other
means (i.e. via console) and bring it under Terraform management.
This is a great way to slowly transition infrastructure to Terraform.
The terraform import command is used to import existing infrastructure.
To import a resource, first write a resource block for it in our configuration, establishing the name by which it
will be known to Terraform. For example:
resource "aws_instance" "import_example" {
# ...instance configuration...
}
Now terraform import can be run to attach an existing instance to this resource configuration:
$ terraform import aws_instance.import_example i-03efafa258104165f
aws_instance.import_example: Importing from ID "i-03efafa258104165f"...
aws_instance.import_example: Import complete!
Imported aws_instance (ID: i-03efafa258104165f)
aws_instance.import_example: Refreshing state... (ID: i-03efafa258104165f)
Import successful!
The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
This command locates the AWS instance with ID i-03efafa258104165f (which has been created outside
Terraform) and attaches its existing settings, as described by the EC2 API, to the name
aws_instance.import_example in the Terraform state.
As a result of the above command, the resource is recorded in the state file. We can now run terraform plan to
see how the configuration compares to the imported resource, and make any adjustments to the configuration
to align with the current (or desired) state of the imported object.
https://www.terraform.io/docs/commands/import.html
質問 # 30
You have used Terraform to create an ephemeral development environment in the cloud 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 will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)
- A. Run terraform plan -destroy.
- B. This is not possible. You can only show resources that will be created.
- C. Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval.
- D. Run terraform state rm *.
正解:C、D
解説:
Explanation/Reference: https://www.terraform.io/docs/cli/commands/state/rm.html
質問 # 31
What kind of resource dependency is stored in terraform.tfstate file?
- A. Only implicit dependencies are stored in state file.
- B. No dependency information is stored in state file.
- C. Only explicit dependencies are stored in state file.
- D. Both implicit and explicit dependencies are stored in state file.
正解:D
解説:
Explanation
Terraform state captures all dependency information, both implicit and explicit. One purpose for state is to
determine the proper order to destroy resources. When resources are created all of their dependency
information is stored in the state. If you destroy a resource with dependencies, Terraform can still determine
the correct destroy order for all other resources because the dependencies are stored in the state.
https://www.terraform.io/docs/state/purpose.html#metadata
質問 # 32
You have provisioned some aws resources in your test environment through Terraform for a POC work. After
the POC, now you want to destroy the resources but before destroying them you want to check what resources
will be getting destroyed through terraform. what are the options of doing that? (Select TWO)
- A. Use terraform plan command
- B. Use terraform destroy command
- C. Use terraform plan -destroy command.
- D. This is not possible
正解:B、C
解説:
Explanation
https://learn.hashicorp.com/terraform/getting-started/destroy
質問 # 33
What is a key benefit of the Terraform state file?
- A. A state file represents the desired state expressed by the Terraform code files
- B. A state file represents a source of truth for resources provisioned with a public cloud console
- C. A state file represents a source of truth for resources provisioned with Terraform
正解:A
解説:
D A state file can be used to schedule recurring infrastructure tasks
質問 # 34
Which of the following is not a way to trigger terraform destroy ?
- A. Passing ---destroy at the end of apian request
- B. Using the destroy command with auto approve
- C. Delete the state file and run terraform apply
- D. Running terraform destroy from the correct directory and then typing "yes" when prompted in the CLI
正解:A
質問 # 35
Which of the following state management command allow you to retrieve a list of resources that are part of the state file?
- A. terraform view
- B. terraform list
- C. terraform state view
- D. terraform state list
正解:D
解説:
The terraform state list command is used to list resources within a Terraform state.
Usage: terraform state list [options] [address...]
The command will list all resources in the state file matching the given addresses (if any). If no addresses are given, all resources are listed.
https://www.terraform.io/docs/commands/state/list.html
質問 # 36
A colleague has informed you that a new version of a Terraform module that your team hosts on an Amazon S3 bucket is broken. The Amazon S3 bucket has versioning enabled. Your colleague tells you to make sure you are not using the latest version in your configuration. You have the following configuration block in your code that refers to the module:
module "infranet" { source = "s3::https://s3-us-west-2.amazonaws.com/infrabucket/infra_module.zip"} What is the best way to ensure that you are not using the latest version of the module?
- A. Add a module version constraint in your configuration's backend block and specify a previous version.
- B. Add a version property to the module in Terraform's state file and specify a previous version.
- C. Delete the latest version of the module in S3 to rollback to the previous version.
- D. Add a version key to the module configuration and specify a previous version.
正解:C
解説:
Explanation
Version constraints are supported only for modules installed from a module registry, such as the Terraform Registry or Terraform Cloud's private module registry. Other module sources can provide their own versioning mechanisms within the source string itself, or might not support versions at all. In particular, modules sourced from local file paths do not support version; since they're loaded from the same source repository.
Only Terraform Registries support module versioning by using the version key, one cannot configure a previous version of the module in the configuration. Deleting the latest version of the module in S3 is the only option of the available options that ensures you won't use the latest version. You could also modify the source URL to specify a versionId URL parameter for a previous version.
https://www.terraform.io/docs/configuration/modules.html#source
質問 # 37
Which of the following clouds does not have a provider maintained HashiCorp?
- A. IBM Cloud
- B. AWS
- C. DigitalOcean
- D. OpenStack
正解:A
解説:
IBM Cloud does not have a provider maintained by HashiCorp, although IBM Cloud does maintain their own Terraform provider.
https://www.terraform.io/docs/providers/index.html
質問 # 38
......
Hashicorp TA-002 Pertification試験は、グローバルに認識されているベンダー中立認証です。この認定は、テラフォームを使用してインフラストラクチャのプロビジョニングと展開を自動化する際の候補者のスキルと知識を検証します。この認定は、クラウドインフラストラクチャ管理、DevOps、またはソフトウェアエンジニアリングでキャリアを促進しようとしているIT専門家を対象としています。この認定は、インフラストラクチャの自動化と管理でベストプラクティスを実装できる熟練した専門家を雇おうとしている組織にも役立ちます。
HashiCorp TA-002-Pリアルな2024年最新のブレーン問題集で模擬試験問題集:https://jp.fast2test.com/TA-002-P-premium-file.html