但是provider:
name: aws
runtime: nodejs8.10
profile: default
region: us-east-1
memorySize: 512
target: 'node' # Below defined environment variables wont be accessible in lambda functions.
stage: ${opt:stage, 'dev'}
environment:
USERS_TABLE: Users_${self:provider.stage}
DAILYACTIVITY_TABLE: DailyActivity_${self:provider.stage}
plugins:
- serverless-dynamodb-local
- serverless-offline
custom:
dynamodb:
start:
migrate: true
resources:
Resources:
usersTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: emailid
AttributeType: S
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: emailid
KeyType: HASH
GlobalSecondaryIndexes:
- IndexName: gsi_id
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TableName: ${self:provider.environment.USERS_TABLE}
activityTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: date
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
- AttributeName: date
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TableName: ${self:provider.environment.DAILYACTIVITY_TABLE}不会从资源部分创建表。
请提出上述配置有什么问题。