Skip to content

Instantly share code, notes, and snippets.

@kcwinner
kcwinner / distributed-map-custom.ts
Last active December 2, 2022 19:18
Distributed map with AWS CDK using custom state
import { Map, CustomState } from "aws-cdk-lib/aws-stepfunctions";
export class MyStack extends Stack {
constructor(scope: App, id: string, props: StackProps) {
const mapJob = new Map(this, "Map", {
itemsPath: "$.Items",
parameters: {
"Item.$": "$$.Map.Item.Value",
...props.mapProps.parameters,
import { execSync } from 'child_process';
import * as path from 'path';
import { Readable } from 'stream';
import * as zlib from 'zlib';
import * as fs from 'fs-extra';
import * as tar from 'tar-fs';
import * as yargs from 'yargs';
import { JsiiType } from '../../inventory';
@kcwinner
kcwinner / app.py
Last active October 13, 2023 04:59
Call AppSync GraphQL from Python Lambda Function
from lib import appsync
def lambda_handler(event, context):
print(event)
input = {
'name': 'test123',
'description': 'some cool description'
}
@kcwinner
kcwinner / generateDataStoreModels.js
Created May 18, 2020 18:47
Simple generation for Amplify DataStore Models if you are not using amplify
const path = require('path');
const { readFileSync, writeFileSync, ensureFileSync, pathExistsSync } = require('fs-extra');
const { parse } = require('graphql'); // Requires version ^14.5.8
const gqlCodeGen = require('@graphql-codegen/core'); // Requires version ^1.8.3
const appSyncDataStoreCodeGen = require('amplify-codegen-appsync-model-plugin');
const scalars = {
ID: "string",
String: "string",
Int: "number",
@kcwinner
kcwinner / exampleModelGen.js
Created May 7, 2020 14:17
Simple example emulating custom model gen outside of amplify
const path = require('path');
const { readFileSync, writeFileSync, ensureFileSync, pathExistsSync } = require('fs-extra');
const { parse } = require('graphql');
const gqlCodeGen = require('@graphql-codegen/core');
const appSyncDataStoreCodeGen = require('amplify-codegen-appsync-model-plugin');
generate();
async function generate() {
const schemaContent = loadSchema('./schema.graphql');

Keybase proof

I hereby claim:

  • I am kcwinner on github.
  • I am kenwin0x539 (https://keybase.io/kenwin0x539) on keybase.
  • I have a public key ASAFpYqlp6kyMtWcqmMMSAKCjzvw81K7x91M_vjaefa0rQo

To claim this, I am signing this object: