AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.
Modifies the ID format of a resource for a specified IAM user, IAM role, or the root user for an account; or all IAM users, IAM roles, and the root user for an account. You can specify that resources should receive longer IDs (17-character IDs) when they are created.
This request can only be used to modify longer ID settings for resource types that are within the opt-in period. Resources currently in their opt-in period include: bundle
| conversion-task
| customer-gateway
| dhcp-options
| elastic-ip-allocation
| elastic-ip-association
| export-task
| flow-log
| image
| import-task
| internet-gateway
| network-acl
| network-acl-association
| network-interface
| network-interface-attachment
| prefix-list
| route-table
| route-table-association
| security-group
| subnet
| subnet-cidr-block-association
| vpc
| vpc-cidr-block-association
| vpc-endpoint
| vpc-peering-connection
| vpn-connection
| vpn-gateway
.
For more information, see Resource IDs in the Amazon Elastic Compute Cloud User Guide .
This setting applies to the principal specified in the request; it does not apply to the principal that makes the request.
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.
See also: AWS API Documentation
modify-identity-id-format
--resource <value>
--use-long-ids | --no-use-long-ids
--principal-arn <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
--resource
(string)
The type of resource:
bundle
|conversion-task
|customer-gateway
|dhcp-options
|elastic-ip-allocation
|elastic-ip-association
|export-task
|flow-log
|image
|import-task
|internet-gateway
|network-acl
|network-acl-association
|network-interface
|network-interface-attachment
|prefix-list
|route-table
|route-table-association
|security-group
|subnet
|subnet-cidr-block-association
|vpc
|vpc-cidr-block-association
|vpc-endpoint
|vpc-peering-connection
|vpn-connection
|vpn-gateway
.Alternatively, use the
all-current
option to include all resource types that are currently within their opt-in period for longer IDs.
--use-long-ids
| --no-use-long-ids
(boolean)
Indicates whether the resource should use longer IDs (17-character IDs)
--principal-arn
(string)
The ARN of the principal, which can be an IAM user, IAM role, or the root user. Specifyall
to modify the ID format for all IAM users, IAM roles, and the root user of the account.
--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. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
--debug
(boolean)
Turn on debug logging.
--endpoint-url
(string)
Override command's default URL with the given URL.
--no-verify-ssl
(boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate
(boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output
(string)
The formatting style for command output.
--query
(string)
A JMESPath query to use in filtering the response data.
--profile
(string)
Use a specific profile from your credential file.
--region
(string)
The region to use. Overrides config/env settings.
--version
(string)
Display the version of this tool.
--color
(string)
Turn on/off color output.
--no-sign-request
(boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle
(string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout
(int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout
(int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
To enable an IAM role to use longer IDs for a resource
The following modify-identity-id-format
example enables the IAM role EC2Role
in your AWS account to use long ID format for the instance
resource type.
aws ec2 modify-identity-id-format \
--principal-arn arn:aws:iam::123456789012:role/EC2Role \
--resource instance \
--use-long-ids
To enable an IAM user to use longer IDs for a resource
The following modify-identity-id-format
example enables the IAM user AdminUser
in your AWS account to use the longer ID format for the volume
resource type.
aws ec2 modify-identity-id-format \
--principal-arn arn:aws:iam::123456789012:user/AdminUser \
--resource volume \
--use-long-ids
The following modify-identity-id-format
example enables the IAM user AdminUser
in your AWS account to use the longer ID format for all supported resource types that are within their opt-in period.
aws ec2 modify-identity-id-format \
--principal-arn arn:aws:iam::123456789012:user/AdminUser \
--resource all-current \
--use-long-ids
None