Amazon Elastic Compute Cloud

2019/05/29 - Amazon Elastic Compute Cloud - 1 new api methods

Changes  Customers can now simultaneously take snapshots of multiple EBS volumes attached to an EC2 instance. With this new capability, snapshots guarantee crash-consistency across multiple volumes by preserving the order of IO operations. This new feature is fully integrated with Amazon Data Lifecycle Manager (DLM) allowing customers to automatically manage snapshots by creating lifecycle policies.

CreateSnapshots (new) Link ΒΆ

Creates crash-consistent snapshots of multiple EBS volumes and stores the data in S3. Volumes are chosen by specifying an instance. Any attached volumes will produce one snapshot each that is crash-consistent across the instance. Boot volumes can be excluded by changing the paramaters.

See also: AWS API Documentation

Request Syntax

client.create_snapshots(
    Description='string',
    InstanceSpecification={
        'InstanceId': 'string',
        'ExcludeBootVolume': True|False
    },
    TagSpecifications=[
        {
            'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ],
    DryRun=True|False,
    CopyTagsFromSource='volume'
)
type Description

string

param Description

A description propagated to every snapshot specified by the instance.

type InstanceSpecification

dict

param InstanceSpecification

[REQUIRED]

The instance to specify which volumes should be included in the snapshots.

  • InstanceId (string) --

    The instance to specify which volumes should be snapshotted.

  • ExcludeBootVolume (boolean) --

    Excludes the root volume from being snapshotted.

type TagSpecifications

list

param TagSpecifications

Tags to apply to every snapshot specified by the instance.

  • (dict) --

    The tags to apply to a resource when the resource is being created.

    • ResourceType (string) --

      The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .

    • Tags (list) --

      The tags to apply to the resource.

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

type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action without actually making the request. Provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

type CopyTagsFromSource

string

param CopyTagsFromSource

Copies the tags from the specified instance to all snapshots.

rtype

dict

returns

Response Syntax

{
    'Snapshots': [
        {
            'Description': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'Encrypted': True|False,
            'VolumeId': 'string',
            'State': 'pending'|'completed'|'error',
            'VolumeSize': 123,
            'StartTime': datetime(2015, 1, 1),
            'Progress': 'string',
            'OwnerId': 'string',
            'SnapshotId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Snapshots (list) --

      List of snapshots.

      • (dict) --

        Object that contains information about a snapshot.

        • Description (string) --

          Description specified by the CreateSnapshotRequest that has been applied to all snapshots.

        • Tags (list) --

          Tags associated with this snapshot.

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

        • Encrypted (boolean) --

          Boolean that specifies whether or not this snapshot is encrypted.

        • VolumeId (string) --

          Source volume from which this snapshot was created.

        • State (string) --

          Current state of the snapshot.

        • VolumeSize (integer) --

          Size of the volume from which this snapshot was created.

        • StartTime (datetime) --

          Time this snapshot was started. This is the same for all snapshots initiated by the same request.

        • Progress (string) --

          Progress this snapshot has made towards completing.

        • OwnerId (string) --

          Account id used when creating this snapshot.

        • SnapshotId (string) --

          Snapshot id that can be used to describe this snapshot.