2021/03/30 - Amazon Elastic Compute Cloud - 5 new api methods
Changes ReplaceRootVolume feature enables customers to replace the EBS root volume of a running instance to a previously known state. Add support to grant account-level access to the EC2 serial console
Creates a root volume replacement task for an Amazon EC2 instance. The root volume can either be restored to its initial launch state, or it can be restored using a specific snapshot.
For more information, see Replace a root volume in the Amazon Elastic Compute Cloud User Guide.
See also: AWS API Documentation
Request Syntax
client.create_replace_root_volume_task( InstanceId='string', SnapshotId='string', ClientToken='string', DryRun=True|False, TagSpecifications=[ { 'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'egress-only-internet-gateway'|'elastic-ip'|'elastic-gpu'|'export-image-task'|'export-instance-task'|'fleet'|'fpga-image'|'host-reservation'|'image'|'import-image-task'|'import-snapshot-task'|'instance'|'internet-gateway'|'key-pair'|'launch-template'|'local-gateway-route-table-vpc-association'|'natgateway'|'network-acl'|'network-interface'|'network-insights-analysis'|'network-insights-path'|'placement-group'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-fleet-request'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-connect-peer'|'transit-gateway-multicast-domain'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway'|'vpc-flow-log', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] }, ] )
string
[REQUIRED]
The ID of the instance for which to replace the root volume.
string
The ID of the snapshot from which to restore the replacement root volume. If you want to restore the volume to the initial launch state, omit this parameter.
string
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency. For more information, see Ensuring Idempotency.
This field is autopopulated if not provided.
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
list
The tags to apply to the root volume replacement task.
(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: capacity-reservation | carrier-gateway | client-vpn-endpoint | customer-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | fpga-image | host-reservation | image``| ``import-image-task | import-snapshot-task | instance | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | launch-template | local-gateway-route-table-vpc-association | placement-group | prefix-list | natgateway | network-acl | network-interface | reserved-instances | route-table | security-group``| ``snapshot | spot-fleet-request | spot-instances-request | snapshot | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target | transit-gateway | transit-gateway-attachment | transit-gateway-multicast-domain | transit-gateway-route-table | volume | vpc | vpc-peering-connection | vpc-endpoint (for interface and gateway endpoints) | vpc-endpoint-service (for AWS PrivateLink) | vpc-flow-log | vpn-connection | vpn-gateway.
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.
dict
Response Syntax
{ 'ReplaceRootVolumeTask': { 'ReplaceRootVolumeTaskId': 'string', 'InstanceId': 'string', 'TaskState': 'pending'|'in-progress'|'failing'|'succeeded'|'failed'|'failed-detached', 'StartTime': 'string', 'CompleteTime': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }
Response Structure
(dict) --
ReplaceRootVolumeTask (dict) --
Information about the root volume replacement task.
ReplaceRootVolumeTaskId (string) --
The ID of the root volume replacement task.
InstanceId (string) --
The ID of the instance for which the root volume replacement task was created.
TaskState (string) --
The state of the task. The task can be in one of the following states:
pending - the replacement volume is being created.
in-progress - the original volume is being detached and the replacement volume is being attached.
succeeded - the replacement volume has been successfully attached to the instance and the instance is available.
failing - the replacement task is in the process of failing.
failed - the replacement task has failed but the original root volume is still attached.
failing-detached - the replacement task is in the process of failing. The instance might have no root volume attached.
failed-detached - the replacement task has failed and the instance has no root volume attached.
StartTime (string) --
The time the task was started.
CompleteTime (string) --
The time the task completed.
Tags (list) --
The tags assigned to the task.
(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.
Retrieves the access status of your account to the EC2 serial console of all instances. By default, access to the EC2 serial console is disabled for your account. For more information, see Manage account access to the EC2 serial console in the Amazon EC2 User Guide.
See also: AWS API Documentation
Request Syntax
client.get_serial_console_access_status( DryRun=True|False )
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
dict
Response Syntax
{ 'SerialConsoleAccessEnabled': True|False }
Response Structure
(dict) --
SerialConsoleAccessEnabled (boolean) --
If true, access to the EC2 serial console of all instances is enabled for your account. If false, access to the EC2 serial console of all instances is disabled for your account.
Disables access to the EC2 serial console of all instances for your account. By default, access to the EC2 serial console is disabled for your account. For more information, see Manage account access to the EC2 serial console in the Amazon EC2 User Guide.
See also: AWS API Documentation
Request Syntax
client.disable_serial_console_access( DryRun=True|False )
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
dict
Response Syntax
{ 'SerialConsoleAccessEnabled': True|False }
Response Structure
(dict) --
SerialConsoleAccessEnabled (boolean) --
If true, access to the EC2 serial console of all instances is enabled for your account. If false, access to the EC2 serial console of all instances is disabled for your account.
Describes a root volume replacement task. For more information, see Replace a root volume in the Amazon Elastic Compute Cloud User Guide.
See also: AWS API Documentation
Request Syntax
client.describe_replace_root_volume_tasks( ReplaceRootVolumeTaskIds=[ 'string', ], Filters=[ { 'Name': 'string', 'Values': [ 'string', ] }, ], MaxResults=123, NextToken='string', DryRun=True|False )
list
The ID of the root volume replacement task to view.
(string) --
list
Filter to use:
instance-id - The ID of the instance for which the root volume replacement task was created.
(dict) --
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.
Name (string) --
The name of the filter. Filter names are case-sensitive.
Values (list) --
The filter values. Filter values are case-sensitive.
(string) --
integer
The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
string
The token for the next page of results.
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
dict
Response Syntax
{ 'ReplaceRootVolumeTasks': [ { 'ReplaceRootVolumeTaskId': 'string', 'InstanceId': 'string', 'TaskState': 'pending'|'in-progress'|'failing'|'succeeded'|'failed'|'failed-detached', 'StartTime': 'string', 'CompleteTime': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] }, ], 'NextToken': 'string' }
Response Structure
(dict) --
ReplaceRootVolumeTasks (list) --
Information about the root volume replacement task.
(dict) --
Information about a root volume replacement task.
ReplaceRootVolumeTaskId (string) --
The ID of the root volume replacement task.
InstanceId (string) --
The ID of the instance for which the root volume replacement task was created.
TaskState (string) --
The state of the task. The task can be in one of the following states:
pending - the replacement volume is being created.
in-progress - the original volume is being detached and the replacement volume is being attached.
succeeded - the replacement volume has been successfully attached to the instance and the instance is available.
failing - the replacement task is in the process of failing.
failed - the replacement task has failed but the original root volume is still attached.
failing-detached - the replacement task is in the process of failing. The instance might have no root volume attached.
failed-detached - the replacement task has failed and the instance has no root volume attached.
StartTime (string) --
The time the task was started.
CompleteTime (string) --
The time the task completed.
Tags (list) --
The tags assigned to the task.
(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 to retrieve the next page of results. This value is null when there are no more results to return.
Enables access to the EC2 serial console of all instances for your account. By default, access to the EC2 serial console is disabled for your account. For more information, see Manage account access to the EC2 serial console in the Amazon EC2 User Guide.
See also: AWS API Documentation
Request Syntax
client.enable_serial_console_access( DryRun=True|False )
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
dict
Response Syntax
{ 'SerialConsoleAccessEnabled': True|False }
Response Structure
(dict) --
SerialConsoleAccessEnabled (boolean) --
If true, access to the EC2 serial console of all instances is enabled for your account. If false, access to the EC2 serial console of all instances is disabled for your account.