IaC Naming & Tagging Convention Audit Prompt
Audit infrastructure-as-code for consistent resource naming and tagging so cost allocation, ownership, environment, and governance tags are complete and standardized.
- Target user
- infrastructure engineers writing Ansible and IaC
- Difficulty
- Beginner
- Tools
- Claude, ChatGPT
The prompt
You are a senior infrastructure-as-code engineer who has rolled out organization-wide naming and tagging standards and chased down untagged resources that broke cost reports and ownership tracing. I will provide: - The IaC source (CloudFormation, Ansible cloud modules, Helm values, or generic templates) defining resources - The required naming pattern and mandatory tag keys (e.g., environment, owner, cost-center, data-classification) - Any existing convention document or governance policy Your job: 1. **Extract current state** — list every named resource and its tags as defined in the IaC. 2. **Check naming compliance** — flag names that violate the pattern (case, separators, environment/region prefixes, length limits). 3. **Check tag completeness** — flag missing mandatory tags, inconsistent keys/casing, and hard-coded values that should be variables. 4. **Recommend a DRY mechanism** — propose default/shared tags (provider default tags, a common tag map/var, or a macro) so tags are applied centrally, not per resource. 5. **Map to governance** — note where missing tags would break cost allocation, access policy, or automated cleanup, and prioritize by impact. 6. **Provide enforcement** — suggest a policy-as-code or pre-commit check that fails builds when naming/tagging rules are violated. Output as: a compliance table (resource, name issue, tag gaps, severity), a corrected tag-map diff, and a recommended enforcement check. Default to caution: when a tag value looks sensitive (owner emails, account identifiers, data classification), flag it rather than embedding it as a literal in committed IaC.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Policy-as-Code Rule Authoring from a Governance Requirement Prompt
Translate a written governance or compliance requirement into enforceable policy-as-code rules — choosing the right engine (OPA/Rego, Sentinel, Checkov, cfn-guard, Kyverno) and writing the rule with clear messages, tests, and a graduated rollout.
-
Sentinel Policy-as-Code Authoring Prompt
Write and test HashiCorp Sentinel policies that gate infrastructure runs by enforcement level, using imports and mocks to validate plans before they ever apply.
-
AWS CDK Escape Hatches & L1 Override Prompt
Use CDK escape hatches (addPropertyOverride, addOverride, addDeletionOverride, and L2-to-L1 access) to set properties the L2 construct does not expose, without forking constructs or dropping to raw CloudFormation.
-
CloudFormation Dynamic References for SSM & Secrets Manager Prompt
Replace hardcoded secrets and config in CloudFormation templates with resolve dynamic references to SSM Parameter Store and Secrets Manager, including versioning, rotation, and no-echo handling.
More Infrastructure as Code prompts & error guides
Browse every Infrastructure as Code prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.