Skip to content

Instantly share code, notes, and snippets.

@odessky
odessky / ec2-get-security-credentials
Last active March 18, 2020 01:49 — forked from fgassert/ec2-get-security-credentials
Gets IAM Role Security Credentials from instance metadata and export they in bash session envirovment. Secured edition.
#!/bin/bash
export-aws () {
# gets iam security credentials from instance metadata and export in envirovment for runtime script
# after script finished credentials is gone away
# system must have awscli&jq preinstalled
# converted to function
# Usage: export-aws ROLENAME