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 protected]"; | |
//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
// 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
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 |
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
#!/usr/bin/env node | |
import 'source-map-support/register'; | |
import * as cdk from '@aws-cdk/core'; | |
import { MyEc2AppStack } from '../lib/my-ec2-app-stack'; | |
const app = new cdk.App(); | |
new MyEc2AppStack(app, 'MyEc2AppStack', { | |
env: { | |
region: process.env.AWS_REGION, | |
account: process.env.ACCOUNT_ID |
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 asyncio | |
import concurrent.futures | |
import boto3 | |
from timeit import default_timer as timer | |
# Replace with your own AWS profile | |
session = boto3.Session(profile_name="replace_me") | |
regions = ["us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-west-2", "eu-west-3"] | |
async def non_blocking(executor): |
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 * as cdk from "@aws-cdk/core"; | |
import * as ec2 from "@aws-cdk/aws-ec2"; | |
import * as ecs from '@aws-cdk/aws-ecs'; | |
import * as ecs_patterns from '@aws-cdk/aws-ecs-patterns'; | |
import { config } from "dotenv"; | |
config(); | |
class EcsGoAPIStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps){ | |
super(scope, id, props); |
OlderNewer