#✅ - Amplify storage override to change billing mode

1 messages · Page 1 of 1 (latest)

vast oar
#

I'm trying to change the billing mode of one of my tables but the cloud formation created by Amplify it doesn't work.

🛑 The following resources failed to deploy:
Resource Name: storagexxx (AWS::CloudFormation::Stack)
Event Type: update
Reason: Parameters: [partitionKeyType, partitionKeyName, sortKeyName, sortKeyType, tableName] must have values
URL:...

#

override.ts

[...]  resources.dynamoDBTable.billingMode = 'PAY_PER_REQUEST';
  resources.dynamoDBTable.tags.setTag('tableName', tableName);
  resources.dynamoDBTable.globalSecondaryIndexes = [
    {
      indexName: 'byApexAccount',
      partitionKey: {
        name: 'apexAccount',
        type: AttributeType.BINARY
      },
      sortKey: {
        name: 'SK',
        type: AttributeType.BINARY
      }
    },
    {
      indexName: 'byCreatedAt',
      partitionKey: {
        name: 'PK',
        type: AttributeType.BINARY
      },
      sortKey: {
        name: 'createdAt',
        type: AttributeType.BINARY
      }
    },
    {
      indexName: 'byAltId',
      partitionKey: {
        name: 'altId',
        type: AttributeType.BINARY
      }
    },
    {
      indexName: 'byId',
      partitionKey: {
        name: 'SK',
        type: AttributeType.BINARY
      }
    },
    {
      indexName: 'byEntityType',
      partitionKey: {
        name: 'entityType',
        type: AttributeType.BINARY
      },
      sortKey: {
        name: 'SK',
        type: AttributeType.BINARY
      }
    },
    {
      indexName: 'byEntityQuery',
      partitionKey: {
        name: 'entityType',
        type: AttributeType.BINARY
      },
      sortKey: {
        name: 'entityQuery',
        type: AttributeType.BINARY
      }
    },
    {
      indexName: 'byEntityStatus',
      partitionKey: {
        name: 'entityType',
        type: AttributeType.BINARY
      },
      sortKey: {
        name: 'entityStatus',
        type: AttributeType.BINARY
      }
    }
  ];
}

#

Unless there's a secret fatality this means that is impossible through amplify available mechanisms to set the table billing to ON DEMAND

velvet pelican
terse charmBOT
#

✅ - Amplify storage override to change billing mode