This file contains hidden or 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
Type: AWS::IAM::ManagedPolicy | |
Properties: | |
Description: AWS Policy for EC2 Instance, EBS Creation with Tagging required | |
PolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
# This allows the untaggable calls to work when RunInstances is the actor | |
- | |
Effect: Allow | |
Action: |
These are python 2 and 3 snippets showing how to generate headers to authenticate with HashiCorp's Vault using the AWS authentication method. There's also a Ruby implementation which uses version 3 of the AWS SDK for Ruby.
The python scripts look for credentials in the
default boto3 locations;
if you need to supply custom credentials (such as from an AssumeRole
call), you would use the
botocore.session.set_credentials
method before calling create_client
.
This file contains hidden or 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
#nomad !/bin/bash | |
# | |
# nomad Manage the nomad agent | |
# | |
# chkconfig: 2345 95 95 | |
# description: Consul is a tool for service discovery and configuration | |
# processname: nomad | |
# config: /etc/nomad.conf | |
# pidfile: /var/run/nomad.pid |
This file contains hidden or 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: Cognito Stack | |
Parameters: | |
AuthName: | |
Type: String | |
Description: Unique Auth Name for Cognito Resources | |
Resources: | |
# Creates a role that allows Cognito to send SNS messages | |
SNSRole: |
This file contains hidden or 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 bash | |
# Path to the project directory (that should include requirements.txt), | |
# Files and directories within that need to be deployed. | |
project=../backend | |
contents=(module lamdba_handler.py) | |
# Unnecessary parts. Note that there are some inter-dependencies in SciPy, | |
# for example to use scipy.stats you also need scipy.linalg, scipy.integrate, | |
# scipy.misc, scipy.sparse, and scipy.special. |
This file contains hidden or 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
for row in $(curl https://api.github.com/repositories/72685026/contents/articles | jq -c -r '.[] | select(.type | contains("dir")) | "\(.name)"'); do wget -O "${row}.pdf" "https://docs.microsoft.com/en-us/azure/opbuildpdf/${row}/toc.pdf?branch=live"; done |
This file contains hidden or 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
# This script generates mkdocs friendly Markdown documentation from a python package. | |
# It is based on the the following blog post by Christian Medina | |
# https://medium.com/python-pandemonium/python-introspection-with-the-inspect-module-2c85d5aa5a48#.twcmlyack | |
import pydoc | |
import os, sys | |
module_header = "# Package {} Documentation\n" | |
class_header = "## Class {}" | |
function_header = "### {}" |
This file contains hidden or 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 boto3 | |
def role_arn_to_session(**args): | |
""" | |
Usage : | |
session = role_arn_to_session( | |
RoleArn='arn:aws:iam::012345678901:role/example-role', | |
RoleSessionName='ExampleSessionName') | |
client = session.client('sqs') | |
""" |
This file contains hidden or 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 os | |
import boto.utils | |
import boto3 | |
import requests | |
import datetime | |
import time | |
def get_contents(filename): |