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
# top secret AppSync GQL directives AWS doesn't want you to know about! | |
scalar AWSDate | |
scalar AWSTime | |
scalar AWSDateTime | |
scalar AWSTimestamp | |
scalar AWSEmail | |
scalar AWSJSON | |
scalar AWSURL | |
scalar AWSPhone |
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 middy, { MiddlewareObj } from '@middy/core' | |
import httpErrorHandler from '@middy/http-error-handler' | |
import httpHeaderNormalizer from '@middy/http-header-normalizer' | |
import httpJsonBodyParser from '@middy/http-json-body-parser' | |
import { APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2, Handler } from 'aws-lambda' | |
import { zodValidator } from 'middy-zod-validator' | |
import { ZodSchema, z, infer as ZInfer } from 'zod' | |
import { isHttpError } from 'http-errors' |
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
# AWS AppSync GQL directives | |
# | |
## Scalars come from here: | |
# https://raw.githubusercontent.com/aws-amplify/amplify-cli/master/packages/amplify-graphql-types-generator/awsAppSyncDirectives.graphql | |
# https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html | |
# | |
## Directives came from a GitHub issue here: | |
# https://github.com/apollographql/eslint-plugin-graphql/issues/263 | |
## And comparing with the JSON output of | |
# https://docs.aws.amazon.com/appsync/latest/APIReference/API_GetIntrospectionSchema.html |
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 cdk = require("aws-cdk-lib"); | |
import ec2 = require("aws-cdk-lib/aws-ec2"); | |
import elastic = require("aws-cdk-lib/aws-elasticache"); | |
import rds = require("aws-cdk-lib/aws-rds"); | |
import es = require("aws-cdk-lib/aws-elasticsearch"); | |
import ecs = require("aws-cdk-lib/aws-ecs"); | |
import s3 = require("aws-cdk-lib/aws-s3"); | |
import elbv2 = require("aws-cdk-lib/aws-elasticloadbalancingv2"); | |
import route53 = require("aws-cdk-lib/aws-route53"); | |
import certificateManager = require("aws-cdk-lib/aws-certificatemanager"); |
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
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
/* eslint-disable @typescript-eslint/no-non-null-assertion */ | |
import * as sst from '@serverless-stack/resources'; | |
import { Function, getStack } from '@serverless-stack/resources'; | |
import { Match, Template } from 'aws-cdk-lib/assertions'; | |
import { useBaseInfra } from 'stacks'; | |
import { test } from 'vitest'; | |
import { Functions } from './functions'; | |
function TestStack({ stack }: sst.StackContext) { |
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
/** | |
* CloudFormation exports. Unique per-region. | |
*/ | |
export enum StackExports { | |
GREMLIN_PORT = "GremlinPort", | |
GREMLIN_ENDPOINT = "GremlinEndpoint" | |
} | |
/** |
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 { Construct } from "constructs" | |
import { Code, LayerVersion, LayerVersionProps } from "aws-cdk-lib/aws-lambda" | |
import { AssetHashType, IgnoreMode } from "aws-cdk-lib" | |
import crypto from "crypto" | |
import path from "path" | |
import { getProjectRoot } from "./paths" | |
import { DEFAULT_RUNTIME } from "../stacks" | |
// deps to npm install to the layer | |
const PRISMA_DEPS = ["prisma", "@prisma/migrate", "@prisma/sdk", "@prisma/client"] |
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
/* | |
- Enable IAM authentication | |
- Grant IAM permission to lambda function | |
*/ | |
import { HttpRequest } from "@aws-sdk/protocol-http" | |
import { parseUrl } from "@aws-sdk/url-parser" | |
import { Response, got, RequestError } from "got" | |
import { GraphQLResponse } from "graphql-request/dist/types" | |
import { signHttpRequest } from "./signedAwsRequest" |
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 { createProjectSync, ts } from "@ts-morph/bootstrap" | |
import * as fs from "fs" | |
import * as path from "path" | |
import { default as SimpleMarkdown } from "simple-markdown" | |
describe("README examples", () => { | |
const readmePath = path.join(__dirname, "..", "..", "README.md") | |
const readmeContents = fs.readFileSync(readmePath) | |
// extract examples |
NewerOlder