最新の無料Terraform-Associate-003効率的問題集をダウンロード2024年10月27日更新された178問がある [Q37-Q59]

Share

最新の無料Terraform-Associate-003効率的問題集をダウンロード2024年10月27日更新された178問がある

HashiCorp Terraform-Associate-003試験練習テスト解答


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

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

 

質問 # 37
Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.

  • A. Plan
  • B. Alidate
  • C. Init
  • D. Import
  • E. apply

正解:C、E

解説:
Explanation
The two steps that are required to provision new infrastructure in the Terraform workflow are init and apply.
The terraform init command initializes a working directory containing Terraform configuration files. It downloads and installs the provider plugins that are needed for the configuration, and prepares the backend for storing the state. The terraform apply command applies the changes required to reach the desired state of the configuration, as described by the resource definitions in the configuration files. It shows a plan of the proposed changes and asks for confirmation before making any changes to the infrastructure. References =
[The Core Terraform Workflow], [Initialize a Terraform working directory with init], [Apply Terraform Configuration with apply]


質問 # 38
How would you output returned values from a child module in the Terraform CLI output?

  • A. Declare the output in both the root and child module
  • B. Declare the output in the child module
  • C. Declare the output in the root configuration
  • D. None of the above

正解:A

解説:
To output returned values from a child module in the Terraform CLI output, you need to declare the output in both the child module and the root module. The child module output will return the value to the root module, and the root module output will display the value in the CLI. Reference = [Terraform Outputs]


質問 # 39
What is the workflow for deploying new infrastructure with Terraform?

  • A. Write Terraform configuration, run terraform plan to initialize the working directory or workspace, and terraform apply to create the infrastructure
  • B. Write Terraform configuration, run terraform init to initialize the working directory or workspace, and run terraform apply
  • C. Write Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure
  • D. Write Terraform configuration, run terraform apply to create infrastructure, use terraform validate to confirm Terraform deployed resources correctly

正解:B

解説:
This is the workflow for deploying new infrastructure with Terraform, as it will create a plan and apply it to the target environment. The other options are either incorrect or incomplete.


質問 # 40
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?

  • A. Terraform state list
  • B. Terraform state list provider_type_name
  • C. Terraform state show ' provider_type_name
  • D. Terraform get provider_type_name

正解:C

解説:
Explanation
This is the command that you would use to access all of the attributes and details of a resource managed by Terraform, by providing the resource address as an argument. For example, terraform state show
'aws_instance.example' will show you all the information about the AWS instance named example.


質問 # 41
Terraform configuration can only import modules from the public registry.

  • A. False
  • B. True

正解:A

解説:
Terraform configuration can import modules from various sources, not only from the public registry. Modules can be sourced from local file paths, Git repositories, HTTP URLs, Mercurial repositories, S3 buckets, and GCS buckets. Terraform supports a number of common conventions and syntaxes for specifying module sources, as documented in the [Module Sources] page. Reference = [Module Sources]


質問 # 42
Where does the Terraform local backend store its state?

  • A. In the terraform,tfstate file
  • B. In the terraform file
  • C. In the /tmp directory
  • D. In the user's terraform,state file

正解:A

解説:
Explanation
This is where the Terraform local backend stores its state, by default, unless you specify a different file name or location in your configuration. The local backend is the simplest backend type that stores the state file on your local disk.


質問 # 43
Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?

  • A. terraform init
  • B. terraform apply
  • C. terraform destroy, then terraform apply
  • D. terraform push

正解:C


質問 # 44
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

解説:
Explanation
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]


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

  • A. False
  • B. True

正解:B

解説:
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. Reference = : Debugging Terraform


質問 # 46
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.

  • A. False
  • B. True

正解:B

解説:
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.


質問 # 47
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. Terraform code
  • D. State file
  • E. Cloud infrastructure Most Voted

正解:D、E

解説:
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


質問 # 48
You ate making changes to existing Terraform code to add some new infrastructure. When is the best time to run terraform validate?

  • A. After you run terraform apply so you can validate your infrastructure
  • B. Before you run terraform plan so you can validate your code syntax
  • C. Before you run terraform apply so you can validate your provider credentials
  • D. After you run terraform plan so you can validate that your state file is consistent with your infrastructure

正解:B

解説:
Explanation
This is the best time to run terraform validate, as it will check your code for syntax errors, typos, and missing arguments before you attempt to create a plan. The other options are either incorrect or unnecessary.


質問 # 49
Which are forbidden actions when the terraform state file is locked? Choose three correct answers.

  • A. Terraform validate
  • B. Terraform validate
  • C. Terraform state list
  • D. Terraform apply
  • E. Terraform for
  • F. Terraform destroy

正解:B、D、F

解説:
The terraform state file is locked when a Terraform operation that could write state is in progress. This prevents concurrent state operations that could corrupt the state. The forbidden actions when the state file is locked are those that could write state, such as terraform apply, terraform destroy, terraform refresh, terraform taint, terraform untaint, terraform import, and terraform state *. The terraform validate command is also forbidden, because it requires an initialized working directory with the state file. The allowed actions when the state file is locked are those that only read state, such as terraform plan, terraform show, terraform output, and terraform console. Reference = [State Locking] and [Command: validate]


質問 # 50
Which provider authentication method prevents credentials from being stored in the state file?

  • A. None of the above
  • B. Specifying the login credentials in the provider block
  • C. Using environment variables
  • D. Setting credentials as Terraform variables

正解:A

解説:
Explanation
None of the above methods prevent credentials from being stored in the state file. Terraform stores the provider configuration in the state file, which may include sensitive information such as credentials. This is a potential security risk and should be avoided if possible. To prevent credentials from being stored in the state file, you can use one of the following methods:
Use environment variables to pass credentials to the provider. This way, the credentials are not part of the provider configuration and are not stored in the state file. However, this method may not work for some providers that require credentials to be set in the provider block.
Use dynamic credentials to authenticate with your cloud provider. This way, Terraform Cloud or Enterprise will request temporary credentials from your cloud provider for each run and use them to provision your resources. The credentials are not stored in the state file and are revoked after the run is completed. This method is supported for AWS, Google Cloud Platform, Azure, and Vault. References : [Sensitive Values in State] : Authenticate providers with dynamic credentials


質問 # 51
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. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed
  • C. Designate one person in each team to review and format everyone's code
  • 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


質問 # 52
What value does the Terraform Cloud private 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 Cloud Organizations
  • C. The ability to restrict modules to members of Terraform Cloud or Enterprise organizations
  • D. The ability to tag modules by version or release

正解:C

解説:
The Terraform Cloud private registry provides the ability to restrict modules to members of Terraform Cloud or Enterprise organizations. This allows you to share modules within your organization without exposing them to the public. The private registry also supports importing modules from your private VCS repositories. The public Terraform Module Registry, on the other hand, publishes modules from public Git repositories and makes them available to any user of Terraform. References = : Private Registry - Terraform Cloud : Terraform Registry - Provider Documentation


質問 # 53
Which Terraform collection type should you use to store key/value pairs?

  • A. Tuple
  • B. Map
  • C. list
  • D. Set

正解:B

解説:
Explanation
The Terraform collection type that should be used to store key/value pairs is map. A map is a collection of values that are accessed by arbitrary labels, called keys. The keys and values can be of any type, but the keys must be unique within a map. For example, var = { key1 = "value1", key2 = "value2" } is a map with two key/value pairs. Maps are useful for grouping related values together, such as configuration options or metadata. References = [Collection Types], [Map Type Constraints]


質問 # 54
You can access state stored with the local backend by using terraform_remote_state data source.

  • A. False
  • B. True

正解:A

解説:
You cannot access state stored with the local backend by using the terraform_remote_state data source. The terraform_remote_state data source is used to retrieve the root module output values from some other Terraform configuration using the latest state snapshot from the remote backend. It requires a backend that supports remote state storage, such as S3, Consul, AzureRM, or GCS. The local backend stores the state file locally on the filesystem, which terraform_remote_state cannot access.
Reference:
Terraform documentation on terraform_remote_state data source: Terraform Remote State Data Source Example usage of remote state: Example Usage (remote Backend)


質問 # 55
All standard backend types support state locking, and remote operations like plan, apply, and destroy.

  • A. False
  • B. True

正解:A

解説:
Not all standard backend types support state locking and remote operations like plan, apply, and destroy. For example, the local backend does not support remote operations and state locking. State locking is a feature that ensures that no two users can make changes to the state file at the same time, which is crucial for preventing race conditions. Remote operations allow running Terraform commands on a remote server, which is supported by some backends like remote or consul, but not all.
Reference:
Terraform documentation on backends: Terraform Backends
Detailed backend support: Terraform Backend Types


質問 # 56
You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully. What should you do to delete the newly-created VM with Terraform?

  • A. The Terraform state file only contains the one new VM. Execute terraform destroy.
  • B. Delete the Terraform state file and execute terraform apply.
  • C. The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
  • D. Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.

正解:A

解説:
This is the best way to delete the newly-created VM with Terraform, as it will only affect the resource that was created by your configuration and state file. The other options are either incorrect or inefficient.


質問 # 57
You have deployed a new webapp with a public IP address on a cloud 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. 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
  • 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. Run terraform output ip_address to view the result

正解:C

解説:
This is a quick way to inspect the state file and find the information you need without modifying anything5. The other options are either incorrect or inefficient.


質問 # 58
Which of these is true about Terraform's plugin-based architecture?

  • A. All providers are part of the Terraform core binary
  • B. Terraform can only source providers from the internet
  • C. Every provider in a configuration has its own state file for its resources
  • D. You can create a provider for your API if none exists

正解:D

解説:
Terraform is built on a plugin-based architecture, enabling developers to extend Terraform by writing new plugins or compiling modified versions of existing plugins1. Terraform plugins are executable binaries written in Go that expose an implementation for a specific service, such as a cloud resource, SaaS platform, or API2. If there is no existing provider for your API, you can create one using the Terraform Plugin SDK3 or the Terraform Plugin Framework4. Reference =
* 1: Plugin Development - How Terraform Works With Plugins | Terraform | HashiCorp Developer
* 2: Lab: Terraform Plug-in Based Architecture - GitHub
* 3: Terraform Plugin SDK - Terraform by HashiCorp
* 4: HashiCorp Terraform Plugin Framework Now Generally Available


質問 # 59
......

最新の検証済みTerraform-Associate-003問題集と解答合格保証もしくは全額返金です:https://jp.fast2test.com/Terraform-Associate-003-premium-file.html

最新の認証試験Terraform-Associate-003問題集練習テスト解答はこちら:https://drive.google.com/open?id=1GAFtQcMGQZV6Y457W5Nz35Qk9S-7lNXg


弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

我々の働いている時間: ( GMT 0:00-15:00 )
月曜日から土曜日まで

サポート: 現在連絡 

English Deutsch 繁体中文 한국어