# Provider Formatting Patterns

How each cloud provider formats accounts, regions, resource IDs, tags,
and K8s metadata. Use this when creating configs to ensure realistic data.

## Account/Subscription/Project IDs

| Provider | Format | Example |
|----------|--------|---------|
| AWS | Account alias or 12-digit ID | `aws-prod-platform-001` |
| GCP | Numeric project ID | `582947163029` |
| Azure | UUID | `b10ebc53-253d-6298-a33e-c157b62bbc0f` |

## Region Names

| Provider | Format | Examples |
|----------|--------|---------|
| AWS | kebab-case | `us-east-1`, `us-west-2`, `eu-west-1` |
| GCP | lowercase-hyphen | `us-central1`, `us-west1`, `europe-west1` |
| Azure | camelCase | `eastus`, `westus2`, `ukwest` |

## Resource ID Prefixes

All providers use kebab-case: `{feature}-{context}`.

| Provider | Examples |
|----------|---------|
| AWS | `insight-api-eks`, `dashboard-alb-usw2`, `legacy-api-eu` |
| GCP | `insightapi-gke`, `dashboard-gcs`, `legacy-gke-eu` |
| Azure | `insightapi-aks`, `dashboard-blob`, `api-prod-eastus` |

Always set `resource_id_prefix` — even for untagged resources, it's the
fallback allocation signal.

## Tags and Messiness Levels

CZBG configs use 4 levels of tag messiness to demonstrate CloudZero's
tag normalization value:

### Level 1: Clean (primary region, ~40% of resources)

```yaml
tags:
  Feature: InsightAPI
  Environment: Production
  CostCenter: eng-api-2025
  Team: platform-engineering
```

### Level 2: Messy Lowercase (secondary region, ~25%)

```yaml
tags:
  feature: insight-api
  environment: production
  costcenter: eng-api-2025
  team: platform-engineering
```

### Level 3: Very Messy (secondary region, ~15%)

```yaml
tags:
  App: INSIGHTAPI
  Env: PROD
  CC: eng-2025
  Owner: platform-engineering
```

### Level 4: Untagged (DR region, ~20%)

No tags. Only `resource_id_prefix` for pattern-based allocation.

### Common Tag Key Variants

| Concept | Variants |
|---------|----------|
| Feature | `Feature`, `feature`, `App`, `Application`, `Service` |
| Environment | `Environment`, `Env`, `environment`, `env`, `tier` |
| Cost Center | `CostCenter`, `Cost-Center`, `cost_center`, `CC` |
| Team | `Team`, `team`, `Owner`, `Squad`, `managed-by` |
| Customer | `Customer`, `customer`, `Tenant`, `Client` |

## Provider-Specific Tags

### AWS

Standard tags only (no provider-specific required fields).

### GCP

```yaml
tags:
  gcp_cz:project_name: prod-platform-analytix
  gcp_cz:ancestry_display_name: analytix.io/Production/Platform
```

- `gcp_cz:project_name` — project display name (not the numeric ID)
- `gcp_cz:ancestry_display_name` — org hierarchy: `{org}/{environment}/{department}`

### Azure

```yaml
tags:
  azure:subscriptionName: Production Platform
  azure:resourceGroupName: rg-insightapi-prod
```

- `azure:subscriptionName` — subscription display name
- `azure:resourceGroupName` — resource group, format: `rg-{feature}-{environment}`

## K8s Metadata Patterns

### Cluster Naming

| Provider | Pattern | Example |
|----------|---------|---------|
| AWS (EKS) | `{purpose}-{env}` | `platform-prod`, `api-staging-usw2` |
| GCP (GKE) | `{purpose}-{region}-gke` | `platform-prod-gke` |
| Azure (AKS) | `{purpose}-{env}-aks` | `platform-prod-aks` |

### Namespace Naming (intentionally inconsistent)

```
insightapi-prod          # kebab-case
dashboard_production     # snake_case (messy)
MobileSDK                # CamelCase (messy)
shared-services          # descriptive
```

### Workload Labels

```yaml
labels:
  app: api-server
  team: platform-engineering
  tier: backend
  feature: InsightAPI
```

Label keys follow the same messiness variants as tags:
`app` vs `application` vs `app-name` vs `app.kubernetes.io/name`.

### Workload Naming

```
Deployments:    insight-api-deployment, dashboard-frontend
StatefulSets:   mongodb-shared, redis-cache
CronJobs:       async-processor-daily, metrics-aggregator
```

## Geographic Distribution Pattern

| Region Role | % of Resources | Tag Quality | Purpose |
|-------------|---------------|-------------|---------|
| Primary | 60% | Clean (Level 1) | Main production |
| Secondary | 30% | Messy (Level 2-3) | DR / multi-region |
| DR/Legacy | 10% | Untagged (Level 4) | Legacy or minimal |

This distribution demonstrates CloudZero's allocation progression:
60% initially allocated (tags only) -> 85% (merged patterns) -> 95%+ (telemetry).
