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

Validate the type of properties in `primaryIdentifier` #98

Open wbingli opened 4 years ago

wbingli commented 4 years ago

Only String or Number type property can be primaryIdentifier. We should enforce it during schema validation.

PatMyron commented 3 years ago

@wbingli related: see https://github.com/aws-cloudformation/aws-cloudformation-resource-schema/issues/87 for request for array type primaryIdentifiers

benkehoe commented 3 years ago

Should list-valued identifiers be allowed?

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.

This case is less of a list-valued identifier, and more of a set-valued constraint, but I wanted to raise the question for discussion if 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.