تدرب على 60 سؤالًا أصليًا لـ HashiCorp Terraform Associate تغطي المفاهيم الأساسية وإدارة الحالة والموارد والمزودين والوحدات وTerraform Cloud وCLI، مع الإجابات والشروح.
المستوى: HashiCorp Terraform Associateالصعوبة: intermediate60 سؤال60 دقيقة
اختر وضع التدريب وأجب عن كل سؤال من أسئلة Terraform Associate ثم راجع الشرح. تُحفظ الأخطاء محليًا للمراجعة.
أيام متتالية: 0 أياممحفوظ على هذا الجهاز فقط
التقدم0 / 60
الوقت المتبقي: 00:00
لا توجد أخطاء محفوظة بعد.
لا توجد أسئلة تطابق عوامل التصفية.
سؤال 1
What is Terraform?
Terraform is an infrastructure as code tool that lets you define and manage cloud resources declaratively. It is not a database, web server, or monitoring agent.
سؤال 2
What is infrastructure as code?
Infrastructure as code means defining and provisioning infrastructure through version-controlled configuration files. This makes changes repeatable and auditable.
سؤال 3
What does HCL stand for?
HCL is the HashiCorp Configuration Language used by Terraform. It is designed to be readable by humans and machines.
سؤال 4
What is a provider in Terraform?
A provider is a plugin that translates Terraform configuration into API calls for a specific platform such as AWS, Azure, or GCP.
سؤال 5
What is a resource in Terraform?
A resource is an infrastructure object such as a virtual machine, network, or database that Terraform creates and manages.
سؤال 6
What is a data source in Terraform?
A data source lets Terraform read information from existing infrastructure without creating or changing it.
سؤال 7
What does terraform plan do?
terraform plan compares the configuration with current state and shows what will be created, changed, or destroyed without applying it.
سؤال 8
What does terraform apply do?
terraform apply executes the changes needed to make real infrastructure match the configuration. It should usually follow a plan.
سؤال 9
What does terraform destroy do?
terraform destroy removes the resources managed by the current configuration. It is destructive and should be used carefully.
سؤال 10
What does terraform init do?
terraform init prepares the working directory by downloading providers and modules and configuring the backend. It is usually the first command.
سؤال 11
What does terraform validate do?
terraform validate checks whether configuration is syntactically valid and internally consistent without contacting providers, which helps catch errors before planning or applying changes.
سؤال 12
What does terraform fmt do?
terraform fmt rewrites .tf files using Terraform canonical formatting. It does not change infrastructure or state.
سؤال 13
What is a variable in Terraform?
Variables let users pass values into configuration, such as region or instance size. They make modules reusable.
سؤال 14
What is an output in Terraform?
Outputs expose selected values from applied infrastructure, such as IP addresses or endpoint URLs, to users or other modules.
سؤال 15
Terraform configuration is declarative.
This statement is true. Terraform declares the desired end state, and Terraform figures out how to reach it. This is different from imperative scripts.
سؤال 16
The Terraform configuration language is called ___.
Terraform uses HCL, the HashiCorp Configuration Language, to define infrastructure. HCL files usually have .tf extensions.
سؤال 17
What does a provider configuration define?
A provider block tells Terraform which provider plugin to use and includes settings such as region and credentials.
سؤال 18
What is a dependency graph?
Terraform builds a dependency graph from references between resources and uses it to determine creation and update order.
سؤال 19
What does terraform refresh do?
terraform refresh reads the actual infrastructure and updates the state file without changing resources. Modern versions refresh during plan and apply.
سؤال 20
What is a resource address?
A resource address such as aws_instance.web identifies a resource uniquely so commands like plan, apply, and state can target it.
سؤال 21
What is Terraform state?
Terraform state maps configuration to real-world resources. It stores resource metadata and is essential for planning and updates.
سؤال 22
Where can Terraform state be stored?
State can be stored locally in terraform.tfstate or remotely in a backend such as Terraform Cloud, S3, or Azure Storage.
سؤال 23
What is a backend in Terraform?
A backend defines where state is stored and how locking works. Remote backends are important for team collaboration.
سؤال 24
What is state locking?
State locking prevents two Terraform operations from modifying the same state at the same time, reducing conflicts.
سؤال 25
How are sensitive values stored in state by default?
Sensitive values such as passwords can appear in plaintext in state files. You should use secure backends and avoid committing state.
سؤال 26
What is remote state?
Remote state stores the state file in a shared backend, enabling team collaboration and centralized locking.
سؤال 27
What does terraform state list do?
terraform state list shows the resource addresses currently tracked in the state file. It is useful for confirming which resources are managed before planning changes.
سؤال 28
What does terraform state show do?
terraform state show displays the attributes of a specific resource as recorded in state. This is useful when inspecting a single resource without running a plan.
سؤال 29
What does count do in a resource block?
count creates a fixed number of resource instances from one block. for_each is a more flexible alternative.
سؤال 30
What does for_each do?
for_each iterates over a map or set of strings to create resource instances. It is more flexible than count.
سؤال 31
What is depends_on used for?
depends_on forces Terraform to create one resource before another when the dependency is not automatic.
سؤال 32
What is a lifecycle block used for?
A lifecycle block includes settings such as create_before_destroy, prevent_destroy, and ignore_changes. These settings control how Terraform replaces and updates resources.
سؤال 33
What does create_before_destroy do?
create_before_destroy builds the new resource before removing the old one, which helps reduce downtime during replacement.
سؤال 34
What is a provisioner?
Provisioners execute scripts or configuration steps on local or remote machines after a resource is created.
سؤال 35
Which provisioner runs commands on the local machine?
local-exec runs a command on the machine where Terraform runs. remote-exec runs commands on a remote resource.
سؤال 36
Which provisioner runs commands on a remote resource?
remote-exec connects to the created resource and runs commands there. local-exec runs on the Terraform host.
سؤال 37
State files can contain sensitive values.
This statement is true. State files can store sensitive attribute values, so secure backends and access controls are important.
سؤال 38
Every backend automatically supports state locking.
This statement is false. Not all backends support locking. Backends such as S3 with DynamoDB or Terraform Cloud provide locking.
سؤال 39
The command to list resources in state is terraform state ___.
terraform state list prints resource addresses from state. Other subcommands include show, mv, rm, and pull.
سؤال 40
What does the configuration represent?
Terraform configuration declares the desired end state. Terraform compares it with real resources to plan changes.
سؤال 41
What is a Terraform module?
A module is a reusable container of Terraform configuration. Modules can be called from other configurations and the registry.
سؤال 42
What is the root module?
The root module is the configuration in the working directory where Terraform runs. Child modules are called from it.
سؤال 43
What are module inputs?
Module inputs are variables defined in the child module and set by the calling configuration.
سؤال 44
What are module outputs?
Module outputs expose selected values so the calling configuration can use them, such as endpoint URLs or IDs.
سؤال 45
Where can modules be sourced from?
Modules can come from local directories, the Terraform Registry, Git repositories, HTTP URLs, and other sources.
سؤال 46
What is the Terraform Registry?
The Terraform Registry is a public repository where users can find and publish reusable providers and modules.
سؤال 47
What is module versioning?
Module versioning uses tags such as v1.0.0 so callers can pin a specific version and receive controlled updates.
سؤال 48
What is a workspace in Terraform?
Workspaces allow multiple named states for the same configuration, which is useful for environments such as dev and prod.
سؤال 49
What is Terraform Cloud?
Terraform Cloud provides remote runs, state storage, variable management, and collaboration features for Terraform. It is used by teams to run infrastructure changes in a controlled way.
سؤال 50
What is a run in Terraform Cloud?
A run represents the process of planning and applying changes to infrastructure for a Terraform Cloud workspace.
سؤال 51
Where are variables stored in Terraform Cloud?
Terraform Cloud stores variables in workspaces, and they can be marked sensitive so they are hidden after saving.
سؤال 52
What does terraform import do?
terraform import attaches an existing real-world resource to a resource block in configuration so Terraform can manage it.
سؤال 53
What does terraform output do?
terraform output shows the values of outputs after apply, which is useful for scripts and integrations.
سؤال 54
What is a run trigger?
Run triggers in Terraform Cloud start a workspace run when another workspace completes or a source changes.
سؤال 55
Modules can be reused across projects.
This statement is true. Modules are designed for reuse across projects and teams, reducing duplicated configuration.
سؤال 56
terraform plan can save an execution plan file.
This statement is true. terraform plan -out=plan.tfplan saves a plan that can be applied later with terraform apply plan.tfplan.
سؤال 57
Workspaces are commonly used to manage multiple environments.
This statement is true. Workspaces keep separate state for environments such as development, staging, and production.
سؤال 58
Terraform Cloud stores state remotely by default.
This statement is true. Terraform Cloud uses a remote backend for state and provides locking and version history.
سؤال 59
The command to initialize a working directory is terraform ___.
terraform init installs providers, downloads modules, and configures the backend. It should be run before plan and apply.
سؤال 60
What does terraform destroy -target do?
-target limits an operation to a specific resource or module. terraform destroy -target=aws_instance.web removes only that resource.