Skip to content

Instantly share code, notes, and snippets.

View leftathome's full-sized avatar

Steven Wagner leftathome

View GitHub Profile
@robbiet480
robbiet480 / README.md
Last active October 23, 2019 18:13
A consul-template plugin to get EC2 metadata

ec2-consul-template-plugin

About

This is a simple little Python script to let you query EC2 metadata from consul-template. It's only requirement is boto. It uses the EC2 internal metadata service so it does not require any API keys or even a region. The only caveat is that this can only be run on a machine on EC2.

Usage

You can give no arguments for full dictionary output or one or more arguments to get specific key(s). Put it somewhere on your machine, chmod +x it and give the full path to consul-template.

Examples