This file contains 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
#!/bin/bash | |
# Adapted from original by Jaime Preciado-Beas (jpreciad@nd.edu) | |
# To export env variables to current shell | |
# run: . user-mfa.sh | |
# check for user's mfa serial number | |
: ${AWS_MFA_SERIAL?"Need to set AWS_MFA_SERIAL. Locate at the bottom of your user page under AWS Console -> Identity and Access Management -> Users -> Your netID. Field is labeled 'Multi-Factor Authentication Device'"} | |
unset AWS_ACCESS_KEY_ID |
This file contains 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
# shows how to use the Ruby AWS SDK to list EC2 instance IDs | |
# when your API credentials have been placed under MFA requirements | |
# Prerequisites: | |
# you are running on a host that already has the AWS CLI set up with an IAM key pair | |
# that can describe EC2 instances (OTHERWISE, just pass a | |
# secret_access_id / secret_access_key pair to the STS client initializer) | |
# You have installed the Ruby AWS SDK Gem | |
# http://aws.amazon.com/sdk-for-ruby/ |
This file contains 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
a's values: | |
value of Foo.name: bar | |
Foo's object ID: 70207511032180 | |
self's object ID: 70207511031980 | |
b's values: | |
value of Foo.name: bar | |
Foo's object ID: 70207511032180 | |
self's object ID: 70207511031940 |