Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use global Tag instead of module specific tag #9

Open
henriqueleite42 opened this issue Jun 28, 2024 · 1 comment
Open

Use global Tag instead of module specific tag #9

henriqueleite42 opened this issue Jun 28, 2024 · 1 comment

Comments

@henriqueleite42
Copy link
Contributor

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/blob/main/package/aws/organizations/account.pkl

https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/certificatemanager/certificate.pkl
https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/certificatemanager/certificate.pkl

https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/apigatewayv2/api.pkl
https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/apigatewayv2/api.pkl

https://github.com/aws-cloudformation/cloudformation-pkl/blob/main/package/aws/s3/bucket.pkl
 image

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:

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:
image

@ericzbeard
Copy link
Contributor

The problem is that tags are modeled and implemented differently per resource, so I'm not sure if we can effectively abstract them out to a higher level definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants