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 { APIGatewayEvent, Context, Callback } from "aws-lambda"; | |
import { MongoClient } from "mongodb"; | |
import { generate } from "shortid"; | |
import { connectToDB, success } from "./lib"; | |
const DB_NAME = process.env.DB_NAME as string; | |
let dbClient: MongoClient; | |
export async function handler(event: APIGatewayEvent, context: Context, callback: Callback){ | |
try { |
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 { APIGatewayEvent, Context, Callback } from "aws-lambda"; | |
import { connectToDB, success, redirect, notFound } from "./lib"; | |
import { MongoClient } from "mongodb"; | |
const DB_NAME = process.env.DB_NAME as string; | |
let dbClient: MongoClient; | |
export async function handler(event: APIGatewayEvent, context: Context, callback: Callback) { |
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 * as cdk from "@aws-cdk/core"; | |
import * as lambda from "@aws-cdk/aws-lambda"; | |
import * as apigateway from "@aws-cdk/aws-apigateway"; | |
import * as docdb from "@aws-cdk/aws-docdb"; | |
import * as ec2 from "@aws-cdk/aws-ec2"; | |
import { config } from "dotenv"; | |
config(); | |
class DocdbLambdaAPIStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { |
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 sys | |
from awsglue.transforms import * | |
from awsglue.utils import getResolvedOptions | |
from pyspark.context import SparkContext | |
from awsglue.context import GlueContext | |
from awsglue.dynamicframe import DynamicFrame | |
from awsglue.job import Job | |
args = getResolvedOptions(sys.argv, ['JOB_NAME']) | |
jdbc_url = "jdbc:mongodb:RTK=RTK_REPLACE;Server=SERVER_REPLACE;User=USER_REPLACE;Password=PASSWORD_REPLACE;Port=PORT_REPLACE;Use SSL=USE_SSL_REPLACE;Database=DATABASE_REPLACE;" |
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 * as cdk from "@aws-cdk/core"; | |
import * as glue from "@aws-cdk/aws-glue"; | |
import * as s3 from "@aws-cdk/aws-s3"; | |
import * as s3Deployment from "@aws-cdk/aws-s3-deployment"; | |
import * as iam from "@aws-cdk/aws-iam"; | |
import { replaceValues } from "./lib"; | |
import { config } from "dotenv"; | |
config(); | |
const PYTHON_VERSION = "3"; |
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 * as cdk from "@aws-cdk/core"; | |
import * as ec2 from "@aws-cdk/aws-ec2"; | |
import * as batch from "@aws-cdk/aws-batch"; | |
import * as iam from "@aws-cdk/aws-iam"; | |
import * as lambda from "@aws-cdk/aws-lambda"; | |
import * as events from "@aws-cdk/aws-events"; | |
import * as targets from "@aws-cdk/aws-events-targets"; | |
import { readFileSync } from "fs"; | |
import { config } from "dotenv"; | |
config(); |
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 cdk = require('@aws-cdk/core'); | |
const pinpoint = require("@aws-cdk/aws-pinpoint"); | |
require('dotenv').config(); | |
class PinpointStack extends cdk.Stack { | |
constructor(scope, id, props) { | |
super(scope, id, props); | |
const pinpointProject = new pinpoint.CfnApp(this, "project", { | |
name: "pinpoint-project" |
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 cdk = require("@aws-cdk/core"); | |
const lambda = require("@aws-cdk/aws-lambda"); | |
const events = require("@aws-cdk/aws-events"); | |
const targets = require("@aws-cdk/aws-events-targets"); | |
const iam = require("@aws-cdk/aws-iam"); | |
require('dotenv').config(); | |
class CallServiceStack extends cdk.Stack { | |
constructor(scope, id, props) { | |
super(scope, id, props); |
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 inquirer = require("inquirer"); | |
const replace = require('replace-in-file'); | |
const { execSync } = require("child_process"); | |
require('dotenv').config(); | |
const promptQuestions = [{ | |
type: 'input', | |
name: 'longCode', | |
message: "What's the long-code (telephone number) you've created in Pinpoint console? Use the following formatting +12024104849", | |
}]; |
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 { execSync } = require("child_process"); | |
execSync(`cdk destroy --app='node PinpointStack.js' PinpointStack`, {stdio: 'inherit'}); | |
execSync(`cdk destroy --app='node CallServiceStack.js' CallServiceStack`, {stdio: 'inherit'}); |