Skip to content

Instantly share code, notes, and snippets.

View kylegalbraith's full-sized avatar

Kyle Galbraith kylegalbraith

View GitHub Profile
var mongodb = require('mongodb'),
MongoClient = mongodb.MongoClient,
dbUrl = process.env.MONGOLAB_URI,
urlObj = {},
urlInserted = false,
ids;
function generateRandomId(currIds) {
var randomId = Math.floor(Math.random() * 10000);
if (currIds.indexOf(randomId) < 0) {
@kylegalbraith
kylegalbraith / main.tf
Created March 21, 2018 19:32
terraform 0.11.4 destroy
variable "region" { default = "us-west-2" }
variable "packagePath" { default = "code\\package.zip" }
variable "packageName" { default = "package.zip" }
locals {
packageFile = "${file("${path.module}\\${var.packagePath}")}"
}
provider "aws" {
2018/03/21 12:41:49 [INFO] Terraform version: 0.11.4 7878d66b386e5474102b5047722c2de2b3237278
2018/03/21 12:41:49 [INFO] Go runtime version: go1.10
2018/03/21 12:41:49 [INFO] CLI args: []string{"C:\\terraform\\terraform.exe", "apply", "-var", "packagePath=..\\code\\package.zip", "-var", "packageName=package.zip"}
2018/03/21 12:41:49 [DEBUG] Attempting to open CLI config file: C:\Users\Kyle.Galbraith\AppData\Roaming\terraform.rc
2018/03/21 12:41:49 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/03/21 12:41:49 [INFO] CLI command args: []string{"apply", "-var", "packagePath=..\\code\\package.zip", "-var", "packageName=package.zip"}
2018/03/21 12:41:49 [INFO] command: empty terraform config, returning nil
2018/03/21 12:41:49 [DEBUG] command: no data state file found for backend config
2018/03/21 12:41:49 [DEBUG] New state was assigned lineage "73a84d51-e1ec-4236-468b-f4a395545239"
2018/03/21 12:41:49 [INFO] command: backend initialized: <nil>
@kylegalbraith
kylegalbraith / toc.md
Created March 24, 2018 17:07
How To Host, Secure, and Deliver Static Websites on Amazon Web Services Table of Contents

How To Host, Secure, and Deliver Static Websites on Amazon Web Services

  • Quit Getting Lost In The Sea Of Information
    • Learn AWS By Using It
    • A Brief History Lesson On AWS
    • The Problem To Be Solved While Learning
    • When The Dust Settles
  • Getting Setup With AWS
    • Getting Started With AWS
    • 3 Things You Need To Do Before Using Your New Account
  • Configuring Your CLI
version: 0.2
phases:
install:
commands:
- echo "install step"
pre_build:
commands:
- echo "pre_build step"
build:
commands:
build:
commands:
- npm build
post_build:
commands:
- aws s3 sync --delete . "s3://<your-static-website-bucket>"
@kylegalbraith
kylegalbraith / cicd-pipeline-with-ecr.tf
Created August 23, 2018 20:32
A Terraform template to provision a CI/CD Pipeline in AWS with ECR integration
variable "image_name" {
type = "string"
}
module "codecommit-cicd" {
source = "git::https://github.com/slalompdx/terraform-aws-codecommit-cicd.git?ref=master"
repo_name = "docker-image-build" # Required
organization_name = "kylegalbraith" # Required
repo_default_branch = "master" # Default value
aws_region = "us-west-2" # Default value
@kylegalbraith
kylegalbraith / buildspec.yml
Last active April 27, 2023 12:20
buildspec.yml with CloudFront invalidation
version: 0.2
phases:
install:
commands:
- echo "install step"
pre_build:
commands:
- echo "pre_build step"
build:
commands:
@kylegalbraith
kylegalbraith / buildspec.yml
Created September 15, 2018 14:57
buildspec.yml with Client Headers and CloudFront invalidation
version: 0.2
phases:
install:
commands:
- echo "install step"
pre_build:
commands:
- echo "pre_build step"
build:
commands:
import React from "react";
import {
ForgotPassword,
RequireNewPassword,
SignIn,
SignUp,
VerifyContact
} from "aws-amplify-react";
import config from "../../aws-exports";
import { Authenticator, Greetings } from "aws-amplify-react/dist/Auth";