Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dynamodb): add seedCapacity property to AutoscaledCapacityOptions interface to support changing table billing #27735

Closed
2 tasks
colifran opened this issue Oct 27, 2023 · 1 comment · Fixed by #27734
Labels
@aws-cdk/aws-dynamodb Related to Amazon DynamoDB effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@colifran
Copy link
Contributor

Describe the feature

This feature would be a simple property that gets added to the AutoscaledCapacityOptions interface as part of the Capacity class:

export interface AutoscaledCapacityOptions {
  // ...

  /**
   * If you want to switch a table's billing mode from on-demand to provisioned or
   * from provisioned to on-demand, you must specify a value for this property for
   * each autoscaled resource.
   *
   * @default no seed capacity
   */
  readonly seedCapacity?: number;
}

If this property is provided during construction, autoscaled capacity would be rendered with a seedCapacity property:

private renderAutoscaledCapacity() {
  return {
    minCapacity: options.minCapacity ?? 1,
    maxCapacity: options.maxCapacity,
    seedCapacity: options.seedCapacity,
    targetTrackingScalingPolicyConfiguration: {
      targetValue: options.targetUtilizationPercent ?? 70,
    },
  };
}

Use Case

When working with the TableV2 construct, you're currently unable to update a table's billing from on-demand to provisioned or from provisioned to on-demand. Doing so results in the following deployment error:

Invalid request provided: When switching billing mode to OnDemand, the previous template must specify a value for all autoscaled resources, so that Cloudformation can rollback if needed

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.103.1

Environment details (OS name and version, etc.)

MacOS

@colifran colifran added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. p2 @aws-cdk/aws-dynamodb Related to Amazon DynamoDB and removed needs-triage This issue or PR still needs to be triaged. labels Oct 27, 2023
@colifran colifran added the effort/small Small work item – less than a day of effort label Oct 27, 2023
@mergify mergify bot closed this as completed in #27734 Nov 1, 2023
mergify bot pushed a commit that referenced this issue Nov 1, 2023
…billing mode (#27734)

This PR adds `seedCapacity` as a property on the `AutoscaledCapacityOptions` interface. `seedCapacity` must be provided for each autoscaled resource when changing a table's billing from on-demand to provisioned or from provisioned to on-demand.

Closes #27735.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

github-actions bot commented Nov 1, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-dynamodb Related to Amazon DynamoDB effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant