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 | |
ec2 = boto3.resource('ec2') | |
volume_iterator = ec2.volumes.all() | |
for v in volume_iterator: | |
for a in v.attachments: | |
print "{0} {1} {2}".format(v.id, v.state, a['InstanceId']) |
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
-- Ran into a bit of trouble sending quoted string payload to a REST API | |
-- | |
-- Working examples of quoted strings with variables provided for reference | |
-- | |
--> print('"'..u..'"') | |
--"myuser" | |
--> print('{ "username":"'..u..'" }') | |
--{ "username":"myuser" } | |
--> payload = '{ "username":"'..u..'", "password":"'..p..'" }' | |
--> print(payload) |