---
title: "Tag every resource with its owner · Agent Wranglers"
url: https://agentwranglers.se/playbook/infrastructure/cost-and-ownership/required-tags
updated: 2026-10-20
licence: "All rights reserved"
---

# Tag every resource with its owner

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Cost and ownership](https://agentwranglers.se/playbook/infrastructure/cost-and-ownership)
- Rule: Tag every resource with its owner, service, environment and the tool that manages it. Refuse any plan that creates a resource without them.
- How: Set the tags once in the provider's default tags, so each resource gets them without extra code. Use the same tag keys in every account. Turn on the tags for cost reports, such as cost allocation tags in AWS or labels in Google Cloud billing. Fail untagged plans with the [policy on the plan](https://agentwranglers.se/playbook/infrastructure/policy-as-code/policy-on-the-plan).
- Check: A resource search finds no taggable resource missing any of the `owner`, `service`, `environment` and `managed-by` tags. The cost report groups at least 95 percent of last month's spend by `service`.

Example:

```hcl
provider "aws" {
  region = "eu-north-1"
  default_tags {
    tags = {
      owner       = "web-team"
      service     = "shop"
      environment = var.environment
      managed-by  = "opentofu"
    }
  }
}
```

```ts
// Pulumi in TypeScript: pass this provider to every resource
import * as aws from '@pulumi/aws';

const provider = new aws.Provider('tagged', {
  region: 'eu-north-1',
  defaultTags: { tags: { owner: 'web-team', service: 'shop', environment: 'production', 'managed-by': 'pulumi' } },
});
```

```python
import pulumi_aws as aws

provider = aws.Provider("tagged", region="eu-north-1", default_tags={
    "tags": {"owner": "web-team", "service": "shop", "environment": "production", "managed-by": "pulumi"},
})
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers infrastructure playbook: https://agentwranglers.se/playbook/infrastructure/cost-and-ownership/required-tags`.

- Next: [Give every account a budget with alerts](https://agentwranglers.se/playbook/infrastructure/cost-and-ownership/budgets-for-every-account)
- [Cost and ownership](https://agentwranglers.se/playbook/infrastructure/cost-and-ownership)
