TL;DR: Untagged resources, inconsistent naming, and security gaps can result when Terraform module bypass lets raw resource blocks evade approved infrastructure standards, according to ControlMonkey. The core issue is not provisioning speed but whether cloud governance can still hold when teams can sidestep policy by writing directly against resources.
At a glance
What this is: This is an analysis of module-only Terraform provisioning, showing that raw resource blocks can bypass approved blueprints and weaken cloud governance.
Why it matters: For cloud governance, IAM, and IaC practitioners, the issue is control enforcement at provisioning time, where standards can fail if teams can create resources outside approved modules.
Context
Terraform modules turn infrastructure patterns into reusable blueprints, but they only help if teams actually use them. The governance gap appears when engineers can write raw Terraform resource blocks or bring in external templates that bypass those blueprints and create resources outside the intended control path.
In cloud programmes, that bypass creates practical drift. Untagged resources, inconsistent naming, and missing security controls are not abstract hygiene issues here, because they are the direct result of provisioning outside the approved module boundary rather than through the organisation's standardised infrastructure code.
The article's core question is not whether modules are useful. It is whether cloud governance can still be enforced when the provisioning model allows exceptions to become a normal delivery path.
Key questions
Q: What breaks when teams can bypass approved Terraform modules?
A: When teams can bypass approved Terraform modules, the organisation loses its enforcement point for security defaults, tagging, naming, and compliance settings. Raw resource blocks create a second provisioning path that is harder to audit and easier to misuse. The result is governance drift, where policy exists on paper but not in the deployed infrastructure state.
Q: Why does module enforcement matter for cloud governance teams?
A: Module enforcement matters because it concentrates governance in one approved path, making it easier to apply compliant patterns consistently. Without it, cloud teams must detect and reconcile every variation after the fact, which is slower, harder to audit, and more likely to miss security and compliance gaps.
Q: How do teams know whether Terraform state management is working properly?
A: Good state management shows up as smaller, owned state files, fewer merge conflicts, faster operations, and successful imports without unexpected drift. Teams should also see lower change friction when resources move between stacks. If reviews are slow, state files are unstable, or imports regularly need manual repair, the control is not working well enough.
Q: What should cloud teams do when raw Terraform resource blocks are still allowed?
A: Cloud teams should classify raw resource blocks as an exception path and either remove them or bind them to explicit approvals, owners, and expiry rules. If they remain a routine alternative to modules, the governance model stays fragmented and enforcement will remain partial.
Technical breakdown
Why raw Terraform resources create a governance gap
Terraform modules wrap approved configuration into a controlled pattern, while raw resource blocks let authors define infrastructure directly. That matters because policy, tagging, security defaults, and standard naming often live inside the module, not in every individual resource declaration. When engineers bypass the module, the organisation loses the consistency layer that was supposed to enforce baseline controls across environments. In practice, the governance gap is not Terraform itself but the difference between policy embedded in reusable blueprints and policy that must be re-applied manually at every resource definition.
Practical implication: treat module bypass as a governance exception, not a harmless implementation choice.
Why PR time enforcement matters for IaC controls
The article points to two enforcement moments: pull request review and ongoing scans. PR time matters because it is the last practical checkpoint before non-compliant infrastructure reaches the platform, and it is where teams can block unapproved patterns before they become deployed state. Ongoing scans matter because they catch drift, shadow provisioning, and later edits that bypassed review. Together, these controls align with policy-as-code thinking: governance must be enforced where code is introduced and where it continues to change, not only after resources are live.
Practical implication: enforce module usage before merge and keep scanning deployed Terraform for post-merge drift.
How untagged resources and inconsistent naming signal control failure
Untagged resources and inconsistent naming are visible symptoms of a deeper control problem. If the module is where cost tags, security settings, and naming conventions are standardised, then any resource created outside it is likely to miss those controls unless they are duplicated elsewhere. That creates audit friction, cost allocation errors, and operational ambiguity. The signal is not just that a resource looks different. It is that the organisation has allowed multiple provisioning paths with different governance outcomes, which weakens the integrity of the infrastructure model.
Practical implication: use drift in tags and naming as evidence that module enforcement is incomplete.
Breaches seen in the wild
- EmeraldWhale Git config credential theft: Tokens in exposed .git/config files let EMERALDWHALE clone private repositories and steal more than 15,000 cloud credentials.
- CI/CD pipeline exploitation case study: Credentials in an exposed .git/config let a researcher edit a Bitbucket pipeline so it planted their SSH key on the server. No victim was named.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Module bypass is a cloud governance failure, not a Terraform feature gap. The problem arises when teams can create resources outside the approved blueprint and still consider the deployment compliant. That breaks the assumption that governance is inherited automatically through standardised IaC, and it pushes control enforcement back into human review. The practitioner conclusion is that module policy has to govern all allowed resource paths, not just the preferred one.
Module-only provisioning creates a named control boundary that auditors can actually test. When security and compliance settings live inside approved modules, the control question becomes binary: was the resource instantiated through the module or not? That is easier to measure than trying to infer governance from live cloud state after the fact. For cloud teams, the value is not faster provisioning but a clearer enforcement boundary for standards, tagging, and policy consistency.
Untagged resources are the operational symptom of governance drift. If module use is optional, teams will inevitably diverge in naming, tags, and embedded security defaults. That produces an infrastructure estate where compliance depends on developer discipline rather than control design. The practitioner takeaway is to treat module enforcement as part of governance architecture, not as a coding convenience.
IaC governance works only when exception paths are eliminated or tightly constrained. Approved modules are the control plane, but raw resource blocks and external templates become parallel control planes if they are allowed to persist. That fragments accountability and weakens standardisation across cloud environments. The practitioner conclusion is to define one authoritative provisioning path per resource class and make every other path explicitly exception-based.
Cloud governance maturity is increasingly measured at provisioning time, not after deployment. If a team can create a resource outside the module, the governance programme has already lost the enforcement moment that matters most. This shifts the discipline from post-deployment inspection toward policy-backed authorisation at code intake. The implication for practitioners is clear: if you cannot constrain how infrastructure is created, you cannot reliably govern what is created.
From our research library:
- Over 70% of organisations lack automated access risk analysis, user access reviews and provisioning and deprovisioning, according to Pathlock's 2025 Digital Transformation and Access Risk Report.
- Read next: NHI Lifecycle Management Guide
What this signals
Module-only provisioning is a governance architecture choice, not a developer preference. Once a cloud team allows raw Terraform resources alongside approved modules, policy stops being inherited and starts being interpreted at every change. That creates a control boundary that is hard to audit and easy to bypass, so practitioners should treat module coverage as a provisioning governance metric, not a style guide.
Policy enforcement has to sit at the same point where infrastructure is introduced. Pull request checks and ongoing scans matter because they are the only moments when a module bypass can be intercepted before it becomes deployed state. For cloud governance programmes, the key question is whether a non-compliant resource can be created at all, not whether it can be found later.
Provisioning drift usually shows up first in naming and tagging. When those signals become inconsistent across teams, the underlying module policy is already losing force. Practitioners should use that inconsistency as an early warning that cloud governance needs tighter control over approved Terraform modules.
For practitioners
- Enforce approved module use for governed resources Require S3 buckets, storage accounts, and other sensitive resources to be created only through approved Terraform modules, not raw blocks or external templates.
- Block module violations at pull request time Add policy checks that fail builds or gate merge requests when Terraform code introduces unauthorised resource definitions outside the module catalogue.
- Scan deployed Terraform for drift and bypasses Use ongoing scans to detect resources created outside the standard module path so policy exceptions do not survive into production state.
- Standardise tagging and naming in module code Embed cost tags, naming conventions, and security defaults in the module itself so control inheritance is consistent wherever the module is used.
- Remove or tightly govern alternate provisioning paths Inventory any direct-resource or external-template paths and either retire them or require explicit exception handling with ownership and expiry.
Key takeaways
- Terraform module enforcement matters because the governance controls embedded in blueprints disappear when teams create resources directly.
- Module bypass often surfaces as untagged resources, inconsistent naming, and security gaps rather than as an obvious policy failure.
- Cloud teams need enforcement at pull request time and continuous drift detection if they want provisioning standards to hold.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0, CIS Controls v8 and CSA Cloud Controls Matrix set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-06 — Insecure Cloud Deployment Configurations | Raw Terraform resource bypass creates inconsistent cloud deployments outside approved modules. |
| Recommendation — Constrain cloud provisioning to approved module paths and block direct resource creation that bypasses governance controls. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | Module enforcement is an authorisation boundary for who can create what infrastructure. |
| Recommendation — Apply PR.AA-05 to restrict provisioning paths to approved Terraform modules and authorised templates. | ||
| CIS Controls v8 | CIS-5 — Account Management | Governance over provisioning paths depends on controlling who can create and modify infrastructure state. |
| Recommendation — Use CIS-5 governance to limit who can author direct-resource Terraform and review provisioning privileges. | ||
| CSA Cloud Controls Matrix | IAM — Identity and Access Management | Cloud IAM governance includes controlling permitted infrastructure creation methods and policy inheritance. |
| Recommendation — Use IAM controls to enforce one authoritative provisioning path for each cloud resource class. | ||
| MITRE ATT&CK | TA0006;TA0008 — Credential Access; Lateral Movement | Provisioning bypass can widen the path for misuse of cloud access and later movement. |
| Recommendation — Map uncontrolled provisioning paths to TA0006 and TA0008 when assessing cloud abuse pathways. | ||
Key terms
- Module-only Provisioning: A governance model where certain infrastructure resources can only be created through approved Terraform modules. It centralises security defaults, tagging, and compliance settings so that every deployment inherits the same baseline controls and cannot silently diverge through raw resource definitions.
- Infrastructure as code drift: Infrastructure as code drift is the gap between intended security policy and what gets deployed when templates are reused or modified. It matters because the same privilege mistake can be replicated many times, turning one entitlement error into a broad and repeatable access problem.
- Provisioning policy enforcement: The use of automated checks and governance rules to stop non-compliant infrastructure from being created in the first place. For Terraform, this means applying controls at pull request time and during continuous scans so the approved deployment model stays authoritative.
- Governance boundary: The point at which machine assistance ends and accountable organisational authority begins. In AI-enabled security programmes, this boundary determines which recommendations are advisory, which require human approval, and which actions must never be automated.
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
Published by the NHIMG editorial team on June 10, 2026.
Updated on October 10, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org