Skip to content

Instantly share code, notes, and snippets.

@scoates
Created September 28, 2015 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scoates/8d45c759bbd0a4b07b7c to your computer and use it in GitHub Desktop.
Save scoates/8d45c759bbd0a4b07b7c to your computer and use it in GitHub Desktop.
_states/
from salt.utils import boto
## other stuff including def virtual()
def ensure_public_ips(…):
ec2_conn = boto.get_connection('ec2', region=region, key=key, keyid=keyid, profile=profile)
orig_api_version = ec2_conn.APIVersion
ec2_conn.APIVersion = '2014-06-15'
ret['result'] = ec2_conn.get_status(
'ModifySubnetAttribute',
{'SubnetId': subnet_id, 'MapPublicIpOnLaunch.Value': 'true'},
verb='POST')
ec2_conn.APIVersion = orig_api_version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment