Permalink
Browse files

Allow IAM instance profile to be associated with a launch configurati…

…on for autoscale. Related to #811.
  • Loading branch information...
1 parent 304f2ed commit 7cf2cd77a55487d2ba0637c26918c7aa3ef60381 @garnaat garnaat committed Jun 12, 2012
Showing with 12 additions and 1 deletion.
  1. +2 −0 boto/ec2/autoscale/__init__.py
  2. +10 −1 boto/ec2/autoscale/launchconfig.py
@@ -220,6 +220,8 @@ def create_launch_configuration(self, launch_config):
params['InstanceMonitoring.Enabled'] = 'false'
if launch_config.spot_price is not None:
params['SpotPrice'] = str(launch_config.spot_price)
+ if launch_config.instance_profile_name is not None:
+ params['IamInstanceProfile'] = launch_config.instance_profile_name
return self.get_object('CreateLaunchConfiguration', params,
Request, verb='POST')
@@ -93,7 +93,8 @@ def __init__(self, connection=None, name=None, image_id=None,
key_name=None, security_groups=None, user_data=None,
instance_type='m1.small', kernel_id=None,
ramdisk_id=None, block_device_mappings=None,
- instance_monitoring=False, spot_price=None):
+ instance_monitoring=False, spot_price=None,
+ instance_profile_name=None):
"""
A launch configuration.
@@ -134,6 +135,11 @@ def __init__(self, connection=None, name=None, image_id=None,
:type spot_price: float
:param spot_price: The spot price you are bidding. Only applies
if you are building an autoscaling group with spot instances.
+
+ :type instance_profile_name: string
+ :param instance_profile_name: The name or the Amazon Resource
+ Name (ARN) of the instance profile associated with the IAM
+ role for the instance.
"""
self.connection = connection
self.name = name
@@ -150,6 +156,7 @@ def __init__(self, connection=None, name=None, image_id=None,
self.created_time = None
self.instance_monitoring = instance_monitoring
self.spot_price = spot_price
+ self.instance_profile_name = instance_profile_name
self.launch_configuration_arn = None
def __repr__(self):
@@ -192,6 +199,8 @@ def endElement(self, name, value, connection):
self.instance_monitoring = value
elif name == 'SpotPrice':
self.spot_price = float(value)
+ elif name == 'IamInstanceProfile':
+ self.instance_profile_name = value
else:
setattr(self, name, value)

0 comments on commit 7cf2cd7

Please sign in to comment.