This file contains 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
const graphQLDataSourceName = "graphQLDataSource_manual"; | |
const graphQLResolvers = []; | |
glob.sync('./graphql/resolvers/**/*.js').forEach(function (file) { | |
const resolverMatches = findMatches(/([a-zA-Z]+)\./g, file); | |
const resolverObject = require(path.resolve(file)); | |
const graphQLResolver = new aws.appsync.Resolver(`graphQLResolver_${resolverMatches.join('_')}`, { | |
apiId: graphQLApi.id, | |
dataSource: graphQLDataSourceName, | |
field: resolverMatches[1], |
This file contains 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 CreatePetInput { | |
type: PetType | |
price: Float! | |
} | |
input DeletePetInput { | |
id: ID! | |
} | |
type Mutation { |
This file contains 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"; | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// node dependencies | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
const fs = require('fs'); | |
const glob = require('glob'); | |
const path = require('path'); | |
// Add the ability to read .graphql files as strings. |
This file contains 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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// AppSync | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Read the GraphQL Schema as a string. | |
const graphQLSchema = require('./schema.graphql'); | |
const graphQLApiCloudWatchLogsRole = new aws.iam.Role("graphQLApiCloudWatchLogsRole", { | |
assumeRolePolicy: JSON.stringify({ | |
"Version": "2012-10-17", |
This file contains 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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Aurora Serverless | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
const dbCluster = new aws.rds.Cluster("dbCluster", { | |
applyImmediately: true, | |
clusterIdentifier: "mycluster", | |
engineMode: "serverless", | |
iamDatabaseAuthenticationEnabled: false, | |
port: 3306, |
This file contains 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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Cognito | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
const userPool = new aws.cognito.UserPool("userPool", { | |
autoVerifiedAttributes: ["email"], | |
}); | |
const userPoolClient = new aws.cognito.UserPoolClient("userPoolClient", { | |
allowedOauthFlows: ["code"], |
This file contains 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
import 'package:amazon_cognito_identity_dart/cognito.dart'; | |
import 'package:amazon_cognito_identity_dart/sig_v4.dart'; | |
import 'package:http/http.dart' as http; | |
class Credentials { | |
final CognitoCredentials _cognitoCredentials; | |
final String _token; | |
final String _authenticator; | |
Credentials(String identityPoolId, String userPoolId, String clientId, this._token, [this._authenticator]) |
NewerOlder