aws-samples / aws-samples/appmod-blueprints

feat: configurable platform-wide tags (SpringClean, cost allocation, compliance)

Open
#773 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Shell
Stars
105
Forks
62
Avg merge
11h 17m
Merged PRs (30d)
76

Description

## Problem

Currently, adding AWS resource tags to platform-managed resources requires:
1. **kro RGDs**: Declaring each tag key individually in SimpleSchema and propagating one by one to each resource template
2. **CDK stack**: Hardcoding tag values in the CDK code
3. No single source of truth — tags must be duplicated across layers

This is brittle and doesn't scale for customers who need:
- SpringClean protection (`auto-delete: no`)
- Cost allocation (`cost-center`, `team`, `project`)
- Compliance tags (`data-classification`, `environment`)

## Proposed Solution

### Layer 1: CDK (infrastructure resources)

A `platformTags` map in `config.local.yaml` (or `cdk.json` context) that gets applied to all CDK resources via `Tags.of(stack).add()`:

```yaml
# config.local.yaml
platformTags:
auto-delete: "no"
cost-center: "platform-engineering"
managed-by: "peeks"
```

### Layer 2: kro RGDs (Kubernetes-managed AWS resources)

A generic `spec.awsTags` field (`map[string]string`) in RGD schemas that gets merged/spread into the `tags` section of all AWS resources:

```yaml
spec:
awsTags:
auto-delete: "no"
cost-center: "1234"
```

### Layer 3: Single source of truth

Ideally, `config.local.yaml` defines tags once, and they propagate to:
- CDK via `Tags.of()`
- kro RGDs via instance values (ArgoCD injects from config)
- Helm charts via global values (for pod labels)

## Current PR

PR #753 (`feat(kro): add protectFromDeletion parameter`) is a **partial workaround** that hardcodes a single `auto-delete` tag. It will be closed in favor of this more generic approach.

## Tasks

- [ ] Design: decide on config format and propagation mechanism
- [ ] Verify kro CEL map spread capability (pending kro team response or SSAG)
- [ ] Implement CDK tag propagation from `config.local.yaml`
- [ ] Implement kro RGD `awsTags` field (if CEL supports it) or per-tag schema (if not)
- [ ] Document: how customers add custom tags

## References

- PR #753 (to be closed): https://github.com/aws-samples/appmod-blueprints/pull/753

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the proposed platformTags in config.local.yaml or cdk.json, the CDK tagging approach, and the kro RGD schemas described in the issue. Check whether kro supports CEL map spreading and review PR #753 as the partial workaround. Done means a decided configuration and propagation design, implemented CDK and RGD support where possible, and customer documentation for custom tags.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, helm, kubernetes, yaml
Domain
cloud, devops, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.