What's the point of the Quantity field in CloudFront's create_invalidation call?

Viewed 317

The CloudFront create_invalidation API lets you specify a Quantity which seems redundant. Is there a use case for setting a Quantity different from the length of Items?

response = client.create_invalidation(
  DistributionId = 'string',
  InvalidationBatch = {
    'Paths': {
      'Quantity': 2,
      'Items': [
        '/index.html',
        '/image.png',
      ]
    },
    'CallerReference': 'string'
  }
)
1 Answers

The documentation says that the quantity field is required, and integer, and "The number of invalidation paths specified for the objects that you want to invalidate."

One usecase for supplying a smaller number than the number of items might be: sending more data than necessary to the AWS API.

A usecase for supplying a larger number might be: trying to trigger an error condition in the AWS API.

I would suggest just using the API as documented.

Related