Last active
December 26, 2020 21:27
-
-
Save bboure/a5a5cec724188ac652757b8cc0667cbf to your computer and use it in GitHub Desktop.
appsync-long-cache-demo-serverless.yml
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
mappingTemplates: | |
- type: Query | |
field: wikipedia | |
kind: PIPELINE | |
functions: | |
- fetchFromCache | |
- fetchWikipedia | |
- saveToCache | |
dataSources: | |
- type: HTTP | |
name: wikipedia | |
description: 'Wikipedia api' | |
config: | |
endpoint: https://en.wikipedia.org | |
- type: AMAZON_DYNAMODB | |
name: wikicache | |
description: 'Wikipedia cached titles' | |
config: | |
tableName: | |
Ref: WikipediaTable | |
functionConfigurations: | |
- dataSource: wikicache | |
name: fetchFromCache | |
- dataSource: wikicache | |
name: saveToCache | |
- dataSource: wikipedia | |
name: fetchWikipedia | |
resources: | |
Resources: | |
WikipediaTable: | |
Type: AWS::DynamoDB::Table | |
Properties: | |
TableName: wikipedia | |
BillingMode: PAY_PER_REQUEST | |
TimeToLiveSpecification: | |
AttributeName: expires_at | |
Enabled: true | |
AttributeDefinitions: | |
- AttributeName: title | |
AttributeType: S | |
- AttributeName: expires_at | |
AttributeType: N | |
KeySchema: | |
- AttributeName: title | |
KeyType: HASH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment