Skip to content

Instantly share code, notes, and snippets.

View blohr-hs's full-sized avatar

Bryce Lohr blohr-hs

  • Harry's
  • New York, NY
View GitHub Profile
Description: >
Provides Grafana hosted on ECS Fargate.
Parameters:
LogCollectionStackName:
Description: Name of the CRM log collection stack which provides the Elasticsearch cluster for monitoring data
Type: String
Resources:
GrafanaCluster:
@blohr-hs
blohr-hs / decode_failed_es_payloads.sh
Created November 2, 2017 22:19
Get actual Elasticseach input when Firehose fails to insert it
#!/bin/bash
set -u
set -e
# Download a failed payload file from the "elasticsearch-failed/" folder in the S3 bucket, and pass its path to this script.
error_batch=$1
for raw in $(jq --raw-output '.rawData' $error_batch); do
echo $raw | base64 -D
@blohr-hs
blohr-hs / params2env.py
Last active August 18, 2017 16:38
Example that shows how to access secure secret values using the EC2 Parameter Store service
#!/usr/bin/env python3
"""
Set environment variables to values from EC2 Parameter Store.
Works similarly to /usr/bin/env, except that the `key=value` pairs passed are a mapping from desired environment
variable name to EC2 Parameter Store parameter name. In the called process, each such environment variable will have the
value obtained from the Parameter Store. Encrypted secure variables will be decrypted before being stored in the
environment variables.
The AWS credentials used to run this script must have IAM ssm:GetParameters permission on each of the listed parameters.