desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'Attach this ENI to an EC2 instance. :type instance_id: str :param instance_id: The ID of the EC2 instance to which it will be attached. :type device_index: int :param device_index: The interface nunber, N, on the instance (eg. ethN) :rtype: bool :return: True if successful'
def attach(self, instance_id, device_index, dry_run=False):
return self.connection.attach_network_interface(self.id, instance_id, device_index, dry_run=dry_run)
'Detach this ENI from an EC2 instance. :type force: bool :param force: Forces detachment if the previous detachment attempt did not occur cleanly. :rtype: bool :return: True if successful'
def detach(self, force=False, dry_run=False):
attachment_id = getattr(self.attachment, 'id', None) return self.connection.detach_network_interface(attachment_id, force, dry_run=dry_run)
'Update the data associated with this volume by querying EC2. :type validate: bool :param validate: By default, if EC2 returns no data about the volume the update method returns quietly. If the validate param is True, however, it will raise a ValueError exception if no data is returned from EC2.'
def update(self, validate=False, dry_run=False):
unfiltered_rs = self.connection.get_all_volumes([self.id], dry_run=dry_run) rs = [x for x in unfiltered_rs if (x.id == self.id)] if (len(rs) > 0): self._update(rs[0]) elif validate: raise ValueError(('%s is not a valid Volume ID' % self.id)) return self.status
'Delete this EBS volume. :rtype: bool :return: True if successful'
def delete(self, dry_run=False):
return self.connection.delete_volume(self.id, dry_run=dry_run)
'Attach this EBS volume to an EC2 instance. :type instance_id: str :param instance_id: The ID of the EC2 instance to which it will be attached. :type device: str :param device: The device on the instance through which the volume will be exposed (e.g. /dev/sdh) :rtype: bool :return: True if successful'
def attach(self, instance_id, device, dry_run=False):
return self.connection.attach_volume(self.id, instance_id, device, dry_run=dry_run)
'Detach this EBS volume from an EC2 instance. :type force: bool :param force: Forces detachment if the previous detachment attempt did not occur cleanly. This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance will not ...
def detach(self, force=False, dry_run=False):
instance_id = None if self.attach_data: instance_id = self.attach_data.instance_id device = None if self.attach_data: device = self.attach_data.device return self.connection.detach_volume(self.id, instance_id, device, force, dry_run=dry_run)
'Create a snapshot of this EBS Volume. :type description: str :param description: A description of the snapshot. Limited to 256 characters. :rtype: :class:`boto.ec2.snapshot.Snapshot` :return: The created Snapshot object'
def create_snapshot(self, description=None, dry_run=False):
return self.connection.create_snapshot(self.id, description, dry_run=dry_run)
'Returns the state of the volume. Same value as the status attribute.'
def volume_state(self):
return self.status
'Get the attachment state.'
def attachment_state(self):
state = None if self.attach_data: state = self.attach_data.status return state
'Get all snapshots related to this volume. Note that this requires that all available snapshots for the account be retrieved from EC2 first and then the list is filtered client-side to contain only those for this volume. :type owner: str :param owner: If present, only the snapshots owned by the specified user will be ...
def snapshots(self, owner=None, restorable_by=None, dry_run=False):
rs = self.connection.get_all_snapshots(owner=owner, restorable_by=restorable_by, dry_run=dry_run) mine = [] for snap in rs: if (snap.volume_id == self.id): mine.append(snap) return mine
'Update the data associated with this snapshot by querying EC2. :type validate: bool :param validate: By default, if EC2 returns no data about the snapshot the update method returns quietly. If the validate param is True, however, it will raise a ValueError exception if no data is returned from EC2.'
def update(self, validate=False, dry_run=False):
rs = self.connection.get_all_snapshots([self.id], dry_run=dry_run) if (len(rs) > 0): self._update(rs[0]) elif validate: raise ValueError(('%s is not a valid Snapshot ID' % self.id)) return self.progress
'Create a new EBS Volume from this Snapshot :type zone: string or :class:`boto.ec2.zone.Zone` :param zone: The availability zone in which the Volume will be created. :type size: int :param size: The size of the new volume, in GiB. (optional). Defaults to the size of the snapshot. :type volume_type: string :param volume...
def create_volume(self, zone, size=None, volume_type=None, iops=None, dry_run=False):
if isinstance(zone, Zone): zone = zone.name return self.connection.create_volume(size, zone, self.id, volume_type, iops, self.encrypted, dry_run=dry_run)
':ivar str id: The instance\'s EC2 ID. :ivar str state: Specifies the current status of the instance.'
def __init__(self, connection=None, id=None, state=None):
self.connection = connection self.id = id self.state = state
'Free up this Elastic IP address. :see: :meth:`boto.ec2.connection.EC2Connection.release_address`'
def release(self, dry_run=False):
if self.allocation_id: return self.connection.release_address(allocation_id=self.allocation_id, dry_run=dry_run) else: return self.connection.release_address(public_ip=self.public_ip, dry_run=dry_run)
'Associate this Elastic IP address with a currently running instance. :see: :meth:`boto.ec2.connection.EC2Connection.associate_address`'
def associate(self, instance_id=None, network_interface_id=None, private_ip_address=None, allow_reassociation=False, dry_run=False):
if self.allocation_id: return self.connection.associate_address(instance_id=instance_id, public_ip=self.public_ip, allocation_id=self.allocation_id, network_interface_id=network_interface_id, private_ip_address=private_ip_address, allow_reassociation=allow_reassociation, dry_run=dry_run) return self.con...
'Disassociate this Elastic IP address from a currently running instance. :see: :meth:`boto.ec2.connection.EC2Connection.disassociate_address`'
def disassociate(self, dry_run=False):
if self.association_id: return self.connection.disassociate_address(association_id=self.association_id, dry_run=dry_run) else: return self.connection.disassociate_address(public_ip=self.public_ip, dry_run=dry_run)
'Update the image\'s state information by making a call to fetch the current image attributes from the service. :type validate: bool :param validate: By default, if EC2 returns no data about the image the update method returns quietly. If the validate param is True, however, it will raise a ValueError exception if no ...
def update(self, validate=False, dry_run=False):
rs = self.connection.get_all_images([self.id], dry_run=dry_run) if (len(rs) > 0): img = rs[0] if (img.id == self.id): self._update(img) elif validate: raise ValueError(('%s is not a valid Image ID' % self.id)) return self.state
'Runs this instance. :type min_count: int :param min_count: The minimum number of instances to start :type max_count: int :param max_count: The maximum number of instances to start :type key_name: string :param key_name: The name of the key pair with which to launch instances. :type security_groups: list of strings :pa...
def run(self, min_count=1, max_count=1, key_name=None, security_groups=None, user_data=None, addressing_type=None, instance_type='m1.small', placement=None, kernel_id=None, ramdisk_id=None, monitoring_enabled=False, subnet_id=None, block_device_map=None, disable_api_termination=False, instance_initiated_shutdown_behavi...
return self.connection.run_instances(self.id, min_count, max_count, key_name, security_groups, user_data, addressing_type, instance_type, placement, kernel_id, ramdisk_id, monitoring_enabled, subnet_id, block_device_map, disable_api_termination, instance_initiated_shutdown_behavior, private_ip_address, placement_gr...
'Update the instance\'s state information by making a call to fetch the current instance attributes from the service. :type validate: bool :param validate: By default, if EC2 returns no data about the instance the update method returns quietly. If the validate param is True, however, it will raise a ValueError excepti...
def update(self, validate=False, dry_run=False):
rs = self.connection.get_all_reservations([self.id], dry_run=dry_run) if (len(rs) > 0): r = rs[0] for i in r.instances: if (i.id == self.id): self._update(i) elif validate: raise ValueError(('%s is not a valid Instance ID' % self.id)) ...
'Terminate the instance'
def terminate(self, dry_run=False):
rs = self.connection.terminate_instances([self.id], dry_run=dry_run) if (len(rs) > 0): self._update(rs[0])
'Stop the instance :type force: bool :param force: Forces the instance to stop :rtype: list :return: A list of the instances stopped'
def stop(self, force=False, dry_run=False):
rs = self.connection.stop_instances([self.id], force, dry_run=dry_run) if (len(rs) > 0): self._update(rs[0])
'Start the instance.'
def start(self, dry_run=False):
rs = self.connection.start_instances([self.id], dry_run=dry_run) if (len(rs) > 0): self._update(rs[0])
'Retrieves the console output for the instance. :rtype: :class:`boto.ec2.instance.ConsoleOutput` :return: The console output as a ConsoleOutput object'
def get_console_output(self, dry_run=False):
return self.connection.get_console_output(self.id, dry_run=dry_run)
'Associates an Elastic IP to the instance. :type ip_address: Either an instance of :class:`boto.ec2.address.Address` or a string. :param ip_address: The IP address to associate with the instance. :rtype: bool :return: True if successful'
def use_ip(self, ip_address, dry_run=False):
if isinstance(ip_address, Address): ip_address = ip_address.public_ip return self.connection.associate_address(self.id, ip_address, dry_run=dry_run)
'Gets an attribute from this instance. :type attribute: string :param attribute: The attribute you need information about Valid choices are: * instanceType * kernel * ramdisk * userData * disableApiTermination * instanceInitiatedShutdownBehavior * rootDeviceName * blockDeviceMapping * productCodes * sourceDestCheck * g...
def get_attribute(self, attribute, dry_run=False):
return self.connection.get_instance_attribute(self.id, attribute, dry_run=dry_run)
'Changes an attribute of this instance :type attribute: string :param attribute: The attribute you wish to change. * instanceType - A valid instance type (m1.small) * kernel - Kernel ID (None) * ramdisk - Ramdisk ID (None) * userData - Base64 encoded String (None) * disableApiTermination - Boolean (true) * instanceInit...
def modify_attribute(self, attribute, value, dry_run=False):
return self.connection.modify_instance_attribute(self.id, attribute, value, dry_run=dry_run)
'Resets an attribute of this instance to its default value. :type attribute: string :param attribute: The attribute to reset. Valid values are: kernel|ramdisk :rtype: bool :return: Whether the operation succeeded or not'
def reset_attribute(self, attribute, dry_run=False):
return self.connection.reset_instance_attribute(self.id, attribute, dry_run=dry_run)
'Will create an AMI from the instance in the running or stopped state. :type name: string :param name: The name of the new image :type description: string :param description: An optional human-readable string describing the contents and purpose of the AMI. :type no_reboot: bool :param no_reboot: An optional flag indica...
def create_image(self, name, description=None, no_reboot=False, dry_run=False):
return self.connection.create_image(self.id, name, description, no_reboot, dry_run=dry_run)
'Add a rule to the SecurityGroup object. Note that this method only changes the local version of the object. No information is sent to EC2.'
def add_rule(self, ip_protocol, from_port, to_port, src_group_name, src_group_owner_id, cidr_ip, src_group_group_id, dry_run=False):
rule = IPPermissions(self) rule.ip_protocol = ip_protocol rule.from_port = from_port rule.to_port = to_port self.rules.append(rule) rule.add_grant(src_group_name, src_group_owner_id, cidr_ip, src_group_group_id, dry_run=dry_run)
'Remove a rule to the SecurityGroup object. Note that this method only changes the local version of the object. No information is sent to EC2.'
def remove_rule(self, ip_protocol, from_port, to_port, src_group_name, src_group_owner_id, cidr_ip, src_group_group_id, dry_run=False):
if (not self.rules): raise ValueError('The security group has no rules') target_rule = None for rule in self.rules: if (rule.ip_protocol == ip_protocol): if (rule.from_port == from_port): if (rule.to_port == to_port): target_rule...
'Add a new rule to this security group. You need to pass in either src_group_name OR ip_protocol, from_port, to_port, and cidr_ip. In other words, either you are authorizing another group or you are authorizing some ip-based rule. :type ip_protocol: string :param ip_protocol: Either tcp | udp | icmp :type from_port: i...
def authorize(self, ip_protocol=None, from_port=None, to_port=None, cidr_ip=None, src_group=None, dry_run=False):
group_name = None if (not self.vpc_id): group_name = self.name group_id = None if self.vpc_id: group_id = self.id src_group_name = None src_group_owner_id = None src_group_group_id = None if src_group: cidr_ip = None src_group_owner_id = src_group.owner_id...
'Create a copy of this security group in another region. Note that the new security group will be a separate entity and will not stay in sync automatically after the copy operation. :type region: :class:`boto.ec2.regioninfo.RegionInfo` :param region: The region to which this security group will be copied. :type name: s...
def copy_to_region(self, region, name=None, dry_run=False):
if (region.name == self.region): raise BotoClientError('Unable to copy to the same Region') conn_params = self.connection.get_params() rconn = region.connect(**conn_params) sg = rconn.create_security_group((name or self.name), self.description, dry_run=dry_run) source_group...
'Find all of the current instances that are running within this security group. :rtype: list of :class:`boto.ec2.instance.Instance` :return: A list of Instance objects'
def instances(self, dry_run=False):
rs = [] if self.vpc_id: rs.extend(self.connection.get_all_reservations(filters={'instance.group-id': self.id}, dry_run=dry_run)) else: rs.extend(self.connection.get_all_reservations(filters={'group-id': self.id}, dry_run=dry_run)) instances = [i for r in rs for i in r.instances] retu...
'Assign a registered instance to a custom layer. You cannot use this action with instances that were created with AWS OpsWorks. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack or an attached policy that explicitly grants permissions. For more information on u...
def assign_instance(self, instance_id, layer_ids):
params = {'InstanceId': instance_id, 'LayerIds': layer_ids} return self.make_request(action='AssignInstance', body=json.dumps(params))
'Assigns one of the stack\'s registered Amazon EBS volumes to a specified instance. The volume must first be registered with the stack by calling RegisterVolume. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack...
def assign_volume(self, volume_id, instance_id=None):
params = {'VolumeId': volume_id} if (instance_id is not None): params['InstanceId'] = instance_id return self.make_request(action='AssignVolume', body=json.dumps(params))
'Associates one of the stack\'s registered Elastic IP addresses with a specified instance. The address must first be registered with the stack by calling RegisterElasticIp. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level fo...
def associate_elastic_ip(self, elastic_ip, instance_id=None):
params = {'ElasticIp': elastic_ip} if (instance_id is not None): params['InstanceId'] = instance_id return self.make_request(action='AssociateElasticIp', body=json.dumps(params))
'Attaches an Elastic Load Balancing load balancer to a specified layer. For more information, see `Elastic Load Balancing`_. You must create the Elastic Load Balancing instance separately, by using the Elastic Load Balancing console, API, or CLI. For more information, see ` Elastic Load Balancing Developer Guide`_. **R...
def attach_elastic_load_balancer(self, elastic_load_balancer_name, layer_id):
params = {'ElasticLoadBalancerName': elastic_load_balancer_name, 'LayerId': layer_id} return self.make_request(action='AttachElasticLoadBalancer', body=json.dumps(params))
'Creates a clone of a specified stack. For more information, see `Clone a Stack`_. **Required Permissions**: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type source_stack_id: string :param s...
def clone_stack(self, source_stack_id, service_role_arn, name=None, region=None, vpc_id=None, attributes=None, default_instance_profile_arn=None, default_os=None, hostname_theme=None, default_availability_zone=None, default_subnet_id=None, custom_json=None, configuration_manager=None, chef_configuration=None, use_custo...
params = {'SourceStackId': source_stack_id, 'ServiceRoleArn': service_role_arn} if (name is not None): params['Name'] = name if (region is not None): params['Region'] = region if (vpc_id is not None): params['VpcId'] = vpc_id if (attributes is not None): params['Attri...
'Creates an app for a specified stack. For more information, see `Creating Apps`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissi...
def create_app(self, stack_id, name, type, shortname=None, description=None, data_sources=None, app_source=None, domains=None, enable_ssl=None, ssl_configuration=None, attributes=None, environment=None):
params = {'StackId': stack_id, 'Name': name, 'Type': type} if (shortname is not None): params['Shortname'] = shortname if (description is not None): params['Description'] = description if (data_sources is not None): params['DataSources'] = data_sources if (app_source is not N...
'Runs deployment or stack commands. For more information, see `Deploying Apps`_ and `Run Stack Commands`_. **Required Permissions**: To use this action, an IAM user must have a Deploy or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permis...
def create_deployment(self, stack_id, command, app_id=None, instance_ids=None, comment=None, custom_json=None):
params = {'StackId': stack_id, 'Command': command} if (app_id is not None): params['AppId'] = app_id if (instance_ids is not None): params['InstanceIds'] = instance_ids if (comment is not None): params['Comment'] = comment if (custom_json is not None): params['CustomJ...
'Creates an instance in a specified stack. For more information, see `Adding an Instance to a Layer`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Ma...
def create_instance(self, stack_id, layer_ids, instance_type, auto_scaling_type=None, hostname=None, os=None, ami_id=None, ssh_key_name=None, availability_zone=None, virtualization_type=None, subnet_id=None, architecture=None, root_device_type=None, install_updates_on_boot=None, ebs_optimized=None):
params = {'StackId': stack_id, 'LayerIds': layer_ids, 'InstanceType': instance_type} if (auto_scaling_type is not None): params['AutoScalingType'] = auto_scaling_type if (hostname is not None): params['Hostname'] = hostname if (os is not None): params['Os'] = os if (ami_id is...
'Creates a layer. For more information, see `How to Create a Layer`_. You should use **CreateLayer** for noncustom layer types such as PHP App Server only if the stack does not have an existing layer of that type. A stack can have at most one instance of each noncustom layer; if you attempt to create a second instance,...
def create_layer(self, stack_id, type, name, shortname, attributes=None, custom_instance_profile_arn=None, custom_security_group_ids=None, packages=None, volume_configurations=None, enable_auto_healing=None, auto_assign_elastic_ips=None, auto_assign_public_ips=None, custom_recipes=None, install_updates_on_boot=None, us...
params = {'StackId': stack_id, 'Type': type, 'Name': name, 'Shortname': shortname} if (attributes is not None): params['Attributes'] = attributes if (custom_instance_profile_arn is not None): params['CustomInstanceProfileArn'] = custom_instance_profile_arn if (custom_security_group_ids i...
'Creates a new stack. For more information, see `Create a New Stack`_. **Required Permissions**: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type name: string :param name: The stack name. :t...
def create_stack(self, name, region, service_role_arn, default_instance_profile_arn, vpc_id=None, attributes=None, default_os=None, hostname_theme=None, default_availability_zone=None, default_subnet_id=None, custom_json=None, configuration_manager=None, chef_configuration=None, use_custom_cookbooks=None, use_opsworks_...
params = {'Name': name, 'Region': region, 'ServiceRoleArn': service_role_arn, 'DefaultInstanceProfileArn': default_instance_profile_arn} if (vpc_id is not None): params['VpcId'] = vpc_id if (attributes is not None): params['Attributes'] = attributes if (default_os is not None): p...
'Creates a new user profile. **Required Permissions**: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type iam_user_arn: string :param iam_user_arn: The user\'s IAM ARN. :type ssh_username: str...
def create_user_profile(self, iam_user_arn, ssh_username=None, ssh_public_key=None, allow_self_management=None):
params = {'IamUserArn': iam_user_arn} if (ssh_username is not None): params['SshUsername'] = ssh_username if (ssh_public_key is not None): params['SshPublicKey'] = ssh_public_key if (allow_self_management is not None): params['AllowSelfManagement'] = allow_self_management ret...
'Deletes a specified app. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type app_id: string :param app_id: The app ID.'
def delete_app(self, app_id):
params = {'AppId': app_id} return self.make_request(action='DeleteApp', body=json.dumps(params))
'Deletes a specified instance, which terminates the associated Amazon EC2 instance. You must stop an instance before you can delete it. For more information, see `Deleting Instances`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy tha...
def delete_instance(self, instance_id, delete_elastic_ip=None, delete_volumes=None):
params = {'InstanceId': instance_id} if (delete_elastic_ip is not None): params['DeleteElasticIp'] = delete_elastic_ip if (delete_volumes is not None): params['DeleteVolumes'] = delete_volumes return self.make_request(action='DeleteInstance', body=json.dumps(params))
'Deletes a specified layer. You must first stop and then delete all associated instances or unassign registered instances. For more information, see `How to Delete a Layer`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicit...
def delete_layer(self, layer_id):
params = {'LayerId': layer_id} return self.make_request(action='DeleteLayer', body=json.dumps(params))
'Deletes a specified stack. You must first delete all instances, layers, and apps or deregister registered instances. For more information, see `Shut Down a Stack`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants...
def delete_stack(self, stack_id):
params = {'StackId': stack_id} return self.make_request(action='DeleteStack', body=json.dumps(params))
'Deletes a user profile. **Required Permissions**: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type iam_user_arn: string :param iam_user_arn: The user\'s IAM ARN.'
def delete_user_profile(self, iam_user_arn):
params = {'IamUserArn': iam_user_arn} return self.make_request(action='DeleteUserProfile', body=json.dumps(params))
'Deregisters a specified Elastic IP address. The address can then be registered by another stack. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For ...
def deregister_elastic_ip(self, elastic_ip):
params = {'ElasticIp': elastic_ip} return self.make_request(action='DeregisterElasticIp', body=json.dumps(params))
'Deregister a registered Amazon EC2 or on-premises instance. This action removes the instance from the stack and returns it to your control. This action can not be used with instances that were created with AWS OpsWorks. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for ...
def deregister_instance(self, instance_id):
params = {'InstanceId': instance_id} return self.make_request(action='DeregisterInstance', body=json.dumps(params))
'Deregisters an Amazon RDS instance. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type rds_db_instance_arn: string :para...
def deregister_rds_db_instance(self, rds_db_instance_arn):
params = {'RdsDbInstanceArn': rds_db_instance_arn} return self.make_request(action='DeregisterRdsDbInstance', body=json.dumps(params))
'Deregisters an Amazon EBS volume. The volume can then be registered by another stack. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more inform...
def deregister_volume(self, volume_id):
params = {'VolumeId': volume_id} return self.make_request(action='DeregisterVolume', body=json.dumps(params))
'Requests a description of a specified set of apps. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permi...
def describe_apps(self, stack_id=None, app_ids=None):
params = {} if (stack_id is not None): params['StackId'] = stack_id if (app_ids is not None): params['AppIds'] = app_ids return self.make_request(action='DescribeApps', body=json.dumps(params))
'Describes the results of specified commands. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions...
def describe_commands(self, deployment_id=None, instance_id=None, command_ids=None):
params = {} if (deployment_id is not None): params['DeploymentId'] = deployment_id if (instance_id is not None): params['InstanceId'] = instance_id if (command_ids is not None): params['CommandIds'] = command_ids return self.make_request(action='DescribeCommands', body=json.d...
'Requests a description of a specified set of deployments. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on use...
def describe_deployments(self, stack_id=None, app_id=None, deployment_ids=None):
params = {} if (stack_id is not None): params['StackId'] = stack_id if (app_id is not None): params['AppId'] = app_id if (deployment_ids is not None): params['DeploymentIds'] = deployment_ids return self.make_request(action='DescribeDeployments', body=json.dumps(params))
'Describes `Elastic IP addresses`_. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Man...
def describe_elastic_ips(self, instance_id=None, stack_id=None, ips=None):
params = {} if (instance_id is not None): params['InstanceId'] = instance_id if (stack_id is not None): params['StackId'] = stack_id if (ips is not None): params['Ips'] = ips return self.make_request(action='DescribeElasticIps', body=json.dumps(params))
'Describes a stack\'s Elastic Load Balancing instances. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user p...
def describe_elastic_load_balancers(self, stack_id=None, layer_ids=None):
params = {} if (stack_id is not None): params['StackId'] = stack_id if (layer_ids is not None): params['LayerIds'] = layer_ids return self.make_request(action='DescribeElasticLoadBalancers', body=json.dumps(params))
'Requests a description of a set of instances. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permission...
def describe_instances(self, stack_id=None, layer_id=None, instance_ids=None):
params = {} if (stack_id is not None): params['StackId'] = stack_id if (layer_id is not None): params['LayerId'] = layer_id if (instance_ids is not None): params['InstanceIds'] = instance_ids return self.make_request(action='DescribeInstances', body=json.dumps(params))
'Requests a description of one or more layers in a specified stack. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more informati...
def describe_layers(self, stack_id=None, layer_ids=None):
params = {} if (stack_id is not None): params['StackId'] = stack_id if (layer_ids is not None): params['LayerIds'] = layer_ids return self.make_request(action='DescribeLayers', body=json.dumps(params))
'Describes load-based auto scaling configurations for specified layers. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more infor...
def describe_load_based_auto_scaling(self, layer_ids):
params = {'LayerIds': layer_ids} return self.make_request(action='DescribeLoadBasedAutoScaling', body=json.dumps(params))
'Describes a user\'s SSH information. **Required Permissions**: To use this action, an IAM user must have self-management enabled or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_.'
def describe_my_user_profile(self):
params = {} return self.make_request(action='DescribeMyUserProfile', body=json.dumps(params))
'Describes the permissions for a specified stack. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type iam_user_arn: string...
def describe_permissions(self, iam_user_arn=None, stack_id=None):
params = {} if (iam_user_arn is not None): params['IamUserArn'] = iam_user_arn if (stack_id is not None): params['StackId'] = stack_id return self.make_request(action='DescribePermissions', body=json.dumps(params))
'Describe an instance\'s RAID arrays. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `M...
def describe_raid_arrays(self, instance_id=None, stack_id=None, raid_array_ids=None):
params = {} if (instance_id is not None): params['InstanceId'] = instance_id if (stack_id is not None): params['StackId'] = stack_id if (raid_array_ids is not None): params['RaidArrayIds'] = raid_array_ids return self.make_request(action='DescribeRaidArrays', body=json.dumps(...
'Describes Amazon RDS instances. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type stack_id: string :pa...
def describe_rds_db_instances(self, stack_id, rds_db_instance_arns=None):
params = {'StackId': stack_id} if (rds_db_instance_arns is not None): params['RdsDbInstanceArns'] = rds_db_instance_arns return self.make_request(action='DescribeRdsDbInstances', body=json.dumps(params))
'Describes AWS OpsWorks service errors. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type stack_id: str...
def describe_service_errors(self, stack_id=None, instance_id=None, service_error_ids=None):
params = {} if (stack_id is not None): params['StackId'] = stack_id if (instance_id is not None): params['InstanceId'] = instance_id if (service_error_ids is not None): params['ServiceErrorIds'] = service_error_ids return self.make_request(action='DescribeServiceErrors', body...
'Requests a description of a stack\'s provisioning parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`...
def describe_stack_provisioning_parameters(self, stack_id):
params = {'StackId': stack_id} return self.make_request(action='DescribeStackProvisioningParameters', body=json.dumps(params))
'Describes the number of layers and apps in a specified stack, and the number of instances in each state, such as `running_setup` or `online`. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permi...
def describe_stack_summary(self, stack_id):
params = {'StackId': stack_id} return self.make_request(action='DescribeStackSummary', body=json.dumps(params))
'Requests a description of one or more stacks. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type stack_...
def describe_stacks(self, stack_ids=None):
params = {} if (stack_ids is not None): params['StackIds'] = stack_ids return self.make_request(action='DescribeStacks', body=json.dumps(params))
'Describes time-based auto scaling configurations for specified instances. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more in...
def describe_time_based_auto_scaling(self, instance_ids):
params = {'InstanceIds': instance_ids} return self.make_request(action='DescribeTimeBasedAutoScaling', body=json.dumps(params))
'Describe specified users. **Required Permissions**: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type iam_user_arns: list :param iam_user_arns: An array of IAM user ARNs that identify the us...
def describe_user_profiles(self, iam_user_arns=None):
params = {} if (iam_user_arns is not None): params['IamUserArns'] = iam_user_arns return self.make_request(action='DescribeUserProfiles', body=json.dumps(params))
'Describes an instance\'s Amazon EBS volumes. You must specify at least one of the parameters. **Required Permissions**: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions...
def describe_volumes(self, instance_id=None, stack_id=None, raid_array_id=None, volume_ids=None):
params = {} if (instance_id is not None): params['InstanceId'] = instance_id if (stack_id is not None): params['StackId'] = stack_id if (raid_array_id is not None): params['RaidArrayId'] = raid_array_id if (volume_ids is not None): params['VolumeIds'] = volume_ids ...
'Detaches a specified Elastic Load Balancing instance from its layer. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type ...
def detach_elastic_load_balancer(self, elastic_load_balancer_name, layer_id):
params = {'ElasticLoadBalancerName': elastic_load_balancer_name, 'LayerId': layer_id} return self.make_request(action='DetachElasticLoadBalancer', body=json.dumps(params))
'Disassociates an Elastic IP address from its instance. The address remains registered with the stack. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions....
def disassociate_elastic_ip(self, elastic_ip):
params = {'ElasticIp': elastic_ip} return self.make_request(action='DisassociateElasticIp', body=json.dumps(params))
'Gets a generated host name for the specified layer, based on the current host name theme. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User ...
def get_hostname_suggestion(self, layer_id):
params = {'LayerId': layer_id} return self.make_request(action='GetHostnameSuggestion', body=json.dumps(params))
'Reboots a specified instance. For more information, see `Starting, Stopping, and Rebooting Instances`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `...
def reboot_instance(self, instance_id):
params = {'InstanceId': instance_id} return self.make_request(action='RebootInstance', body=json.dumps(params))
'Registers an Elastic IP address with a specified stack. An address can be registered with only one stack at a time. If the address is already registered, you must first deregister it by calling DeregisterElasticIp. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM u...
def register_elastic_ip(self, elastic_ip, stack_id):
params = {'ElasticIp': elastic_ip, 'StackId': stack_id} return self.make_request(action='RegisterElasticIp', body=json.dumps(params))
'Registers instances with a specified stack that were created outside of AWS OpsWorks. We do not recommend using this action to register instances. The complete registration operation has two primary steps, installing the AWS OpsWorks agent on the instance and registering the instance with the stack. `RegisterInstance`...
def register_instance(self, stack_id, hostname=None, public_ip=None, private_ip=None, rsa_public_key=None, rsa_public_key_fingerprint=None, instance_identity=None):
params = {'StackId': stack_id} if (hostname is not None): params['Hostname'] = hostname if (public_ip is not None): params['PublicIp'] = public_ip if (private_ip is not None): params['PrivateIp'] = private_ip if (rsa_public_key is not None): params['RsaPublicKey'] = r...
'Registers an Amazon RDS instance with a stack. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type stack_id: string :para...
def register_rds_db_instance(self, stack_id, rds_db_instance_arn, db_user, db_password):
params = {'StackId': stack_id, 'RdsDbInstanceArn': rds_db_instance_arn, 'DbUser': db_user, 'DbPassword': db_password} return self.make_request(action='RegisterRdsDbInstance', body=json.dumps(params))
'Registers an Amazon EBS volume with a specified stack. A volume can be registered with only one stack at a time. If the volume is already registered, you must first deregister it by calling DeregisterVolume. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user mus...
def register_volume(self, stack_id, ec_2_volume_id=None):
params = {'StackId': stack_id} if (ec_2_volume_id is not None): params['Ec2VolumeId'] = ec_2_volume_id return self.make_request(action='RegisterVolume', body=json.dumps(params))
'Specify the load-based auto scaling configuration for a specified layer. For more information, see `Managing Load with Time-based and Load-based Instances`_. To use load-based auto scaling, you must create a set of load- based auto scaling instances. Load-based auto scaling operates only on the instances from that set...
def set_load_based_auto_scaling(self, layer_id, enable=None, up_scaling=None, down_scaling=None):
params = {'LayerId': layer_id} if (enable is not None): params['Enable'] = enable if (up_scaling is not None): params['UpScaling'] = up_scaling if (down_scaling is not None): params['DownScaling'] = down_scaling return self.make_request(action='SetLoadBasedAutoScaling', body=...
'Specifies a user\'s permissions. For more information, see `Security and Permissions`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Pe...
def set_permission(self, stack_id, iam_user_arn, allow_ssh=None, allow_sudo=None, level=None):
params = {'StackId': stack_id, 'IamUserArn': iam_user_arn} if (allow_ssh is not None): params['AllowSsh'] = allow_ssh if (allow_sudo is not None): params['AllowSudo'] = allow_sudo if (level is not None): params['Level'] = level return self.make_request(action='SetPermission',...
'Specify the time-based auto scaling configuration for a specified instance. For more information, see `Managing Load with Time-based and Load-based Instances`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants per...
def set_time_based_auto_scaling(self, instance_id, auto_scaling_schedule=None):
params = {'InstanceId': instance_id} if (auto_scaling_schedule is not None): params['AutoScalingSchedule'] = auto_scaling_schedule return self.make_request(action='SetTimeBasedAutoScaling', body=json.dumps(params))
'Starts a specified instance. For more information, see `Starting, Stopping, and Rebooting Instances`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `M...
def start_instance(self, instance_id):
params = {'InstanceId': instance_id} return self.make_request(action='StartInstance', body=json.dumps(params))
'Starts a stack\'s instances. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type stack_id: string :param stack_id: The st...
def start_stack(self, stack_id):
params = {'StackId': stack_id} return self.make_request(action='StartStack', body=json.dumps(params))
'Stops a specified instance. When you stop a standard instance, the data disappears and must be reinstalled when you restart the instance. You can stop an Amazon EBS-backed instance without losing data. For more information, see `Starting, Stopping, and Rebooting Instances`_. **Required Permissions**: To use this actio...
def stop_instance(self, instance_id):
params = {'InstanceId': instance_id} return self.make_request(action='StopInstance', body=json.dumps(params))
'Stops a specified stack. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type stack_id: string :param stack_id: The stack ...
def stop_stack(self, stack_id):
params = {'StackId': stack_id} return self.make_request(action='StopStack', body=json.dumps(params))
'Unassigns a registered instance from all of it\'s layers. The instance remains in the stack as an unassigned instance and can be assigned to another layer, as needed. You cannot use this action with instances that were created with AWS OpsWorks. **Required Permissions**: To use this action, an IAM user must have a Man...
def unassign_instance(self, instance_id):
params = {'InstanceId': instance_id} return self.make_request(action='UnassignInstance', body=json.dumps(params))
'Unassigns an assigned Amazon EBS volume. The volume remains registered with the stack. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more infor...
def unassign_volume(self, volume_id):
params = {'VolumeId': volume_id} return self.make_request(action='UnassignVolume', body=json.dumps(params))
'Updates a specified app. **Required Permissions**: To use this action, an IAM user must have a Deploy or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type app_id: string :param app_id: The ...
def update_app(self, app_id, name=None, description=None, data_sources=None, type=None, app_source=None, domains=None, enable_ssl=None, ssl_configuration=None, attributes=None, environment=None):
params = {'AppId': app_id} if (name is not None): params['Name'] = name if (description is not None): params['Description'] = description if (data_sources is not None): params['DataSources'] = data_sources if (type is not None): params['Type'] = type if (app_sourc...
'Updates a registered Elastic IP address\'s name. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Manag...
def update_elastic_ip(self, elastic_ip, name=None):
params = {'ElasticIp': elastic_ip} if (name is not None): params['Name'] = name return self.make_request(action='UpdateElasticIp', body=json.dumps(params))
'Updates a specified instance. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type instance_id: string :param instance_id:...
def update_instance(self, instance_id, layer_ids=None, instance_type=None, auto_scaling_type=None, hostname=None, os=None, ami_id=None, ssh_key_name=None, architecture=None, install_updates_on_boot=None, ebs_optimized=None):
params = {'InstanceId': instance_id} if (layer_ids is not None): params['LayerIds'] = layer_ids if (instance_type is not None): params['InstanceType'] = instance_type if (auto_scaling_type is not None): params['AutoScalingType'] = auto_scaling_type if (hostname is not None): ...
'Updates a specified layer. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type layer_id: string :param layer_id: The laye...
def update_layer(self, layer_id, name=None, shortname=None, attributes=None, custom_instance_profile_arn=None, custom_security_group_ids=None, packages=None, volume_configurations=None, enable_auto_healing=None, auto_assign_elastic_ips=None, auto_assign_public_ips=None, custom_recipes=None, install_updates_on_boot=None...
params = {'LayerId': layer_id} if (name is not None): params['Name'] = name if (shortname is not None): params['Shortname'] = shortname if (attributes is not None): params['Attributes'] = attributes if (custom_instance_profile_arn is not None): params['CustomInstanceP...
'Updates a user\'s SSH public key. **Required Permissions**: To use this action, an IAM user must have self-management enabled or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type ssh_public_key: string :param ssh_public_key: The use...
def update_my_user_profile(self, ssh_public_key=None):
params = {} if (ssh_public_key is not None): params['SshPublicKey'] = ssh_public_key return self.make_request(action='UpdateMyUserProfile', body=json.dumps(params))
'Updates an Amazon RDS instance. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type rds_db_instance_arn: string :param rd...
def update_rds_db_instance(self, rds_db_instance_arn, db_user=None, db_password=None):
params = {'RdsDbInstanceArn': rds_db_instance_arn} if (db_user is not None): params['DbUser'] = db_user if (db_password is not None): params['DbPassword'] = db_password return self.make_request(action='UpdateRdsDbInstance', body=json.dumps(params))
'Updates a specified stack. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type stack_id: string :param stack_id: The stac...
def update_stack(self, stack_id, name=None, attributes=None, service_role_arn=None, default_instance_profile_arn=None, default_os=None, hostname_theme=None, default_availability_zone=None, default_subnet_id=None, custom_json=None, configuration_manager=None, chef_configuration=None, use_custom_cookbooks=None, custom_co...
params = {'StackId': stack_id} if (name is not None): params['Name'] = name if (attributes is not None): params['Attributes'] = attributes if (service_role_arn is not None): params['ServiceRoleArn'] = service_role_arn if (default_instance_profile_arn is not None): par...
'Updates a specified user profile. **Required Permissions**: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. :type iam_user_arn: string :param iam_user_arn: The user IAM ARN. :type ssh_username: ...
def update_user_profile(self, iam_user_arn, ssh_username=None, ssh_public_key=None, allow_self_management=None):
params = {'IamUserArn': iam_user_arn} if (ssh_username is not None): params['SshUsername'] = ssh_username if (ssh_public_key is not None): params['SshPublicKey'] = ssh_public_key if (allow_self_management is not None): params['AllowSelfManagement'] = allow_self_management ret...
'Updates an Amazon EBS volume\'s name or mount point. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see `M...
def update_volume(self, volume_id, name=None, mount_point=None):
params = {'VolumeId': volume_id} if (name is not None): params['Name'] = name if (mount_point is not None): params['MountPoint'] = mount_point return self.make_request(action='UpdateVolume', body=json.dumps(params))
'Deletes the specified delivery channel. The delivery channel cannot be deleted if it is the only delivery channel and the configuration recorder is still running. To delete the delivery channel, stop the running configuration recorder using the StopConfigurationRecorder action. :type delivery_channel_name: string :par...
def delete_delivery_channel(self, delivery_channel_name):
params = {'DeliveryChannelName': delivery_channel_name} return self.make_request(action='DeleteDeliveryChannel', body=json.dumps(params))
'Schedules delivery of a configuration snapshot to the Amazon S3 bucket in the specified delivery channel. After the delivery has started, AWS Config sends following notifications using an Amazon SNS topic that you have specified. + Notification of starting the delivery. + Notification of delivery completed, if the del...
def deliver_config_snapshot(self, delivery_channel_name):
params = {'deliveryChannelName': delivery_channel_name} return self.make_request(action='DeliverConfigSnapshot', body=json.dumps(params))