aws-cloudformation / cloudformation-resource-schema

The CloudFormation Resource Schema defines the shape and semantic for resources provisioned by CloudFormation. It is used by provider developers using the CloudFormation RPDK.
Apache License 2.0
90 stars 38 forks source link

Maybe support primary identifiers that are list-valued? #87

Closed benkehoe closed 3 years ago

benkehoe commented 4 years ago

Currently, there's an issue where if a primary identifier is list-valued, registration will succeed but execution will fail at runtime with "Internal error" and no logs output. That issue has been reported.

Separately, though: should list-valued identifiers be allowed?

How this came up is we're creating a resource provider for the sorely-needed S3 bucket notification resource. While the notifications have individual IDs, there is a constraint that no two notifications can overlap in prefix+events. So we had this idea of using that combination as an identifier. When we tried it out, it broke as described above.

This case is less of a list-valued identifier, and more of a set-valued constraint, but I wanted to open an issue for discussion if I or others had ideas about when a list-valued identifier would be useful. Given that the primary identifier itself can be list-valued, it seems plausible that sometimes the list wouldn't come from a series of scalar properties but from a single property containing that list.

PatMyron commented 3 years ago

Going to merge this discussion into https://github.com/aws-cloudformation/aws-cloudformation-resource-schema/issues/98

benkehoe commented 3 years ago

Are you closing this issue as "we won't support list-valued identifiers" or as "re-post this under #98"?

PatMyron commented 3 years ago

the latter, re-posted already: https://github.com/aws-cloudformation/aws-cloudformation-resource-schema/issues/98#issuecomment-684003091