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
| Resources: | |
| AppSyncLambdaServiceRole: | |
| Type: "AWS::IAM::Role" | |
| Properties: | |
| RoleName: "${self:custom.appSync.serviceRole}-${self:provider.stage}" | |
| AssumeRolePolicyDocument: | |
| Version: "2012-10-17" | |
| Statement: | |
| - Effect: "Allow" | |
| Principal: |
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
| Resources: | |
| VPC: | |
| Type: AWS::EC2::VPC | |
| Properties: | |
| CidrBlock: 10.0.0.0/16 | |
| InstanceTenancy: default | |
| PublicSubnet: | |
| Type: AWS::EC2::Subnet | |
| Properties: |
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
| "use strict"; | |
| const AWS = require("aws-sdk"); | |
| const Sequelize = require("sequelize"); | |
| //connect to rds aurora | |
| const sequelize = new Sequelize( | |
| process.env.DATABASE_NAME, | |
| process.env.DATABASE_USERNAME, | |
| process.env.DATABASE_PASSWORD, | |
| { |
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 PostInput { | |
| title: String | |
| content: String | |
| notificationEmails: String | |
| createdAt: String | |
| } | |
| type Mutation { | |
| addPost(post: PostInput!): Post | |
| deletePost(id: Int!): Post |
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 PostInput { | |
| title: String | |
| content: String | |
| } | |
| type Mutation { | |
| addPost(post: PostInput!): Post | |
| } | |
| type Post { |
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: | |
| poolName: ${self:provider.stage}SimpleCMS | |
| dbName: "simpleCMS" | |
| daxIamRole: ${self:service.name}DaxIamRole | |
| postsTable: ${self:provider.stage}Posts | |
| systemUserEmail: "yi.ai@neami.app" | |
| daxClusterName: "myDynamodbDax" | |
| tableThroughput: 5 | |
| appSync: | |
| region: ${self:provider.region} |
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
| DaxIamRole: | |
| Type: AWS::IAM::Role | |
| Properties: | |
| RoleName: ${self:service.name}dax | |
| AssumeRolePolicyDocument: | |
| Version: "2012-10-17" | |
| Statement: | |
| - Effect: "Allow" | |
| Principal: | |
| Service: |
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
| "use strict"; | |
| const AWS = require("aws-sdk"); | |
| const uuidv4 = require("uuid/v4"); | |
| const AmazonDaxClient = require("amazon-dax-client"); | |
| const dax = new AmazonDaxClient({ | |
| endpoints: process.env.DAX_ENDPOINT, | |
| region: process.env.AWS_DEFAULT_REGION | |
| }); | |
| const documentClient = new AWS.DynamoDB.DocumentClient({ service: dax }); |
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: | |
| appSync: | |
| mappingTemplates: | |
| - type: Mutation | |
| dataSource: AWSSES | |
| field: sendNotification | |
| request: Mutation-sendNotification-request.vtl | |
| response: Mutation-sendNotification-response.vtl | |
| dataSources: | |
| - type: HTTP |
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
| Resources: | |
| AppSyncSESserviceRole: | |
| Type: "AWS::IAM::Role" | |
| Properties: | |
| RoleName: ${self:custom.appSync.serviceRole}-appsync-ses | |
| AssumeRolePolicyDocument: | |
| Version: "2012-10-17" | |
| Statement: | |
| - Effect: "Allow" | |
| Principal: |