forked from chief-wizard/serverless-appsync-chat-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
executable file
·65 lines (60 loc) · 1.82 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
service: ServerlessAppSyncChat
plugins:
- serverless-stack-output
- serverless-appsync-plugin
package:
exclude:
- ./front/**
- front/**
- ./node_modules/**
- node_modules/**
provider:
name: aws
runtime: nodejs8.10
region: ${opt:region, 'us-east-1'}
custom:
stage: dev
output:
file: ./front/src/stack.json
appSync:
name: ${self:service}-${self:custom.stage}
authenticationType: AMAZON_COGNITO_USER_POOLS
userPoolConfig:
awsRegion: ${self:provider.region}
defaultAction: ALLOW
userPoolId: { Fn::GetAtt: [CognitoUserPool, Arn] }
logConfig:
loggingRoleArn: { Fn::GetAtt: [AppSyncLoggingServiceRole, Arn] }
level: ALL
mappingTemplates:
- dataSource: Messages
type: Mutation
field: createMessage
request: "createMessage-request-mapping-template.txt"
response: "createMessage-response-mapping-template.txt"
- dataSource: Messages
type: Query
field: getMessages
request: "getMessages-request-mapping-template.txt"
response: "getMessages-response-mapping-template.txt"
schema: schema.graphql
dataSources:
- type: AMAZON_DYNAMODB
name: Messages
description: Messages Table
config:
tableName: { Ref: MessagesTable }
serviceRoleArn: { Fn::GetAtt: [AppSyncDynamoDBServiceRole, Arn] }
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:*"
Resource:
- "arn:aws:dynamodb:::table/Messages"
- "arn:aws:dynamodb:::table/Messages/*"
resources:
- ${file(resources/roles.yml)}
- ${file(resources/cognito-user-pool.yml)}
- ${file(resources/cognito-identity-pool.yml)}
- ${file(resources/dynamodb-table.yml)}
- ${file(resources/outputs.yml)}