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

Cross-resource constraints #88

Open benkehoe opened 4 years ago

benkehoe commented 4 years ago

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. However, the rules for bucket notifications says they can't overlap in prefix+events. So two resources can share a prefix if they subscribe to different events, or if they share events they can't share a prefix. If someone creates set of resources that violates these constraints, the S3 API call will return an error at some point in the process, which we'll surface to the user. But it got me thinking if these kinds of constraints could be expressed in the schema. It could be something like "uniquePropertySets": {"SomeNameForThis": [ '#/properties/SomeScalarProperty', '#/properties/SomeSetValuedProperty']}

PatMyron commented 3 years ago

I think these cross-resource references are all we have planned for the near future