START HERE

What you will learn

  • Explain what configuration, plan, apply and state each do.
  • Follow a reviewed infrastructure change through an automated workflow.
  • Understand where cloud identity, sensitive records and recovery need explicit controls.

Before you start: You should understand a source repository and a remote server. Terraform and OIDC are proposed extensions here, not features already verified in MintBios’s SSH release path.

Four Terraform terms you need first

Configuration describes the infrastructure you intend to manage. A plan describes the changes Terraform proposes after considering that configuration and the environment. Apply performs the authorised changes. State is Terraform’s record linking managed resources with the configuration that describes them.

These are not interchangeable. Seeing a valid configuration does not tell you that the proposed resource changes are acceptable. Seeing a successful apply does not tell you that the application is healthy. Review the intended operations, then check the actual outcome.

Identity and state are separate security concerns

A workflow needs permission to act on the cloud account. OpenID Connect, or OIDC, can allow a supported cloud provider to issue a short-lived credential after checking the workflow’s identity against a trust policy. A cloud role is the set of permissions the job receives; it should cover only the intended resources. The trust policy must also restrict which workflow identity can obtain that role.

State and saved plans may contain sensitive information. Marking a value “sensitive” controls some display behaviour; it does not make the stored record safe to publish. Protect access to those records, choose suitable storage controls and separate environments. A credential that expires quickly does not protect an exposed state file.

Step-by-step process

  1. Propose the change in a pull request

    Describe the intended outcome and the resources that should change. A pull request is a reviewable proposal in the repository, not permission for untrusted code to receive cloud credentials.

  2. Validate and inspect the plan

    Check the configuration and proposed creates, updates or destroys. Ask whether an apparently small edit would replace an important resource. Keep the plan tied to the source revision being reviewed.

  3. Authorise the apply path

    Use the repository’s available deployment controls and a trusted workflow. Do not let an untrusted contribution run with infrastructure-changing permissions.

  4. Acquire only the required cloud authority

    Where supported and configured, exchange the workflow identity for a short-lived, restricted role. Check that the identity is bound to the intended repository and deployment environment, rather than trusting any workflow from any context.

  5. Apply while protecting state

    Use access-controlled storage and a supported lock that prevents overlapping changes to the same state. Record the apply result without exposing credentials or sensitive plan contents in public logs.

  6. Verify the service and plan recovery

    Check the application, access rules and resource state after the change. Recovery may require a new reviewed change or a restore procedure; an infrastructure change is not always safely reversible by running an inverse command.

FOLLOW ONE EXAMPLE

Worked scenario

Changing a management-access rule

A technical leader proposes allowing an approved management route to reach a VM. This is a design example, not a live change to the MintBios host.

  1. The pull request describes the intended source network and destination. The reviewer checks the plan for unintended broader access or resource replacement.
  2. An authorised job applies the reviewed change using the scoped cloud role. The state record stays in protected storage.
  3. Verification checks that the intended management connection works and unintended paths remain blocked. If access is wrong, the operator uses the agreed recovery route rather than making an unreviewed broad-access exception.

What this shows: The evidence connects the proposal, authorised change and actual access behaviour. The apply exit code is only one part of that evidence.

The process at a glance

A reviewed plan, permission to apply and verification of the actual service are distinct stages. Do not replace them with one “deploy” decision.
ProcessDecisionHuman checkpoint
Read Mermaid diagram source
flowchart LR
 A[Propose configuration change] --> B[Review source and plan]
 B --> C[Authorise apply]
 C --> D[Acquire scoped cloud identity]
 D --> E[Apply with protected state]
 E --> F[Check service and access]
 F --> G[Record result or choose recovery]

What you should have at the end

  • A reviewable record of why infrastructure should change.
  • An apply operation linked to an authorised revision and limited cloud role.
  • Post-change checks and a recovery plan appropriate to the affected resources.

Common mistakes and how to avoid them

Approving source without examining the proposed operations

Read the plan, especially replacements, destroys and expanded access.

Treating OIDC as an automatic permission policy

The trust conditions and cloud role determine what is actually allowed.

Assuming sensitive values disappear from stored records

Protect state and plans even when command output hides some values.

APPLY THE IDEA

Try it yourself

Your task: Write a hypothetical infrastructure change without applying it. Describe the intended resources and one change that would be unacceptable.

What to produce: A review checklist covering source revision, plan, authorisation, identity, state protection, service checks and recovery.

Check your understanding: Could a reviewer distinguish a valid plan from an acceptable change, and explain who may authorise apply?

Key terms in plain English

Pull request
A proposed source change offered for review before integration.
Plan
Terraform’s description of proposed infrastructure operations.
State
Terraform’s record associating configuration with managed resources.
OIDC
An identity protocol that can support exchanging a workflow identity for short-lived cloud access.

Sources and further reading