Skip to content

Instantly share code, notes, and snippets.

@halferty
Created May 1, 2017 16:52
Show Gist options
  • Select an option

  • Save halferty/ab657cde10beccb31ba415855bbd7aa4 to your computer and use it in GitHub Desktop.

Select an option

Save halferty/ab657cde10beccb31ba415855bbd7aa4 to your computer and use it in GitHub Desktop.
Test SQS push with EC2 temporary credentials
(export AWS_ACCESS_KEY_ID=$(ruby -e "require \"json\"; puts JSON.parse(\`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<IAM group>\`)[\"AccessKeyId\"]"); export AWS_SECRET_ACCESS_KEY=$(ruby -e "require \"json\"; puts JSON.parse(\`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<IAM group>\`)[\"SecretAccessKey\"]"); export AWS_SESSION_TOKEN=$(ruby -e "require \"json\"; puts JSON.parse(\`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<IAM group>\`)[\"Token\"]"); export AWS_DEFAULT_REGION="us-east-1"; aws sqs send-message --queue-url "https://sqs.us-east-1.amazonaws.com/<rest of queue URL>" --message-body "Test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment