DynamoDB has two pricing models: provisioned capacity mode and on-demand capacity.
Amplify always creates tables in provisioned capacity mode. is there have an option to have tables get created with on-demand capacity by default ?
C:\user\samadhan\ampplify_project>amplify add storage
? Select from one of the below mentioned services: NoSQL Database
Welcome to the NoSQL DynamoDB database wizard
This wizard asks you a series of questions to help determine how to set up your NoSQL database table.
√ Provide a friendly name · DynamoDB
√ Provide table name · AuthorazationsTable
You can now add columns to the table.
√ What would you like to name this column · id
√ Choose the data type · string
√ Would you like to add another column? (Y/n) · yes
√ What would you like to name this column · name
√ Choose the data type · string
√ Would you like to add another column? (Y/n) · no
Before you create the database, you must specify how items in your table are uniquely organized. You do this by specifying a primary key. The primary key uniquely identifies each item in the table so that no two items can have the same key. This can be an individual column, or a combination that includes a primary key and a sort key.
To learn more about primary keys, see:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey
√ Choose partition key for the table · id
√ Do you want to add a sort key to your table? (Y/n) · yes
√ Choose sort key for the table · name
You can optionally add global secondary indexes for this table. These are useful when you run queries defined in a different column than the primary key.
To learn more about indexes, see:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.SecondaryIndexes
√ Do you want to add global secondary indexes to your table? (Y/n) · no
√ Do you want to add a Lambda Trigger for your Table? (y/N) · no
✅ Successfully added resource DynamoDB locally
C:\user\samadhan\amplify\backend\storage\DynamoDB\cli-inputs.json
{
"resourceName": "DynamoDB",
"tableName": "AuthorazationsTable",
"partitionKey": {
"fieldName": "id",
"fieldType": "string"
},
"sortKey": {
"fieldName": "name",
"fieldType": "string"
},
"gsi": [],
"triggerFunctions": []
}
C:\user\samadhan\amplify\backend\storage\DynamoDB\build\DynamoDB-cloudformation-template.json
{
"Description": "DDB Resource for AWS Amplify CLI",
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"DynamoDBTable": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"KeySchema": [
{
"AttributeName": "id",
"KeyType": "HASH"
},
{
"AttributeName": "name",
"KeyType": "RANGE"
}
],
"AttributeDefinitions": [
{
"AttributeName": "id",
"AttributeType": "S"
},
{
"AttributeName": "name",
"AttributeType": "S"
}
],
"GlobalSecondaryIndexes": [],
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
},
"StreamSpecification": {
"StreamViewType": "NEW_IMAGE"
}
C:\user\samadhan\amplify\backend\storage\DynamoDB\build\parameters.json"
{
"tableName": "SefieAuthorizations",
"partitionKeyName": "id",
"partitionKeyType": "S",
"sortKeyName": "name",
"sortKeyType": "S"
}