Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created November 28, 2018 21:21
Show Gist options
  • Save adrianhall/88141c6b2dfa1b767c0987d6f97d7433 to your computer and use it in GitHub Desktop.
Save adrianhall/88141c6b2dfa1b767c0987d6f97d7433 to your computer and use it in GitHub Desktop.
custom:
# AWS AppSync GraphQL configuration
appSync:
name: ${self:custom.api}
authenticationType: AWS_IAM
logConfig:
loggingRoleArn: { Fn::GetAtt: [ AppSyncLoggingServiceRole, Arn ]}
level: ALL
schema: ./schema.graphql
dataSources:
- type: AMAZON_DYNAMODB
name: DynamoDB
config:
tableName: { Ref: DynamoDBTable }
iamRoleStatements:
- Effect: Allow
Action:
- "dynamodb:PutItem"
Resource:
- { Fn::GetAtt: [ DynamoDBTable, Arn ]}
- { Fn::Join: [ "/", [{ Fn::GetAtt: [ DynamoDBTable, Arn ]}, "*" ]]}
- type: AMAZON_ELASTICSEARCH
name: ElasticSearch
config:
endpoint: { Fn::Join: [ "", [ "https://", { Fn::GetAtt: [ ElasticSearchDomain, DomainEndpoint ]} ]]}
iamRoleStatements:
- Effect: Allow
Action:
- "es:ESHttpGet"
Resource:
- { Fn::GetAtt: [ ElasticSearchDomain, DomainArn ]}
mappingTemplates:
- type: Mutation
field: addLocation
dataSource: DynamoDB
request: Mutation-addLocation-request.vtl
response: Mutation-addLocation-response.vtl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment