
[2024年05月07日]Fast2test TA-002-P問題集でHashiCorp Infrastructure Automation合格確定させる練習問題集
HashiCorp TA-002-P実際にある問題とブレーン問題集
TA-002-P試験は、60問の多肢選択問題から構成され、90分の試験時間があります。この試験は、Terraformの基礎、構成構文、リソース管理、モジュール作成、およびリモートステート管理など幅広いトピックをカバーしています。この試験は、英語、日本語、簡体字中国語など複数の言語で利用できます。
質問 # 45
State locking does not happen automatically and must be specified at run
- A. True
- B. False
正解:B
解説:
State locking happens automatically on all operations that could write state.
https://www.terraform.io/docs/state/locking.html
質問 # 46
Jack is a newbieto Terraform and wants to enable detailed logging to find all the details. Which environment variable does he need to set?
- A. TF_help
- B. TF_var_log
- C. TF LOG
- D. TF_Debug
正解:C
質問 # 47
A terraform apply can not _________ infrastructure.
- A. destroy
- B. change
- C. provision
- D. import
正解:D
解説:
Explanation
https://www.educative.io/answers/what-is-the-command-to-destroy-infrastructure-in-terraform
質問 # 48
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 taint
- B. terraform apply
- C. terraform refresh
- D. terraform graph
正解:A
解説:
Explanation
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
質問 # 49
Which of the following type of variable allows multiple values of several distinct types to be grouped together as a single value?
- A. List
- B. Object
- C. Map
- D. Tuple
正解:B、D
解説:
Structural type of variable allows multiple values of several distinct types to be grouped together as a single value. They require a schema as an argument, to specify which types are allowed for which elements.
https://www.terraform.io/docs/configuration/types.html
質問 # 50
Which of the following clouds does not have a provider maintained HashiCorp?
- A. AWS
- B. IBM Cloud
- C. DigitalOcean
- D. OpenStack
正解:B
解説:
Explanation
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
質問 # 51
Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
- A. Reduces risk of operator error
- B. Provisions the same resources at a lower cost
- C. Lets you version, reuse, and share infrastructure configuration
- D. Prevents manual modifications to your resources
- E. Secures your credentials
正解:A、C
解説:
It lets you version, reuse, and share infrastructure configuration as code files, which can be stored in a source control system and integrated with your CI/CD pipeline.
It reduces risk of operator error by automating repetitive tasks and ensuring consistency across environments. IaC does not necessarily provision resources at a lower cost, secure your credentials, or prevent manual modifications to your resources - these depend on other factors such as your cloud provider, your security practices, and your access policies.
質問 # 52
Terraform requires the Go runtime as a prerequisite for installation.
- A. True
- B. False
正解:B
解説:
Reference: https://www.terraform.io/docs/extend/guides/v1-upgrade-guide.html
質問 # 53
Terraform Enterprise (also referred to as pTFE) requires what type of backend database for a clustered
deployment?
- A. MySQL
- B. MSSQL
- C. Cassandra
- D. PostgreSQL
正解:D
解説:
Explanation
External Services mode stores the majority of the stateful data used by the instance in an external PostgreSQL
database and an external S3-compatible endpoint or Azure blob storage. There is still critical data stored on the
instance that must be managed with snapshots. Be sure to check the PostgreSQL Requirements for information
that needs to be present for Terraform Enterprise to work. This option is best for users with expertise
managing PostgreSQL or users that have access to managed PostgreSQL offerings like AWS RDS.
質問 # 54
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
質問 # 55
What is the purpose of using the local-exec provisioner? (Select Two)
- A. Ensures that the resource is only executed in the local infrastructure where Terraform is deployed.
- B. To invoke a local executable.
- C. To execute one or more commands on the machine running Terraform.
- D. Executes a command on the resource to invoke an update to the Terraform state.
正解:B、C
解説:
Explanation
The local-exec provisioner invokes a local executable after a resource is created. This invokes a process on the
machine running Terraform, not on the resource.
Note that even though the resource will be fully created when the provisioner is run, there is no guarantee that
it will be in an operable state - for example system services such as sshd may not be started yet on compute
resources.
Example usage
resource "aws_instance" "web" {
# ...
provisioner "local-exec" {
command = "echo ${aws_instance.web.private_ip} >> private_ips.txt"
}
}
Note: Provisioners should only be used as a last resort. For most common situations there are better
alternatives.
https://www.terraform.io/docs/provisioners/local-exec.html
質問 # 56
Every region in AWS has a different AMI ID for Linux and these are keep on changing. What is the best approach to create the EC2 instances that can deal with different AMI IDs based on regions?
- A. Create different configuration file for different region.
- B. Create a map of region to ami id.
- C. None of the above
- D. Use data source aws_ami.
正解:D
解説:
https://www.terraform.io/docs/configuration/data-sources.html
質問 # 57
You have created two workspaces PROD and DEV. You have switched to DEV and provisioned DEV
infrastructure from this workspace. Where is your state file stored?
- A. terraform.tfstate
- B. terraform.d
- C. terraform.tfstate.DEV
- D. terraform.tfstate.d
正解:D
解説:
Explanation
Terraform stores the workspace states in a directory called terraform.tfstate.d. This directory should be treated
similarly to default workspace state file terraform.tfstate
main.tf
provider.tf
terraform.tfstate.d
DEV
terraform.tfstate # DEV workspace state file
PROD
terraform.tfstate # PROD workspace state file
terraform.tfvars # Default workspace state file
variables.tf
質問 # 58
Matt wants to import a manually created EC2 instance into terraform so that he can manage the EC2 instance through terraform going forward. He has written the configuration file of the EC2 instance before importing it to Terraform. Following is the code:
resource "aws_instance" "matt_ec2" { ami = "ami-bg2640de" instance_type = "t2.micro" vpc_security_group_ids = ["sg-6ae7d613", "sg-53370035"] key_name = "mysecret" subnet_id =
"subnet-9e3cfbc5" }
The instance id of that EC2 instance is i-0260835eb7e9bd40 How he can import data of EC2 to state file?
- A. terraform import aws_instance.i-0260835eb7e9bd40
- B. terraform import aws_instance.matt_ec2 i-0260835eb7e9bd40
- C. terraform import aws_instance.id = i-0260835eb7e9bd40
- D. terraform import i-0260835eb7e9bd40
正解:B
解説:
Explanation
https://www.terraform.io/docs/import/usage.html
質問 # 59
Your configuration file has been locked accidentally. What of the following command would you use to
unlock?
- A. terraform force-unlock
- B. delete the file and create a new state file
- C. state.tf-unlock
- D. terraform filename-unlock
正解:A
質問 # 60
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
質問 # 61
John wants to use two different regions to deploy two different EC2 instances. He has specified two provider blocks in his providers.tf file.
provider "aws" { region = "us-east-1" }
provider "aws" { region = "us-west-2" }
When he run terraform plan he encountered an error. How to fix this?
- A. Use alias for region = "us-west-2"
- B. It can not be fixed
- C. Use default keyword with region = "us-east-1"
- D. Use another provider version
正解:A
質問 # 62
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.
- A. True
- B. False
正解:A
解説:
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform init3. This will ensure that you use the same provider versions across different machines and runs.
質問 # 63
What does the command terraform fmt do?
- A. Updates the font of the configuration file to the official font supported by HashiCorp.
- B. Rewrite Terraform configuration files to a canonical format and style.
- C. Formats the state file in order to ensure the latest state of resources can be obtained.
- D. Deletes the existing configuration file.
正解:B
解説:
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.
Other Terraform commands that generate Terraform configuration will produce configuration files that conform to the style imposed by terraform fmt, so using this style in your own files will ensure consistency.
https://www.terraform.io/docs/commands/fmt.html
質問 # 64
Jim has created several AWS resources from a single terraform configuration file. Someone from his team has manually modified one of the EC2 instance.
Now to discard the manual change, Jim wants to destroy and recreate the EC2 instance. What is the best way to do it?
- A. terraform taint
- B. terraform recreate
- C. terraform refresh
- D. terraform destroy
正解:A
解説:
Explanation
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
質問 # 65
Which of the following arguments are required when declaring a Terraform output?
- A. sensitive
- B. description
- C. default
- D. value
正解:D
質問 # 66
......
TA-002-P認定試験は60の複数選択の質問で構成されており、候補者は試験を完了するために90分を与えられます。この試験は、英語、日本語、簡素化された中国語、スペイン語で入手できます。試験に合格する候補者には、2年間有効なハシコープ認定:Terraform Associate認定が授与されます。この認定は、IT専門家がテラフォームに関する専門知識を実証し、潜在的な雇用主にスキルを示す優れた方法です。
TA-002試験では、Terraformの基礎、コード概念などのインフラストラクチャ、Terraformワークフロー、Terraformモジュール、Terraformプロバイダーなどのトピックをカバーしています。候補者は、Terraformの構成を書き、計画、適用する能力、およびTerraformの状態管理、リソースの依存関係、およびリモートバックエンドの理解について評価されます。この試験は、候補者の実践的なスキルと知識をテストするように設計されており、記憶に基づいた試験ではありません。
最新TA-002-P合格保証 試験問題集でには正確で最新な 問題:https://jp.fast2test.com/TA-002-P-premium-file.html