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

"Sub-list" for resources with multiple primary identifiers #89

Open benkehoe opened 4 years ago

benkehoe commented 4 years ago

When a resource schema providers more than one property for primaryIdentifier, it may make sense to list the resources for a fixed value of one or more of those properties.

We're building an S3 bucket notification resource, to solve a long-standing problem. Each item in the notification configuration for a bucket is a separate resource. The primaryIdentifier is the combination of the bucket name and the notification configuration item id. The list handler handler will iterate over all buckets, returning all notification configuration items inside. But it's also sensible to think that a user could ask to list all notification resources for a fixed bucket name.

It seems likely that people will order their primary identifier list from general to specific, so may it could be automatic that if a list handler supports this "sub-listing" the user could provide the first value, the first and second, etc.