aws-cloudformation / aws-cloudformation/cloudformation-pkl
Use global `Tag` instead of module specific tag
- Dominant language
- Pkl
- Stars
- 23
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Currently, each resource that accepts tags uses its own typing:
https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/organizations/account.pkl
](https://github.com/aws-cloudformation/cloudformation-pkl/assets/50992814/ee9774fb-7c46-44e1-8776-d43266a54b64)
https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/certificatemanager/certificate.pkl
](https://github.com/aws-cloudformation/cloudformation-pkl/assets/50992814/8d8fe00d-e443-482d-ba6f-e0f5ffa87f88)
https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/apigatewayv2/api.pkl
](https://github.com/aws-cloudformation/cloudformation-pkl/assets/50992814/62b7b638-9fd7-49f0-a920-8e17b215e60c)
https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/s3/bucket.pkl

](

)](https://github.com/aws-cloudformation/cloudformation-pkl/assets/50992814/8e956154-551e-401c-b16f-8eddb495c43f)
What I get, I **_some_** cases you need extra validation, like in the AccountTag, but most of the places you will have the exactly same thing:
```pkl
open class Tag {
Key: String|Mapping
Value: String|Mapping
}
```
Having multiple classes to do the same thing makes it impossible to use something like "default tags" for the resources, what would be very useful to create tags for the environment or similar repetitive tags.
Currently, if you try to do it, you get the error:

Contributor guide
Research direction
Start by comparing the tag definitions in package/aws/organizations/account.pkl, package/aws/certificatemanager/certificate.pkl, package/aws/apigatewayv2/api.pkl, and package/aws/s3/bucket.pkl. Check where AccountTag needs extra validation versus the shared shape, then update the relevant resource definitions so a global Tag can be reused for default tags. Done means the common tag typing is consistent without losing resource-specific validation.
Written by the indexing model from the issue text.
Assessment
- Domain
- cloud
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100