class Billing
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.DynamoDB.Billing |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#Billing |
![]() | software.amazon.awscdk.services.dynamodb.Billing |
![]() | aws_cdk.aws_dynamodb.Billing |
![]() | aws-cdk-lib » aws_dynamodb » Billing |
Represents how capacity is managed and how you are charged for read and write throughput for a DynamoDB table.
Example
import * as cdk from 'aws-cdk-lib';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack', { env: { region: 'us-west-2' } });
const globalTable = new dynamodb.TableV2(stack, 'GlobalTable', {
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
billing: dynamodb.Billing.provisioned({
readCapacity: dynamodb.Capacity.fixed(10),
writeCapacity: dynamodb.Capacity.autoscaled({ maxCapacity: 15 }),
}),
replicas: [
{
region: 'us-east-1',
},
{
region: 'us-east-2',
readCapacity: dynamodb.Capacity.autoscaled({ maxCapacity: 20, targetUtilizationPercent: 50 }),
},
],
});
Properties
Name | Type | Description |
---|---|---|
mode | Billing |
mode
Type:
Billing
Methods
Name | Description |
---|---|
static on | Flexible billing option capable of serving requests without capacity planning. |
static provisioned(props) | Specify the number of reads and writes per second that you need for your application. |
static onDemand(props?)
public static onDemand(props?: MaxThroughputProps): Billing
Parameters
- props
Max
Throughput Props
Returns
Flexible billing option capable of serving requests without capacity planning.
Note: Billing mode will be PAY_PER_REQUEST.
static provisioned(props)
public static provisioned(props: ThroughputProps): Billing
Parameters
- props
Throughput
— specify read and write capacity configurations.Props
Returns
Specify the number of reads and writes per second that you need for your application.