enforced_for in an AWS Tag Policy Blocks Wrong Tag Values but Lets Untagged Resources Through
Overview
You turned on enforced_for for CostCenter and the compliance report is clean, yet untagged instances keep launching. The policy never looks at them.
At a glance
- Symptom
- A platform team tightens the organization's tag policy.
- Likely cause
- A tag policy only evaluates tags that exist.
- Impact
- A clean compliance result only describes resources that already carry tags.
- Verification signal
- In the test account, try a launch of a throwaway instance with no CostCenter tag.
- Safe correction
- The precondition for every step is a test account in its own OU, the current tag policy JSON saved from the console JSON tab, and the output of…
- Rollback or recovery
- Every change above can be reversed.
Switching on enforced_for in an AWS Organizations tag policy blocks resources that carry the wrong value for a tag key. It does not stop anyone creating a resource with no tags at all, and the compliance results never list that resource. To make a tag mandatory, report the key as required for your infrastructure-as-code pipeline and put a service control policy in front of console and CLI creation. Build both on one test account first.
Symptom
A platform team tightens the organization’s tag policy. It adds a CostCenter key, lists the allowed values, and ticks Prevent noncompliant operations for this tag for Amazon EC2. In the JSON tab that becomes an enforced_for entry of ec2:ALL_SUPPORTED. A test launch with CostCenter=Finance, a value the policy does not allow, is refused, so the team assumes the tag is now mandatory.
Then a developer launches an instance with no tags and it starts without complaint. The compliance report shows no new noncompliant resources. Weeks later the cost report still has a large block of unallocated spend, and nothing in the organization pointed at the resources behind it.
The assumption behind it
The policy reads like a rule that says every EC2 resource must carry a CostCenter with one of the listed values. The console option says “prevent noncompliant operations”, the key is named in the policy, and the example in the documentation shows exactly that shape. It is easy to read it as “required” when it means “if you supply this key, it must be valid”.
Root cause
A tag policy only evaluates tags that exist. The documentation states that untagged resources, and tags that are not defined in the policy, are not evaluated for compliance. The enforced_for setting prevents noncompliant tagging operations on the resource types you name. Its default is null, so nothing is prevented until you set it.
The enforcement page is explicit about the gap. Basic compliance rules do not enforce tag compliance on resources created without tags, they do not enforce missing tag keys, and they cannot ensure that a required tag key is present at creation.
Two other tools cover that job: the “required tag key” capability, which the documentation says is for resources created by tools such as CloudFormation, Terraform and Pulumi, and service control policies that stop IAM users and roles creating certain resource types when the request does not include the specified tags.
The reporting side has the same blind spot. The best practices page says resources that have never had tags do not show as noncompliant in reports, and that account administrators can still create untagged resources. The get-resources command documents the same limit: it does not return untagged resources.
Impact
A clean compliance result only describes resources that already carry tags. Untagged resources sit outside every tag policy check, so they are also outside every cost allocation report and every access rule that depends on a tag value. The documentation notes that consistent tags matter for cost tracking and for attribute-based access control (ABAC) policies that rely on exact tag matching.
The false reassurance is the larger cost. The team has a policy, a dashboard with nothing red on it, and a belief that tagging is enforced, so nobody looks for the gap.
How to confirm it
Three read-only checks show what the policy does and does not cover. First, read the effective tag policy for a member account. It is the aggregate of every tag policy that account inherits plus any attached to it directly. Look for enforced_for on your key and for the absence of any required-tag setting:
aws organizations describe-effective-policy --policy-type TAG_POLICY --target-id 111122223333
Second, in the member account, list what the policy considers noncompliant. Untagged resources will not be in the result, which is the point:
aws resourcegroupstaggingapi get-resources --include-compliance-details --exclude-compliant-resources --region eu-west-2
Third, from the management account, count noncompliant resources across the organization. This operation can only be called from the management account and from the us-east-1 Region:
aws resourcegroupstaggingapi get-compliance-summary --group-by TARGET_ID RESOURCE_TYPE --region us-east-1
To find the untagged resources themselves, the get-resources documentation points to AWS Resource Explorer with a query that uses tag:none. Compare that list with the two above: everything in it is invisible to the tag policy.
The shortcuts that make it worse
The tempting response is to turn enforcement up: add more services to enforced_for, attach the policy at the organization root, and hope the gap closes. It does not, because enforcement still only judges tags that are supplied.
It also carries a real cost. The documentation warns that enforcing compliance could prevent users from creating the resources they need. It adds that some services have groupings, such as EC2 groups and Amazon EMR clusters, that propagate tags to the resources inside them, and that a stricter policy on the contained resources can block dynamic scaling and provisioning.
The second shortcut is to attach a deny service control policy to the root straight away. The detach-policy documentation warns that, for a service control policy, changes to permissions for IAM users and roles in the affected accounts are immediate. A deny policy that lands on the root before your pipelines send the tag can therefore stop their creations in every account it covers.
The AWS guidance for service control policies is to test in a separate OU and widen slowly. If a deny policy is new to you, see how an SCP allow-list behaves while FullAWSAccess stays attached, and how a copied region-deny policy blocked a certificate CloudFront needed.
Correction
The precondition for every step is a test account in its own OU, the current tag policy JSON saved from the console JSON tab, and the output of the first check above. Change one layer at a time and prove it before moving on.
- Report the key as required, for the pipeline. In a copy of the tag policy, add
report_required_tag_forunder theCostCenterentry, assigning the resource types you care about, for exampleec2:instanceands3:bucket, next to the existingtag_key. Attach it to the test account only. The documentation says an IaC deployment missing a required tag fails or only warns, depending on how the hook is configured. Turn on the tool’s check in warn mode first: the CloudFormation hook, the Terraform AWS provider validation or the Pulumi policy pack. Keep each resource type’s required tags well under the 50-tag limit the best practices page gives. Rollback: re-attach the saved policy JSON. - Close the console and CLI route with a service control policy. For each resource type whose service supports controlling access with tags, write a deny statement that applies when the request lacks the key. IAM’s
aws:RequestTag/key-namecondition key controls the tags a request may carry, and theNulloperator withtruematches when a key is absent. AWS publishes example service control policies in a GitHub repository to start from. Check the ABAC column for the service in the IAM documentation first. For EC2, the documentation says callers who include tags in a creating action need explicit permission to useec2:CreateTags, granted with theec2:CreateActioncondition key, so check their identity policies as well. Create the policy, then attach it to the test OU with the command below. Rollback: detach it with the second command, which takes effect immediately. - Prove it on the test account, then widen. Run the checks under the next heading. When they pass, attach to the next OU, never to the root first.
- Clear the existing backlog. Use the Resource Explorer
tag:nonequery to find untagged resources and tag them. The tag policy will then evaluate them as well.
Following along? Tap a step’s number to tick it off.
aws organizations attach-policy --policy-id p-examplepolicyid --target-id ou-examplerootid-exampleouid
aws organizations detach-policy --policy-id p-examplepolicyid --target-id ou-examplerootid-exampleouid
Verification
In the test account, try a launch of a throwaway instance with no CostCenter tag. The service control policy should refuse it. Launch one with an allowed value and it should succeed. Launch one with a value the tag policy does not allow and it should still be refused, now by the tag policy. Run the IaC plan without the tag and confirm it warns or fails as configured. Delete the throwaway resource afterwards.
Then re-run describe-effective-policy and confirm the required-tag setting appears for the test account. Keep the test OU as it is for a few days and watch for failed creations from pipelines you had not listed.
Rollback
Every change above can be reversed. Detach the service control policy with detach-policy; remember it takes effect immediately, so do it deliberately. Re-attach the saved tag policy JSON to put the earlier tag rules back. Resources that were tagged during the work keep their tags, which is the intended outcome and needs no undoing.
Stop it happening again
- Describe the three jobs separately in your tagging standard: tag policy checks the values of tags that exist, required-tag reporting covers pipelines, and a service control policy covers direct creation.
- Never read a quiet compliance report as proof that everything is tagged. Pair it with a regular
tag:nonesearch. - Test every enforcement change on one account first, as the getting started guidance recommends, and check how tags propagate from groups into the resources they create.
- When you roll out a new service control policy, widen by OU and keep the detach command in the change ticket.
Apply the safer control
Before you change production
Confirm the affected scope, export the current configuration, and test the replacement control in a non-production environment first.
Fix commands and configuration
enforced_forCostCenterec2:ALL_SUPPORTEDWhen to escalate
Validation and rollback are covered in the sections above.
Escalate
Escalate when the blast radius is uncertain, the control cannot be tested safely, or remediation requires an outage or security exception.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Found this useful? Follow KBY for more like it.

