Auto Scaling

2015/01/20 - Auto Scaling - 2 updated api methods

CreateLaunchConfiguration (updated) Link ¶
Changes (request)
{'ClassicLinkVPCId': 'string', 'ClassicLinkVPCSecurityGroups': ['string']}

Creates a launch configuration.

If you exceed your maximum limit of launch configurations, which by default is 100 per region, the call fails. For information about viewing and updating these limits, see DescribeAccountLimits.

Request Syntax

client.create_launch_configuration(
    LaunchConfigurationName='string',
    ImageId='string',
    KeyName='string',
    SecurityGroups=[
        'string',
    ],
    ClassicLinkVPCId='string',
    ClassicLinkVPCSecurityGroups=[
        'string',
    ],
    UserData='string',
    InstanceId='string',
    InstanceType='string',
    KernelId='string',
    RamdiskId='string',
    BlockDeviceMappings=[
        {
            'VirtualName': 'string',
            'DeviceName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'VolumeSize': 123,
                'VolumeType': 'string',
                'DeleteOnTermination': True|False,
                'Iops': 123
            },
            'NoDevice': True|False
        },
    ],
    InstanceMonitoring={
        'Enabled': True|False
    },
    SpotPrice='string',
    IamInstanceProfile='string',
    EbsOptimized=True|False,
    AssociatePublicIpAddress=True|False,
    PlacementTenancy='string'
)
type LaunchConfigurationName

string

param LaunchConfigurationName

[REQUIRED]

The name of the launch configuration. This name must be unique within the scope of your AWS account.

type ImageId

string

param ImageId

The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. For more information, see Finding an AMI in the Amazon Elastic Compute Cloud User Guide .

type KeyName

string

param KeyName

The name of the key pair. For more information, see Amazon EC2 Key Pairs in the Amazon Elastic Compute Cloud User Guide .

type SecurityGroups

list

param SecurityGroups

One or more security groups with which to associate the instances.

If your instances are launched in EC2-Classic, you can either specify security group names or the security group IDs. For more information about security groups for EC2-Classic, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide .

If your instances are launched in a VPC, specify security group IDs. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .

  • (string) --

type ClassicLinkVPCId

string

param ClassicLinkVPCId

The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. This parameter can only be used if you are launching EC2-Classic instances. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .

type ClassicLinkVPCSecurityGroups

list

param ClassicLinkVPCSecurityGroups

The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId . This parameter is required if ClassicLinkVPCId is specified, and cannot be used otherwise. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .

  • (string) --

type UserData

string

param UserData

The user data to make available to the launched EC2 instances. For more information, see Instance Metadata and User Data in the Amazon Elastic Compute Cloud User Guide .

Note

At this time, launch configurations don't support compressed (zipped) user data files.

type InstanceId

string

param InstanceId

The ID of the EC2 instance to use to create the launch configuration.

The new launch configuration derives attributes from the instance, with the exception of the block device mapping.

To create a launch configuration with a block device mapping or override any other instance attributes, specify them as part of the same request.

For more information, see Create a Launch Configuration Using an EC2 Instance in the Auto Scaling Developer Guide .

type InstanceType

string

param InstanceType

The instance type of the Amazon EC2 instance. For information about available Amazon EC2 instance types, see Available Instance Types in the Amazon Elastic Cloud Compute User Guide.

type KernelId

string

param KernelId

The ID of the kernel associated with the Amazon EC2 AMI.

type RamdiskId

string

param RamdiskId

The ID of the RAM disk associated with the Amazon EC2 AMI.

type BlockDeviceMappings

list

param BlockDeviceMappings

One or more mappings that specify how block devices are exposed to the instance. For more information, see Block Device Mapping in the Amazon Elastic Compute Cloud User Guide .

  • (dict) --

    Describes a block device mapping.

    • VirtualName (string) --

      The name of the virtual device, ephemeral0 to ephemeral3 .

    • DeviceName (string) -- [REQUIRED]

      The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh ).

    • Ebs (dict) --

      The information about the Amazon EBS volume.

      • SnapshotId (string) --

        The ID of the snapshot.

      • VolumeSize (integer) --

        The volume size, in gigabytes.

        Valid values: If the volume type is io1 , the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize , VolumeSize must be equal to or larger than the size of the snapshot.

        Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

        Required: Required when the volume type is io1 .

      • VolumeType (string) --

        The volume type.

        Valid values: standard | io1 | gp2

        Default: standard

      • DeleteOnTermination (boolean) --

        Indicates whether to delete the volume on instance termination.

        Default: true

      • Iops (integer) --

        For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

        Valid values: Range is 100 to 4000.

        Default: None

    • NoDevice (boolean) --

      Suppresses a device mapping.

      Note

      If NoDevice is set to true for the root device, the instance might fail the EC2 health check. Auto Scaling launches a replacement instance if the instance fails the health check.

type InstanceMonitoring

dict

param InstanceMonitoring

Enables detailed monitoring if it is disabled. Detailed monitoring is enabled by default.

When detailed monitoring is enabled, Amazon Cloudwatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, by specifying False , Cloudwatch generates metrics every 5 minutes. For more information, see Monitor Your Auto Scaling Instances in the Auto Scaling Developer Guide .

  • Enabled (boolean) --

    If True , instance monitoring is enabled.

type SpotPrice

string

param SpotPrice

The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot market price. For more information, see Launch Spot Instances in Your Auto Scaling Group in the Auto Scaling Developer Guide .

type IamInstanceProfile

string

param IamInstanceProfile

The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.

Amazon EC2 instances launched with an IAM role will automatically have AWS security credentials available. You can use IAM roles with Auto Scaling to automatically enable applications running on your Amazon EC2 instances to securely access other AWS resources. For more information, see Launch Auto Scaling Instances with an IAM Role in the Auto Scaling Developer Guide .

type EbsOptimized

boolean

param EbsOptimized

Indicates whether the instance is optimized for Amazon EBS I/O. By default, the instance is not optimized for EBS I/O. The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional usage charges apply. For more information, see Amazon EBS-Optimized Instances in the Amazon Elastic Compute Cloud User Guide .

type AssociatePublicIpAddress

boolean

param AssociatePublicIpAddress

Used for groups that launch instances into a virtual private cloud (VPC). Specifies whether to assign a public IP address to each instance. For more information, see Auto Scaling and Amazon VPC in the Auto Scaling Developer Guide .

Note

If you specify a value for this parameter, be sure to specify at least one subnet using the VPCZoneIdentifier parameter when you create your group.

Default: If the instance is launched into a default subnet, the default is true . If the instance is launched into a nondefault subnet, the default is false . For more information, see Supported Platforms in the Amazon Elastic Compute Cloud User Guide .

type PlacementTenancy

string

param PlacementTenancy

The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware and can only be launched in a VPC.

You must set the value of this parameter to dedicated if want to launch Dedicated Instances in a shared tenancy VPC (VPC with instance placement tenancy attribute set to default ).

If you specify a value for this parameter, be sure to specify at least one VPC subnet using the VPCZoneIdentifier parameter when you create your group.

For more information, see Auto Scaling and Amazon VPC in the Auto Scaling Developer Guide .

Valid values: default | dedicated

returns

None

DescribeLaunchConfigurations (updated) Link ¶
Changes (response)
{'LaunchConfigurations': {'ClassicLinkVPCId': 'string',
                          'ClassicLinkVPCSecurityGroups': ['string']}}

Describes one or more launch configurations. If you omit the list of names, then the call describes all launch configurations.

You can specify a maximum number of items to be returned with a single call. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token in the NextToken parameter.

Request Syntax

client.describe_launch_configurations(
    LaunchConfigurationNames=[
        'string',
    ],
    NextToken='string',
    MaxRecords=123
)
type LaunchConfigurationNames

list

param LaunchConfigurationNames

The launch configuration names.

  • (string) --

type NextToken

string

param NextToken

The token for the next set of items to return. (You received this token from a previous call.)

type MaxRecords

integer

param MaxRecords

The maximum number of items to return with this call. The default is 100.

rtype

dict

returns

Response Syntax

{
    'LaunchConfigurations': [
        {
            'LaunchConfigurationName': 'string',
            'LaunchConfigurationARN': 'string',
            'ImageId': 'string',
            'KeyName': 'string',
            'SecurityGroups': [
                'string',
            ],
            'ClassicLinkVPCId': 'string',
            'ClassicLinkVPCSecurityGroups': [
                'string',
            ],
            'UserData': 'string',
            'InstanceType': 'string',
            'KernelId': 'string',
            'RamdiskId': 'string',
            'BlockDeviceMappings': [
                {
                    'VirtualName': 'string',
                    'DeviceName': 'string',
                    'Ebs': {
                        'SnapshotId': 'string',
                        'VolumeSize': 123,
                        'VolumeType': 'string',
                        'DeleteOnTermination': True|False,
                        'Iops': 123
                    },
                    'NoDevice': True|False
                },
            ],
            'InstanceMonitoring': {
                'Enabled': True|False
            },
            'SpotPrice': 'string',
            'IamInstanceProfile': 'string',
            'CreatedTime': datetime(2015, 1, 1),
            'EbsOptimized': True|False,
            'AssociatePublicIpAddress': True|False,
            'PlacementTenancy': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • LaunchConfigurations (list) --

      The launch configurations.

      • (dict) --

        Describes a launch configuration.

        • LaunchConfigurationName (string) --

          The name of the launch configuration.

        • LaunchConfigurationARN (string) --

          The Amazon Resource Name (ARN) of the launch configuration.

        • ImageId (string) --

          The ID of the Amazon Machine Image (AMI).

        • KeyName (string) --

          The name of the key pair.

        • SecurityGroups (list) --

          The security groups to associate with the EC2 instances.

          • (string) --

        • ClassicLinkVPCId (string) --

          The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. This parameter can only be used if you are launching EC2-Classic instances. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .

        • ClassicLinkVPCSecurityGroups (list) --

          The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId . This parameter is required if ClassicLinkVPCId is specified, and cannot be used otherwise. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .

          • (string) --

        • UserData (string) --

          The user data available to the EC2 instances.

        • InstanceType (string) --

          The instance type for the EC2 instances.

        • KernelId (string) --

          The ID of the kernel associated with the AMI.

        • RamdiskId (string) --

          The ID of the RAM disk associated with the AMI.

        • BlockDeviceMappings (list) --

          A block device mapping that specifies how block devices are exposed to the instance. Each mapping is made up of a virtualName and a deviceName .

          • (dict) --

            Describes a block device mapping.

            • VirtualName (string) --

              The name of the virtual device, ephemeral0 to ephemeral3 .

            • DeviceName (string) --

              The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh ).

            • Ebs (dict) --

              The information about the Amazon EBS volume.

              • SnapshotId (string) --

                The ID of the snapshot.

              • VolumeSize (integer) --

                The volume size, in gigabytes.

                Valid values: If the volume type is io1 , the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize , VolumeSize must be equal to or larger than the size of the snapshot.

                Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

                Required: Required when the volume type is io1 .

              • VolumeType (string) --

                The volume type.

                Valid values: standard | io1 | gp2

                Default: standard

              • DeleteOnTermination (boolean) --

                Indicates whether to delete the volume on instance termination.

                Default: true

              • Iops (integer) --

                For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

                Valid values: Range is 100 to 4000.

                Default: None

            • NoDevice (boolean) --

              Suppresses a device mapping.

              Note

              If NoDevice is set to true for the root device, the instance might fail the EC2 health check. Auto Scaling launches a replacement instance if the instance fails the health check.

        • InstanceMonitoring (dict) --

          Controls whether instances in this group are launched with detailed monitoring.

          • Enabled (boolean) --

            If True , instance monitoring is enabled.

        • SpotPrice (string) --

          The price to bid when launching Spot Instances.

        • IamInstanceProfile (string) --

          The name or Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.

        • CreatedTime (datetime) --

          The creation date and time for the launch configuration.

        • EbsOptimized (boolean) --

          Controls whether the instance is optimized for EBS I/O ( true ) or not ( false ).

        • AssociatePublicIpAddress (boolean) --

          Specifies whether the EC2 instances are associated with a public IP address ( true ) or not ( false ).

        • PlacementTenancy (string) --

          The tenancy of the instance, either default or dedicated . An instance with dedicated tenancy runs in an isolated, single-tenant hardware and can only be launched in a VPC.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.