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
| !/usr/bin/expect -f | |
| set timeout 30 | |
| log_user 0 | |
| puts stderr "Generating OTP" | |
| spawn oathtool --totp YOUR_SECRET_KEY_HERE | |
| expect -re \\d+ | |
| set otp $expect_out(0,string) | |
| puts stderr "Connecting to VPN server $server" |