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
acm.amazonaws.com | |
alexa-appkit.amazon.com | |
apigateway.amazonaws.com | |
application-autoscaling.amazonaws.com | |
appstream.application-autoscaling.amazonaws.com | |
appsync.amazonaws.com | |
athena.amazonaws.com | |
autoscaling.amazonaws.com | |
batch.amazonaws.com | |
channels.lex.amazonaws.com |
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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Simple S3 Bucket with SNS Trigger | |
Parameters: | |
BucketName: | |
Type: String | |
Description: The name of the S3 Bucket to create |
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 elasticsearch = require('elasticsearch'); | |
const esClient = new elasticsearch.Client({ | |
host: process.env.ES_ENDPOINT, | |
apiVersion: "7.1", | |
}); | |
exports.handler = async (event, context, callback) => { | |
const indexName = 'notifications'; | |
const id = event.input.id; | |
const documents = event.input; |
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
--- | |
Description: AWS AppSync Notes API | |
Parameters: | |
APIName: | |
Type: String | |
Description: Name of the API - used to generate unique names for resources | |
MinLength: 3 | |
MaxLength: 20 | |
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$' |
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
--- | |
Description: AWSAppSync DynamoDB Example | |
Resources: | |
GraphQLApi: | |
Type: "AWS::AppSync::GraphQLApi" | |
Properties: | |
Name: AWSAppSync DynamoDB Example | |
AuthenticationType: AWS_IAM | |
PostDynamoDBTableDataSource: |
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
// credit goes to this stack overflow post - http://stackoverflow.com/questions/20646836/is-there-any-way-to-import-a-json-filecontains-100-documents-in-elasticsearch | |
var elasticsearch = require('elasticsearch'), | |
fs = require('fs'), | |
pubs = JSON.parse(fs.readFileSync(__dirname + '/pubs.json')), // name of my first file to parse | |
forms = JSON.parse(fs.readFileSync(__dirname + '/forms.json')); // and the second set | |
var client = new elasticsearch.Client({ // default is fine for me, change as you see fit | |
host: 'localhost:9200', | |
log: 'trace' | |
}); |
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
/* | |
by Martin Güther @magegu | |
just call it: | |
uploadFile(absoluteFilePath, callback); | |
*/ | |
var path = require('path'); | |
var async = require('async'); |
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
## Make sure your Subnet has internet access | |
variable "subnet" {} | |
variable "vpc" {} | |
provider "aws" { | |
region = "us-east-1" | |
} | |
data "aws_vpc" "sample" { | |
id = "${var.vpc}" |
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
var AWS = require("aws-sdk"); | |
var lambda = new AWS.Lambda({ | |
region: 'ap-southeast-1' | |
}); | |
function mongodbMonitorResult() { | |
return new Promise(function(resolve, reject) { | |
lambda.invoke({ | |
FunctionName: process.env.MongoMonitorLambdaARN, |
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
"use strict"; | |
const MongoClient = require('mongodb').MongoClient; | |
const MONGODB_URI = process.env.MONGODB_URI; | |
let cachedDb = null; | |
function connectToDatabase (uri) { | |
if (cachedDb) { | |
return Promise.resolve(cachedDb); |