Skip to content

Instantly share code, notes, and snippets.

View danrivett's full-sized avatar

Dan Rivett danrivett

  • Elevai Consulting Inc.
  • Comox, BC, Canada
  • 06:22 (UTC -07:00)
View GitHub Profile
@stekhn
stekhn / prepareElastic.js
Last active April 13, 2023 00:52
Creates and prepares an Elasticsearch index, using the Node.js client. Closes the index before putting settings and mappings. The response and error handlers are optional, remove them if necessary.
var elastic = require('elasticsearch');
var client = new elastic.Client({ host: 'localhost:9200' });
var index = 'myindex';
var type = 'document';
(function init() {
Promise.resolve()
.then(deleteIndex, handleError)
@joawan
joawan / handler.js
Created April 27, 2022 08:51
Configuration of SES event destination
const response = require('cfn-response');
const AWS = require('aws-sdk');
const propertiesToParams = (props) => ({
ConfigurationSetName: props.ConfigSetName,
EventDestination: {
Name: props.ConfigSetEventDestinationName,
Enabled: props.Enabled || true,
MatchingEventTypes: ['send', 'reject', 'bounce', 'complaint', 'delivery', 'open'],
SNSDestination: {