Terraform state and Failures

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/16

encourage image

There's no tags or description

Looks like no tags are added yet.

17 Terms

1
New cards

P01 — Why keep team state in a remote backend?

So the team uses the same state rather than conflicting laptop copies. Configure access protection, recovery and supported locking.

2
New cards

P02 — What does a state lock prevent?

Two Terraform writers changing the same state at once. It does not lock every AWS resource against console changes.

3
New cards

P03 — An apply says the state is locked. What do you do first?

Identify the lock owner and active run. Wait or investigate that run; only clear your stale lock after proving its operation stopped.

4
New cards

P04 — How is S3 backend locking configured now?

On supported Terraform versions, use_lockfile = true enables S3 lock-file locking. Older DynamoDB-based locking is deprecated; check the project version before changing it.

5
New cards

P05 — What is infrastructure drift?

Real infrastructure changed outside the declared workflow, such as someone editing a security group in the console.

6
New cards

P06 — A console fix stopped an outage. What should happen in Terraform afterward?

Inspect the real change and its intent. Update configuration if the fix should remain, then review a fresh plan so a later apply does not undo it.

7
New cards

P07 — What does refresh-only mean?

Review or record observed changes in state and outputs without changing remote resources. It does not edit configuration to match the console.

8
New cards

P08 — An apply fails halfway through. Did Terraform undo everything?

No. Successful changes may remain and be recorded in state. Inspect what changed, fix the cause, and review a fresh plan before continuing.

9
New cards

P09 — A plan shows -/+ for a production database table. What does that mean?

Replacement: the existing resource is to be destroyed and another created. Stop to review the reason, data migration, dependencies and recovery path.

10
New cards

P10 — Can reverting a Git commit guarantee a safe infrastructure rollback?

No. The resulting plan might replace resources, and deleted data does not return with the code. Review the reverse change and its recovery implications.

11
New cards

P11 — Why protect state and saved plan files?

They can contain secrets and infrastructure details. Restrict access and protect storage; do not treat them as ordinary Git artifacts.

12
New cards

P12 — Does sensitive = true keep a value out of state?

No. It hides normal display output, but the value can still be stored. Omission from state requires a supported ephemeral or write-only approach.

13
New cards

P13 — Do Terraform workspaces alone separate dev and production securely?

No. They separate state instances, not credentials or account permissions. Design separate access, state and resource boundaries; accounts can provide stronger isolation.

14
New cards

P14 — A table already exists in AWS. How can Terraform take over managing it?

Import it into the intended resource address with matching configuration, then inspect the plan. Import is not proof that configuration matches or that applying is harmless.

15
New cards

P15 — Renaming a Terraform resource proposes destroy/create. What should you investigate?

Whether only its Terraform address changed. A reviewed moved block can preserve its binding to the same object; confirm the resulting plan avoids unintended replacement.

16
New cards

P16 — What makes a Terraform deployment safer in CI?

Use reviewed configuration, controlled credentials and versions, protected state and serialized applies. Review the saved plan that will be applied, then verify application behavior afterward.

17
New cards