Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ec2 ]



Modifies the ID format for the specified resource on a per-region basis. You can specify that resources should receive longer IDs (17-character IDs) when they are created. The following resource types support longer IDs: instance | reservation | snapshot | volume .

This setting applies to the IAM user who makes the request; it does not apply to the entire AWS account. By default, an IAM user defaults to the same settings as the root user. If you're using this action as the root user, then these settings apply to the entire account, unless an IAM user explicitly overrides these settings for themselves. For more information, see Resource IDs in the Amazon Elastic Compute Cloud User Guide .

Resources created with longer IDs are visible to all IAM roles and users, regardless of these settings and provided that they have permission to use the relevant Describe command for the resource type.


--resource <value>
--use-long-ids | --no-use-long-ids
[--cli-input-json <value>]


--resource (string)

The type of resource: instance | reservation | snapshot | volume

--use-long-ids | --no-use-long-ids (boolean)

Indicate whether the resource should use longer IDs (17-character IDs).

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values.

--generate-cli-skeleton (boolean) Prints a sample input JSON to standard output. Note the specified operation is not run if this argument is specified. The sample input can be used as an argument for --cli-input-json.


To enable the longer ID format for a resource

This example enables the longer ID format for the instance resource type. If the request is successful, no output is returned.


aws ec2 modify-id-format --resource instance --use-long-ids

To disable the longer ID format for a resource

This example disables the longer ID format for the instance resource type.


aws ec2 modify-id-format --resource instance --no-use-long-ids