2025年更新のTerraform-Associate-003問題集合格保証付きで合格できます! [Q15-Q37]

Share

2025年更新のTerraform-Associate-003問題集合格保証付きで合格できます!

Terraform-Associate-003試験問題集を試そう!ベストTerraform-Associate-003試験問題トレーニングを提供しています

質問 # 15
Which are examples of infrastructure as code? Choose two correct answers.

  • A. Versioned configuration files
  • B. Change management database records
  • C. Cloned virtual machine images
  • D. Doctor files

正解:A

解説:
Explanation
These are examples of infrastructure as code (IaC), which is a practice of managing and provisioning infrastructure through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.


質問 # 16
What kind of configuration block will create an infrastructure object with settings specified within the block?

  • A. state
  • B. data
  • C. provider
  • D. resource

正解:D

解説:
Explanation
This is the kind of configuration block that will create an infrastructure object with settings specified within the block. The other options are not used for creating infrastructure objects, but for configuring providers, accessing state data, or querying data sources.


質問 # 17
Which of the following is not a valid Terraform variable type?

  • A. list
  • B. nap
  • C. array
  • D. string

正解:C

解説:
This is not a valid Terraform variable type. The other options are valid variable types that can store different kinds of values2.


質問 # 18
Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.

  • A. False
  • B. True

正解:A

解説:
Terraform can manage resource dependencies implicitly or explicitly. Implicit dependencies are created when a resource references another resource or data source in its arguments. Terraform can infer the dependency from the reference and create or destroy the resources in the correct order. Explicit dependencies are created when you use the depends_on argument to specify that a resource depends on another resource or module.
This is useful when Terraform cannot infer the dependency from the configuration or when you need to create a dependency for some reason outside of Terraform's scope. References = : Create resource dependencies : Terraform Resource Dependencies Explained


質問 # 19
Your root module contains a variable named num_servers. Which is the correct way to pass its value to a child module with an input named servers?

  • A. servers = num_servers
  • B. servers = var(num_servers)
  • C. servers = ${var.num_servers}
  • D. servers = var.num_servers

正解:D

解説:
The correct syntax to pass a variable from the root module to a child module is servers = var.num_servers. Terraform uses dot notation to reference variables.
Reference:
Terraform Variables


質問 # 20
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. Designate one person in each team to review and format everyone's code
  • B. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed
  • C. Run the terraform fmt command during the code linting phase of your CI/CD process Most Voted
  • D. Manually apply two spaces indentation and align equal sign "=" characters in every Terraform file (*.tf)

正解:C

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


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

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

正解:B

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


質問 # 22
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.


質問 # 23
One remote backend configuration always maps to a single remote workspace.

  • A. False
  • B. True

正解:B

解説:
The remote backend can work with either a single remote Terraform Cloud workspace, or with multiple similarly-named remote workspaces (like networking-dev and networking-prod). The workspaces block of the backend configuration determines which mode it uses. To use a single remote Terraform Cloud workspace, set workspaces.name to the remote workspace's full name (like networking-prod). To use multiple remote workspaces, set workspaces.prefix to a prefix used in all of the desired remote workspace names. For example, set prefix = "networking-" to use Terraform cloud workspaces with names like networking-dev and networking-prod. This is helpful when mapping multiple Terraform CLI workspaces used in a single Terraform configuration to multiple Terraform Cloud workspaces3. However, one remote backend configuration always maps to a single remote workspace, either by name or by prefix. You cannot use both name and prefix in the same backend configuration, or omit both. Doing so will result in a configuration error3. References = [Backend Type: remote]3


質問 # 24
Which configuration consistency errors does terraform validate report?

  • A. Terraform module isn't the latest version
  • B. A mix of spaces and tabs in configuration files
  • C. Differences between local and remote state
  • D. Declaring a resource identifier more than once

正解:D

解説:
Terraform validate reports configuration consistency errors, such as declaring a resource identifier more than once. This means that the same resource type and name combination isused for multiple resource blocks, which is not allowed in Terraform. For example, resource "aws_instance" "example" {...} cannot be used more than once in the same configuration. Terraform validate does not report errors related to module versions, state differences, or formatting issues, as these are not relevant for checking the configuration syntax and structure. References = [Validate Configuration], [Resource Syntax]


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


質問 # 26
Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?

  • A. A series of commands you enter into a public cloud console
  • B. A sequence of REST requests you pass to a public cloud API endpoint Most Voted
  • C. curl commands manually run from a terminal
  • D. A script that contains a series of public cloud CLI commands

正解:D

解説:
The concept of infrastructure as code (IaC) is to define and manage infrastructure using code, rather than manual processes or GUI tools. A script that contains a series of public cloud CLI commands is an example of IaC, because it uses code to provision resources into a public cloud. The other options are not examples of IaC, because they involve manual or interactive actions, such as running curl commands, sending REST requests, or entering commands into a console. References = [Introduction to Infrastructure as Code with Terraform] and [Infrastructure as Code]


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


質問 # 28
What are some benefits of using Sentinel with Terraform Cloud/Terra form Cloud? Choose three correct answers.

  • A. Policy-as-code can enforce security best practices
  • B. Sentinel Policies can be written in HashiCorp Configuration Language (HCL)
  • C. You can enforce a list of approved AWS AMIs
  • D. You can check out and check in cloud access keys
  • E. You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0.

正解:A、C、E

解説:
These are some of the benefits of using Sentinel with Terraform Cloud/Terraform Enterprise, as they allow you to implement logic-based policies that can access and evaluate the Terraform plan, state, and configuration. The other options are not true, as Sentinel does not manage cloud access keys, and Sentinel policies are written in Sentinel language, not HCL.


質問 # 29
HashiCorp Configuration Language (HCL) supports user-denned functions.

  • A. False
  • B. True

正解:A

解説:
HashiCorp Configuration Language (HCL) does not support user-defined functions. You can only use the built-in functions that are provided by the language. The built-in functions allow you to perform various operations and transformations on values within expressions. The general syntax for function calls is a function name followed by comma-separated arguments in parentheses, such as max(5, 12, 9). You can find the documentation for all of the available built-in functions in the Terraform Registry or the Packer Documentation, depending on which tool you are using.
References = : Functions - Configuration Language | Terraform : Functions - Configuration Language | Packer


質問 # 30
A developer on your team is going lo leaf down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws instant.ubuntu[l] theywould like to keep. What command should they use to tell Terraform to stop managing that specific resource?

  • A. Terraform apply rm:aws_instance.ubuntu[1]
  • B. Terraform plan rm:aws_instance.ubuntu[1]
  • C. Terraform state rm:aws_instance.ubuntu[1]
  • D. Terraform destory rm:aws_instance.ubuntu[1]

正解:C

解説:
To tell Terraform to stop managing a specific resource without destroying it, you can use the terraform state rm command. This command will remove the resource from the Terraform state, which means that Terraform will no longer track or update the corresponding remote object. However, the object will still exist in the remote system and you can later use terraform import to start managing it again in a different configuration or workspace. The syntax for this command is terraform state rm <address>, where <address> is the resource address that identifies the resource instance to remove. For example, terraform state rm aws_instance.ubuntu[1] will remove the second instance of the aws_instance resource named ubuntu from the state. References = : Command: state rm : Moving Resources


質問 # 31
Which of the following is not a valid Terraform collection type?

  • A. Map
  • B. set
  • C. List
  • D. Tree

正解:D

解説:
This is not a valid Terraform collection type, as Terraform only supports three collection types: list, map, and set. A tree is a data structure that consists of nodes with parent-child relationships, which is not supported by Terraform.


質問 # 32
Which of the following module source paths does not specify a remote module?

  • A. Source =''[email protected]:hasicrop/example.git''
  • B. Source = "module/consul''
  • C. Source = ''hasicrop/consul/aws''
  • D. Source = ''githhub.comicrop/example''

正解:B

解説:
The module source path that does not specify a remote module is source = "module/consul". This specifies a local module, which is a module that is stored in a subdirectory of the current working directory. The other options are all examples of remote modules, which are modules that are stored outside of the current working directory and can be accessed by various protocols, such as Git, HTTP, or the Terraform Registry. Remote modules are useful for sharing and reusing code across different configurations and environments. Reference = [Module Sources], [Local Paths], [Terraform Registry], [Generic Git Repository], [GitHub]


質問 # 33
You have used Terraform lo create an ephemeral development environment in the (loud 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 Terraform will delete.
Which command should you use to show all of the resources that mil be deleted? Choose two correct answers.

  • A. Run terraform state rm '
  • B. Run terraform destroy and it will first output all the resource that will be deleted before prompting for approval
  • C. Run terraform show :destroy
  • D. Run terraform plan .destory

正解:B、D

解説:
To see all the resources that Terraform will delete, you can use either of these two commands:
terraform destroy will show the plan of destruction and ask for your confirmation before proceeding. You can cancel the command if you do not want to destroy the resources.
terraform plan -destroy will show the plan of destruction without asking for confirmation. You can use this command to review the changes before running terraform destroy.
References = : Destroy Infrastructure : Plan Command: Options


質問 # 34
Which of these commands makes your code more human readable?

  • A. Terraform validate
  • B. Terraform fmt
  • C. Terraform show
  • D. Terraform output

正解:B

解説:
The command that makes your code more human readable is terraform fmt. This command is used to rewrite Terraform configuration files to a canonical format and style, following the Terraform language style conventions and other minor adjustments for readability. The command is optional, opinionated, and has no customization options, but it is recommended to ensure consistency of style across different Terraform codebases. Consistency can help your team understand the code more quickly and easily, making the use of terraform fmt very important. You can run this command on your configuration files before committing them to source control or as part of your CI/CD pipeline.
References = : Command: fmt : Using Terraform fmt Command to Format Your Terraform Code


質問 # 35
You cannot install third party plugins using terraform init.

  • A. False
  • B. True

正解:A

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


質問 # 36
Which command add existing resources into Terraform state?

  • A. All of these
  • B. Terraform refresh
  • C. Terraform import
  • D. Terraform init
  • E. Terraform plan

正解:C

解説:
Explanation
This is the command that can add existing resources into Terraform state, by matching them with the corresponding configuration blocks in your files.


質問 # 37
......


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

トピック出題範囲
トピック 1
  • Create, maintain, and use Terraform modules: In this section of the exam, candidates are tested for creating a module, using a module in configuration, and topics such as refactoring an existing configuration into modules.
トピック 2
  • Develop and troubleshoot dynamic configuration: This section deals with topics such as using language features to validate configuration query providers using data sources, computing and interpolating data using HCL functions, and using meta-arguments in configuration.
トピック 3
  • Manage resource lifecycle: The section covers topics such as Initializing a configuration using terraform init and its options and generating an execution plan using terraform plan and its options. It also covers the configuration changes using Terraform Apply and its options.
トピック 4
  • Configure and use Terraform providers: In this section, topics covered include understanding Terraform's plugin-based architecture and configuring providers. It also covers aliasing, sourcing, and versioning functions.

 

最新100%合格率保証付きの素晴らしいTerraform-Associate-003試験問題PDF:https://www.passtest.jp/HashiCorp/Terraform-Associate-003-shiken.html

実践サンプルと問題集指導には2025年最新のTerraform-Associate-003有効なテスト問題集:https://drive.google.com/open?id=1zNRcJIAw2CESy4YgVDq7Y5d3ZQaVvIB9