正真正銘のベスト試験材料はTerraform-Associate-003テストエンジン練習試験合格させます
[2024年更新]Terraform-Associate-003のPDF問題、完璧に練習問題で合格
HashiCorp Terraform-Associate-003 認定試験の出題範囲:
| トピック | 出題範囲 |
|---|---|
| トピック 1 |
|
| トピック 2 |
|
| トピック 3 |
|
| トピック 4 |
|
質問 # 20
How is terraform import run?
- A. As a part of terraform refresh
- B. All of the above
- C. As a part of terraform plan
- D. By an explicit call
- E. As a part of terraform init
正解:D
解説:
Explanation
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]
質問 # 21
Which of the following are advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
- A. Lets you version, reuse, and share infrastructure configuration
- B. Prevents manual modifications to your resources
- C. Secures your credentials
- D. Reduces risk of operator error
- E. Provisions the same resources at a lower cost
正解:A、D
解説:
Infrastructure as code (IaC) is a way of managing and provisioning cloud infrastructure using programming techniques instead of manual processes1. IaC has many advantages over using a graphical user interface (GUI) for provisioning infrastructure, such as:
* Versioning: IaC allows you to store your infrastructure configuration in a version control system, such as Git, and track changes over time. This enables you to roll back to previous versions, compare differences, and collaborate with other developers2.
* Reusability: IaC allows you to create reusable modules and templates that can be applied to different environments, such as development, testing, and production. This reduces duplication, improves consistency, and speeds up deployment3.
* Sharing: IaC allows you to share your infrastructure configuration with other developers, teams, or organizations, and leverage existing code from open source repositories or registries. This fosters best practices, innovation, and standardization4.
* Risk reduction: IaC reduces the risk of human error, configuration drift, and security breaches that can occur when provisioning infrastructure manually or using a GUI. IaC also enables you to perform automated testing, validation, and compliance checks on your infrastructure before deploying it5.
Reference =
* 1: What is Infrastructure as Code? Explained for Beginners - freeCodeCamp.org
* 2: The benefits of Infrastructure as Code - Microsoft Community Hub
* 3: Infrastructure as Code : Best Practices, Benefits & Examples - Spacelift
* 4: 5 Benefits of Infrastructure as Code (IaC) for Modern Businesses in the Cloud
* 5: The 7 Biggest Benefits of Infrastructure as Code - DuploCloud
質問 # 22
_______backends support state locking.
- A. No
- B. Some
- C. Only local
- D. All
正解:B
解説:
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.
質問 # 23
Variables declared within a module are accessible outside of the module.
- A. True
- B. False
正解:B
解説:
Explanation
Variables declared within a module are only accessible within that module, unless they are explicitly exposed as output values1.
質問 # 24
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
解説:
Explanation
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.
質問 # 25
Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest.
How can Terraform Cloud automatically and proactively enforce this security control?
- A. With an S3 module with proper settings for buckets
- B. With a Sentinel policy, which runs before every apply
- C. Auditing cloud storage buckets with a vulnerability scanning tool
- D. By adding variables to each Terraform Cloud workspace to ensure these settings are always enabled
正解:B
解説:
Explanation
The best way to automatically and proactively enforce the security control that new AWS S3 buckets must be private and encrypted at rest is with a Sentinel policy, which runs before every apply. Sentinel is a policy as code framework that allows you to define and enforce logic-based policies for your infrastructure. Terraform Cloud supports Sentinel policies for all paid tiers, and can run them before any terraform plan or terraform apply operation. You can write a Sentinel policy that checks the configuration of the S3 buckets and ensures that they have the proper settings for privacy and encryption, and then assign the policy to your Terraform Cloud organization or workspace. This way, Terraform Cloud will prevent any changes that violate the policy from being applied. References = [Sentinel Policy Framework], [Manage Policies in Terraform Cloud], [Write and Test Sentinel Policies for Terraform]
質問 # 26
What type of block is used to construct a collection of nested configuration blocks?
- A. For_each
- B. Dynamic
- C. repeated.
- D. Nesting
正解:B
解説:
This is the type of block that is used to construct a collection of nested configuration blocks, by using a for_each argument to iterate over a collection value and generate a nested block for each element. For example, you can use a dynamic block to create multiple ingress rules for a security group resource.
質問 # 27
How does Terraform determine dependencies between resources?
- A. Terraform requires all dependencies between resources to be specified using the depends_on parameter
- B. Terraform automatically builds a resource graph based on resources provisioners, special meta-parameters, and the stale file (if present}
- C. Terraform requires resource dependencies to be defined as modules and sourced in order
- D. Terraform requires resources in a configuration to be listed m the order they will be created to determine dependencies
正解:B
解説:
This is how Terraform determines dependencies between resources, by using the references between them in the configuration files and other factors that affect the order of operations.
質問 # 28
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. Manually apply two spaces indentation and align equal sign "=" characters in every Terraform file (*.tf)
- B. Run the terraform fmt command during the code linting phase of your CI/CD process Most Voted
- C. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed
- D. Designate one person in each team to review and format everyone's code
正解:B
質問 # 29
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
- A. Before you run terraform Import
- B. After you run terraform import
- C. Terraform will generate the corresponding configuration files for you
- D. You can import infrastructure without corresponding Terraform code
正解:A
解説:
Explanation
You need to write Terraform configuration files for the existing infrastructure that you want to import into Terraform, otherwise Terraform will not know how to manage it. The configuration files should match the type and name of the resources that you want to import.
質問 # 30
When does Sentinel enforce policy logic during a Terraform Cloud run?
- A. Before the apply phase
- B. During the plan phase
- C. After the apply phase
- D. Before the plan phase
正解:A
解説:
Explanation
Sentinel policies are checked after the plan stage of a Terraform run, but before it can be confirmed or the terraform apply is executed3. This allows you to enforce rules on your infrastructure before it is created or modified.
質問 # 31
Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
- A. terraform fmt -check
- B. terraform fmt -list -recursive
- C. terraform fmt -write-false
- D. terraform fmt -check -recursive
正解:D
解説:
This command will check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes, and will return a non-zero exit code if any files need formatting. The other commands will either make changes, list the files that need formatting, or not check the modules.
質問 # 32
Which of the following is not a valid Terraform variable type?
- A. string
- B. list
- C. nap
- D. array
正解:D
解説:
This is not a valid Terraform variable type. The other options are valid variable types that can store different kinds of values2.
質問 # 33
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 destroy, then terraform apply
- C. terraform push
- D. terraform apply
正解:B
解説:
This command will initialize the new backend and prompt you to migrate the existing state file to the new location4. The other commands are not relevant for this task.
質問 # 34
You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.
How will Terraform choose which version of the provider to use?
- A. Terraform will check your state file to determine the provider version to use
- B. Terraform will use the latest version of the provider for the new resource and the version recorded in the lock file to manage existing resources
- C. Terraform will use the version recorded in your lock file
- D. Terraform will use the latest version of the provider available at the time you provision your new resource
正解:C
解説:
Explanation
This is how Terraform chooses which version of the provider to use, when you add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The lock file records the exact version of each provider that was installed in your working directory, and ensures that Terraform will always use the same provider versions until you run terraform init -upgrade to update them.
質問 # 35
A developer accidentally launched a VM (virtual machine) outside of the Terraform workflow and ended up with two servers with the same name. They don't know which VM Terraform manages but do have a list of all active VM IDs.
Which of the following methods could you use to discover which instance Terraform manages?
- A. Update the code to include outputs for the ID of all VMs, then run terraform plan to view the outputs
- B. Use terraform refresh/code to find out which IDs are already part of state
- C. Run terraform taint/code on all the VMs to recreate them
- D. Run terraform state list to find the names of all VMs, then run terraform state show for each of them to find which VM ID Terraform manages
正解:D
解説:
The terraform state list command lists all resources that are managed by Terraform in the current state file1. The terraform state show command shows the attributes of a single resource in the state file2. By using these two commands, you can compare the VM IDs in your list with the ones in the state file and identify which one is managed by Terraform.
質問 # 36
You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.
Which of these is the correct way to define the output value?
- A.

- B.

- C.

- D.

正解:C
質問 # 37
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
- A. Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces
- B. Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to
- C. Only Terraform Cloud organization owners can approve plans in VCS connected workspaces
- D. Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces
正解:B
解説:
This will trigger a run in the Terraform Cloud workspace, which will perform a plan and apply operation on the infrastructure defined by the Terraform configuration files in the VCS repository.
質問 # 38
What is the name of the default file where Terraform stores the state?
正解:
解説:
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.
Terraform.tfstate
Explanation
The name of the default file where Terraform stores the state is terraform.tfstate. This file contains a JSON representation of the current state of the infrastructure managed by Terraform. Terraform uses this file to track the metadata and attributes of the resources, and to plan and apply changes. By default, Terraform stores the state file locally in the same directory as the configuration files, but it can also be configured to store the state remotely in a backend. References = [Terraform State], [State File Format]
質問 # 39
Which command lets you experiment with terraform expressions?
- A. Terraform env
- B. Terraform console
- C. Terraform test
- D. Terraform validate
正解:B
解説:
Explanation
This is the command that lets you experiment with Terraform expressions, by providing an interactive console that allows you to evaluate expressions and see their results. You can use this command to test your expressions before using them in your configuration files.
質問 # 40
You cannot install third party plugins using terraform init.
- A. True
- B. False
正解:B
解説:
You can install third party plugins using terraform init, as long as you specify the plugin directory in your configuration or as a command-line argument. You can also use the terraform providers mirror command to create a local mirror of providers from any source.
質問 # 41
How does Terraform manage most dependencies between resources?
- A. The order that resources appear in Terraform configuration indicates dependencies
- B. Using the depends_on parameter
- C. By defining dependencies as modules and including them in a particular order
- D. Terraform will automatically manage most resource dependencies
正解:D
解説:
Explanation
This is how Terraform manages most dependencies between resources, by using the references between them in the configuration files. For example, if resource A depends on resource B, Terraform will create resource B first and then pass its attributes to resource A.
質問 # 42
How do you specify a module's version when publishing it to the public terraform Module Registry?
- A. Configuration it in the module's Terraform code
- B. The Terraform Module Registry does not support versioning modules
- C. Mention it on the module's configuration page on the Terraform Module Registry
- D. Tag a release in the associated repo
正解:D
解説:
Explanation
This is how you specify a module's version when publishing it to the public Terraform Module Registry, as it uses the tags from your version control system (such as GitHub or GitLab) to identify module versions. You need to use semantic versioning for your tags, such as v1.0.0.
質問 # 43
......
ベスト最新資料はTerraform-Associate-003オンライン練習試験:https://www.passtest.jp/HashiCorp/Terraform-Associate-003-shiken.html
リアル練習Terraform-Associate-003 HashiCorp Certified: Terraform Associate (003)試験知能問題集:https://drive.google.com/open?id=1a45C-lAQmRRTK4GkQlJ2aWV2saZMGlbX