AWS SDKs
Environment Variables
import boto3
ec2 = boto3.client('ec2')
for i in ec2.instances.all():
if i.state['Name'] == 'stopped':
i.start()$(saml-to assume the-role-name --headless)
python myscript.pyNamed Profiles
import boto3
ec2 = boto3.client('ec2', profile_name='the-profile-name')
for i in ec2.instances.all():
if i.state['Name'] == 'stopped':
i.start()Last updated