This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #set($id = $ctx.stash.get("locationId")+"-"+$context.stash.get("owner")) | |
| { | |
| "operation": "PutItem", | |
| "key": { | |
| "id": $util.dynamodb.toDynamoDBJson($id), | |
| "typeName": $util.dynamodb.toDynamoDBJson("FAVORITE") | |
| }, | |
| "attributeValues": { | |
| "owner": $util.dynamodb.toDynamoDBJson($context.stash.get("owner")), | |
| "locationId": $util.dynamodb.toDynamoDBJson($context.stash.get("locationId")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $util.qr($context.args.location.put("owner", $context.identity.username)) | |
| $util.qr($context.args.location.put("lastUpdated", $util.time.nowISO8601())) | |
| { | |
| "version": "2017-02-28", | |
| "operation": "PutItem", | |
| "key": { | |
| "id": $util.dynamodb.toDynamoDBJson($util.autoId()), | |
| "typeName": $util.dynamodb.toDynamoDBJson("LOCATION") | |
| }, | |
| "attributeValues": $util.dynamodb.toMapValuesJson($context.args.location) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AuthRole: | |
| Type: AWS::IAM::Role | |
| Properties: | |
| RoleName: ${self:custom.api}-auth | |
| AssumeRolePolicyDocument: | |
| Version: "2012-10-17" | |
| Statement: | |
| - Effect: Allow | |
| Principal: | |
| Federated: cognito-identity.amazonaws.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| functions: | |
| dynamodb_stream: | |
| handler: elasticsearch.lambda_handler | |
| name: ${self:custom.api}-dynamodb_stream_handler | |
| description: Stream data from DynamoDB to ElasticSearch | |
| runtime: python3.6 | |
| memorySize: 128 | |
| role: ElasticSearchStreamingLambdaIAMRole | |
| environment: | |
| ES_ENDPOINT: { Fn::GetAtt: [ ElasticSearchDomain, DomainEndpoint ]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ElasticSearchStreamingLambdaIAMRole: | |
| Type: AWS::IAM::Role | |
| Properties: | |
| RoleName: ${self:custom.api}-ESStreamingLambdaRole | |
| AssumeRolePolicyDocument: | |
| Version: "2012-10-17" | |
| Statement: | |
| - Effect: Allow | |
| Principal: | |
| Service: "lambda.amazonaws.com" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| custom: | |
| # The base name of the API for resource generation - can't include dashes | |
| # [a-zA-Z0-9]+ only | |
| api: ${self:provider.stage}RestaurantReviews | |
| # ES Domain, must match [a-z][a-z0-9\-]+ | |
| es_domain: ${self:provider.stage}-restaurant-reviews | |
| # The number of instances to launch into the ElasticSearch domain | |
| es_instanceCount: 1 | |
| # The type of instance to launch into the ElasticSearch domain | |
| es_instanceType: "t2.small.elasticsearch" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ElasticSearchDomain: | |
| Type: AWS::Elasticsearch::Domain | |
| Properties: | |
| DomainName: ${self:custom.es_domain} | |
| ElasticsearchVersion: "6.2" | |
| ElasticsearchClusterConfig: | |
| ZoneAwarenessEnabled: false | |
| InstanceCount: ${self:custom.es_instanceCount} | |
| InstanceType: ${self:custom.es_instanceType} | |
| EBSOptions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DynamoDBTable: | |
| Type: AWS::DynamoDB::Table | |
| Properties: | |
| TableName: ${self:custom.api} | |
| KeySchema: | |
| - AttributeName: id | |
| KeyType: HASH | |
| - AttributeName: typeName | |
| KeyType: RANGE | |
| AttributeDefinitions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input PagingRequest { | |
| limit: Int | |
| nextToken: String | |
| } | |
| type User { | |
| id: ID! | |
| name: String | |
| locations(paging: PagingRequest): LocationPagingConnection | |
| reviews(paging: PagingRequest): ReviewPagingConnection |