Amazon Elastic Compute Cloud

2015/01/08 - Amazon Elastic Compute Cloud - 6 new 1 updated api methods

AttachClassicLinkVpc (new) Link ¶

Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the running state. An instance is automatically unlinked from a VPC when it's stopped - you can link it to the VPC again when you restart it.

After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.

Linking your instance to a VPC is sometimes referred to as attaching your instance.

Request Syntax

client.attach_classic_link_vpc(
    DryRun=True|False,
    InstanceId='string',
    VpcId='string',
    Groups=[
        'string',
    ]
)
type DryRun

boolean

param DryRun

type InstanceId

string

param InstanceId

[REQUIRED]

The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC.

type VpcId

string

param VpcId

[REQUIRED]

The ID of a ClassicLink-enabled VPC.

type Groups

list

param Groups

[REQUIRED]

The ID of one or more of the VPC's security groups. You cannot specify security groups from a different VPC.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'Return': True|False
}

Response Structure

  • (dict) --

    • Return (boolean) --

      Returns true if the request succeeds; otherwise, it returns an error.

DescribeClassicLinkInstances (new) Link ¶

Describes one or more of your linked EC2-Classic instances. This request only returns information about EC2-Classic instances linked to a VPC through ClassicLink; you cannot use this request to return information about other instances.

Request Syntax

client.describe_classic_link_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123
)
type DryRun

boolean

param DryRun

type InstanceIds

list

param InstanceIds

One or more instance IDs. Must be instances linked to a VPC through ClassicLink.

  • (string) --

type Filters

list

param Filters

One or more filters.

  • group-id - The ID of a VPC security group that's associated with the instance.

  • instance-id - The ID of the instance.

  • tag :key =*value* - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag :key =*value* filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • vpc-id - The ID of the VPC that the instance is linked to.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type NextToken

string

param NextToken

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

type MaxResults

integer

param MaxResults

The maximum number of items to return for this request. The request returns a token that you can specify in a subsequent call to get the next set of results.

Constraint: If the value is greater than 1000, we return only 1000 items.

rtype

dict

returns

Response Syntax

{
    'Instances': [
        {
            'InstanceId': 'string',
            'VpcId': 'string',
            'Groups': [
                {
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Instances (list) --

      Information about one or more linked EC2-Classic instances.

      • (dict) --

        Describes a linked EC2-Classic instance.

        • InstanceId (string) --

          The ID of the instance.

        • VpcId (string) --

          The ID of the VPC.

        • Groups (list) --

          A list of security groups.

          • (dict) --

            Describes a security group.

            • GroupName (string) --

              The name of the security group.

            • GroupId (string) --

              The ID of the security group.

        • Tags (list) --

          Any tags assigned to the instance.

          • (dict) --

            Describes a tag.

            • Key (string) --

              The key of the tag.

              Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

            • Value (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

    • 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.

DetachClassicLinkVpc (new) Link ¶

Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance has been unlinked, the VPC security groups are no longer associated with it. An instance is automatically unlinked from a VPC when it's stopped.

Request Syntax

client.detach_classic_link_vpc(
    DryRun=True|False,
    InstanceId='string',
    VpcId='string'
)
type DryRun

boolean

param DryRun

type InstanceId

string

param InstanceId

[REQUIRED]

The ID of the instance to unlink from the VPC.

type VpcId

string

param VpcId

[REQUIRED]

The ID of the VPC to which the instance is linked.

rtype

dict

returns

Response Syntax

{
    'Return': True|False
}

Response Structure

  • (dict) --

    • Return (boolean) --

      Returns true if the request succeeds; otherwise, it returns an error.

DescribeImages (updated) Link ¶
Changes (response)
{'Images': {'CreationDate': 'string'}}

Describes one or more of the images (AMIs, AKIs, and ARIs) available to you. Images available to you include public images, private images that you own, and private images owned by other AWS accounts but for which you have explicit launch permissions.

Note

Deregistered images are included in the returned results for an unspecified interval after deregistration.

Request Syntax

client.describe_images(
    DryRun=True|False,
    ImageIds=[
        'string',
    ],
    Owners=[
        'string',
    ],
    ExecutableUsers=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun

boolean

param DryRun

type ImageIds

list

param ImageIds

One or more image IDs.

Default: Describes all images available to you.

  • (string) --

type Owners

list

param Owners

Filters the images by the owner. Specify an AWS account ID, amazon (owner is Amazon), aws-marketplace (owner is AWS Marketplace), self (owner is the sender of the request), or all (all owners).

  • (string) --

type ExecutableUsers

list

param ExecutableUsers

Scopes the images by users with explicit launch permissions. Specify an AWS account ID, self (the sender of the request), or all (public AMIs).

  • (string) --

type Filters

list

param Filters

One or more filters.

  • architecture - The image architecture ( i386 | x86_64 ).

  • block-device-mapping.delete-on-termination - A Boolean value that indicates whether the Amazon EBS volume is deleted on instance termination.

  • block-device-mapping.device-name - The device name for the Amazon EBS volume (for example, /dev/sdh ).

  • block-device-mapping.snapshot-id - The ID of the snapshot used for the Amazon EBS volume.

  • block-device-mapping.volume-size - The volume size of the Amazon EBS volume, in GiB.

  • block-device-mapping.volume-type - The volume type of the Amazon EBS volume ( gp2 | standard | io1 ).

  • description - The description of the image (provided during image creation).

  • hypervisor - The hypervisor type ( ovm | xen ).

  • image-id - The ID of the image.

  • image-type - The image type ( machine | kernel | ramdisk ).

  • is-public - A Boolean that indicates whether the image is public.

  • kernel-id - The kernel ID.

  • manifest-location - The location of the image manifest.

  • name - The name of the AMI (provided during image creation).

  • owner-alias - The AWS account alias (for example, amazon ).

  • owner-id - The AWS account ID of the image owner.

  • platform - The platform. To only list Windows-based AMIs, use windows .

  • product-code - The product code.

  • product-code.type - The type of the product code ( devpay | marketplace ).

  • ramdisk-id - The RAM disk ID.

  • root-device-name - The name of the root device volume (for example, /dev/sda1 ).

  • root-device-type - The type of the root device volume ( ebs | instance-store ).

  • state - The state of the image ( available | pending | failed ).

  • state-reason-code - The reason code for the state change.

  • state-reason-message - The message for the state change.

  • tag :key =*value* - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag :key =*value* filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • virtualization-type - The virtualization type ( paravirtual | hvm ).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype

dict

returns

Response Syntax

{
    'Images': [
        {
            'ImageId': 'string',
            'ImageLocation': 'string',
            'State': 'available'|'deregistered',
            'OwnerId': 'string',
            'CreationDate': 'string',
            'Public': True|False,
            'ProductCodes': [
                {
                    'ProductCodeId': 'string',
                    'ProductCodeType': 'devpay'|'marketplace'
                },
            ],
            'Architecture': 'i386'|'x86_64',
            'ImageType': 'machine'|'kernel'|'ramdisk',
            'KernelId': 'string',
            'RamdiskId': 'string',
            'Platform': 'Windows',
            'SriovNetSupport': 'string',
            'StateReason': {
                'Code': 'string',
                'Message': 'string'
            },
            'ImageOwnerAlias': 'string',
            'Name': 'string',
            'Description': 'string',
            'RootDeviceType': 'ebs'|'instance-store',
            'RootDeviceName': 'string',
            'BlockDeviceMappings': [
                {
                    'VirtualName': 'string',
                    'DeviceName': 'string',
                    'Ebs': {
                        'SnapshotId': 'string',
                        'VolumeSize': 123,
                        'DeleteOnTermination': True|False,
                        'VolumeType': 'standard'|'io1'|'gp2',
                        'Iops': 123,
                        'Encrypted': True|False
                    },
                    'NoDevice': 'string'
                },
            ],
            'VirtualizationType': 'hvm'|'paravirtual',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'Hypervisor': 'ovm'|'xen'
        },
    ]
}

Response Structure

  • (dict) --

    • Images (list) --

      Information about one or more images.

      • (dict) --

        Describes an image.

        • ImageId (string) --

          The ID of the AMI.

        • ImageLocation (string) --

          The location of the AMI.

        • State (string) --

          The current state of the AMI. If the state is available , the image is successfully registered and can be used to launch an instance.

        • OwnerId (string) --

          The AWS account ID of the image owner.

        • CreationDate (string) --

        • Public (boolean) --

          Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.

        • ProductCodes (list) --

          Any product codes associated with the AMI.

          • (dict) --

            Describes a product code.

            • ProductCodeId (string) --

              The product code.

            • ProductCodeType (string) --

              The type of product code.

        • Architecture (string) --

          The architecture of the image.

        • ImageType (string) --

          The type of image.

        • KernelId (string) --

          The kernel associated with the image, if any. Only applicable for machine images.

        • RamdiskId (string) --

          The RAM disk associated with the image, if any. Only applicable for machine images.

        • Platform (string) --

          The value is Windows for Windows AMIs; otherwise blank.

        • SriovNetSupport (string) --

          Specifies whether enhanced networking is enabled.

        • StateReason (dict) --

          The reason for the state change.

          • Code (string) --

            The reason code for the state change.

          • Message (string) --

            The message for the state change.

            • Server.SpotInstanceTermination : A Spot Instance was terminated due to an increase in the market price.

            • Server.InternalError : An internal error occurred during instance launch, resulting in termination.

            • Server.InsufficientInstanceCapacity : There was insufficient instance capacity to satisfy the launch request.

            • Client.InternalError : A client error caused the instance to terminate on launch.

            • Client.InstanceInitiatedShutdown : The instance was shut down using the shutdown -h command from the instance.

            • Client.UserInitiatedShutdown : The instance was shut down using the Amazon EC2 API.

            • Client.VolumeLimitExceeded : The volume limit was exceeded.

            • Client.InvalidSnapshot.NotFound : The specified snapshot was not found.

        • ImageOwnerAlias (string) --

          The AWS account alias (for example, amazon , self ) or the AWS account ID of the AMI owner.

        • Name (string) --

          The name of the AMI that was provided during image creation.

        • Description (string) --

          The description of the AMI that was provided during image creation.

        • RootDeviceType (string) --

          The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.

        • RootDeviceName (string) --

          The device name of the root device (for example, /dev/sda1or xvda).

        • BlockDeviceMappings (list) --

          Any block device mapping entries.

          • (dict) --

            Describes a block device mapping.

            • VirtualName (string) --

              The virtual device name (ephemeral[0..3]). The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

              Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.

            • DeviceName (string) --

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

            • Ebs (dict) --

              Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

              • SnapshotId (string) --

                The ID of the snapshot.

              • VolumeSize (integer) --

                The size of the volume, in GiB.

                Constraints: If the volume type is io1 , the minimum size of the volume is 10 GiB; otherwise, the minimum size is 1 GiB. The maximum volume size is 1024 GiB. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

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

              • DeleteOnTermination (boolean) --

                Indicates whether the Amazon EBS volume is deleted on instance termination.

              • VolumeType (string) --

                The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

                Default: standard

              • Iops (integer) --

                The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS (SSD) volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose (SSD) volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .

                Constraint: Range is 100 to 4000 for Provisioned IOPS (SSD) volumes and 3 to 3072 for General Purpose (SSD) volumes.

                Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

              • Encrypted (boolean) --

                Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

            • NoDevice (string) --

              Suppresses the specified device included in the block device mapping of the AMI.

        • VirtualizationType (string) --

          The type of virtualization of the AMI.

        • Tags (list) --

          Any tags assigned to the image.

          • (dict) --

            Describes a tag.

            • Key (string) --

              The key of the tag.

              Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

            • Value (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • Hypervisor (string) --

          The hypervisor type of the image.