DevOps

Terraform Advanced

Modules, workspaces, remote state, data sources, dynamic blocks, provisioners, drift detection

22 câu hỏi phỏng vấn·
Mid-Level
1

What is a Terraform module?

Câu trả lời

A Terraform module is a reusable container of resources and infrastructure logic. It allows encapsulating a set of related resources and reusing them across different projects or environments. Modules accept input variables and can expose outputs to enable composition and chaining between modules.

2

What is the main difference between a workspace and a module?

Câu trả lời

Workspaces allow managing multiple instances of the same code with separate state files, while modules encapsulate reusable code. A workspace serves to isolate states for different environments, whereas a module serves to reuse infrastructure logic. Workspaces share the same code but different states, modules share code across projects.

3

What is the main advantage of using a remote backend like S3 instead of local state?

Câu trả lời

The remote backend enables state sharing between team members and guarantees deployment consistency. With local state, each developer has their own copy, creating conflicts and inconsistencies. The remote backend also offers state locking to prevent concurrent modifications and facilitates collaboration by centralizing the source of truth.

4

How to create a new Terraform workspace?

5

What is the difference between a data source and a resource in Terraform?

+19 câu hỏi phỏng vấn

Các chủ đề phỏng vấn DevOps khác

Nắm vững DevOps cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí