I have table definition in the serverless.yml as the following:-
resources:
Resources:
EnotifyDbTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: MessageStatusAudit1
AttributeDefinitions:
- AttributeName: MessageId
AttributeType: S
- AttributeName: Phonenumber
AttributeType: S
- AttributeName: Timestamp
AttributeType: S
KeySchema:
- AttributeName: MessageId
KeyType: HASH
- AttributeName: Timestamp
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
GlobalSecondaryIndexes:
- IndexName: MessageStatusPhonenumberTimestampGSIndex
KeySchema:
- AttributeName: Phonenumber
KeyType: HASH
- AttributeName: Timestamp
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
Projection:
ProjectionType: ALL
And for the auto scaling definition is as follows
custom:
capacities:
- table: MessageStatusAudit1 # DynamoDB Resource
index: MessageStatusPhonenumberTimestampGSIndex
read:
minimum: 5 # Minimum read capacity
maximum: 1000 # Maximum read capacity
usage: 0.75 # Targeted usage percentage
write:
minimum: 40 # Minimum write capacity
maximum: 200 # Maximum write capacity
usage: 0.5 # Targeted usage percentage
and when i run sls deploy i get the following error:-
Error --------------------------------------------------
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [MessageStatusAudit1] in the Resources block of the template
Where as sls package works fine. Any ideas or thoughts what can i try to fix this issue ?