cloudformation-resource-schema icon indicating copy to clipboard operation
cloudformation-resource-schema copied to clipboard

Specify properties for serialized behavior

Open benkehoe opened this issue 5 years ago • 6 comments

I'd like to create an AWS::S3::BucketNotification resource to fix a longstanding problem in CloudFormation. And when I do, I'd like to enable individual notification configuration items to be managed separately. But because the API only supports updating the entire notification configuration, I need to serialize access to the notification configuration for a given bucket. I plan to do with a resource provider that relies on a user-account-side mechanism involving an SQS FIFO queue. It would be great if, in my schema, I could specify a property or set of properties that would cause all resources with the same values for those properties to have their requests serialized (but resources with different values for those properties could be processed in parallel).

benkehoe avatar Feb 01 '20 00:02 benkehoe

I like this concept, it's going to take some thinking on how to support this in the service.

rjlohan avatar Feb 01 '20 15:02 rjlohan

Another use case is that the CloudFormation type registry only allows one in-flight operation at a time on a given type. So if I have multiple AWS::CloudFormation::ResourceVersion resources with the same TypeName, I need to manually serialize those resources using DependsOn (example).

benkehoe avatar Jun 09 '20 22:06 benkehoe

Adding DynamoDB tables as a use case (from the docs):

AWS CloudFormation typically creates DynamoDB tables in parallel. However, if your template includes multiple DynamoDB tables with indexes, you must declare dependencies so that the tables are created sequentially. Amazon DynamoDB limits the number of tables with secondary indexes that are in the creating state. If you create multiple tables with indexes at the same time, DynamoDB returns an error and the stack operation fails.

benbridts avatar Jun 10 '20 10:06 benbridts

Adding DynamoDB tables as a use case

This might be a separate request, as it is a global concurrency limit (possibly soft), rather than a strict serialization based on the value of a property or set of properties. I'm tempted to say such a concurrency limit belongs in the registry API rather than the schema.

benkehoe avatar Jun 10 '20 11:06 benkehoe

This might be a separate request

You're right. In cases where ordering doesn't matter Concurrency: 1 could also solve the serialization (if it can be currently solved with DependsOn).

@rjlohan If i create a new ticket for that, should it go in the Coverage Roadmap?

benbridts avatar Jun 11 '20 08:06 benbridts

This might be a separate request

You're right. In cases where ordering doesn't matter Concurrency: 1 could also solve the serialization (if it can be currently solved with DependsOn).

@rjlohan If i create a new ticket for that, should it go in the Coverage Roadmap?

Yeah put it there. It'll require at least some service side changes to understand the directive whether it comes from template or type schemas.

rjlohan avatar Jun 11 '20 14:06 rjlohan