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
// create a handler for registration | |
SignUpHandler handler = new SignUpHandler() { | |
@Override | |
public void onSuccess(CognitoUser user, CognitoUserCodeDeliveryDetails codeDeliveryDetails) { | |
// If the sign up was successful, "user" is a CognitoUser object of the user who was signed up. | |
// "codeDeliveryDetails" will contain details about where the confirmation codes will be delivered. | |
} | |
@Override | |
public void onFailure(Exception exception) { |
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
AWSCognitoIdentityUserAttributeType * phone = [AWSCognitoIdentityUserAttributeType new]; | |
phone.name = @"phone_number"; | |
//phone number must be prefixed by country code | |
phone.value = @"+15555555555"; | |
AWSCognitoIdentityUserAttributeType * email = [AWSCognitoIdentityUserAttributeType new]; | |
email.name = @"email"; | |
email.value = @"email@mydomain.com"; | |
//register the user | |
[[pool signUp:@"username" password:@"password" userAttributes:@[email,phone] validationData:nil] continueWithBlock:^id _Nullable(AWSTask<AWSCognitoIdentityUserPoolSignUpResponse *> * _Nonnull task) { |
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
//env variable for aws profile | |
process.env.AWS_PROFILE = "your_profile"; | |
const axios = require("axios").default; | |
const AWS = require("aws-sdk"); | |
const regions = ["us-west-1", "us-west-2"] | |
const SLACK_URL = "https://hooks.slack.com/services/CHANGE"; | |
async function getAllStacks(cloudformation){ |
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
package main | |
import ( | |
"net/http" | |
"encoding/json" | |
"math/rand" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" |
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
# Multi-stage layout | |
FROM golang:1.12 as builder | |
ENV GO111MODULE=on | |
WORKDIR /app | |
COPY go.mod . | |
COPY go.sum . |
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/core"); | |
import ecr = require("@aws-cdk/aws-ecr"); | |
import ecs = require("@aws-cdk/aws-ec2"); | |
import ecs_patterns = require('@aws-cdk/aws-ecs-patterns'); | |
export default class EcsGoAPIStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps){ | |
super(scope, id, props); | |
const ecrRepo = new ecr.Repository(this, "GoAPI", { |
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 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 ec2 from "@aws-cdk/aws-ec2"; | |
import * as cdk from '@aws-cdk/core'; | |
export class MyEc2AppStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
// Create new VPC | |
const vpc = new ec2.Vpc(this, 'VPC'); | |
// Open port 22 for SSH connection from anywhere |
OlderNewer