Describes the ID format settings for resources for the specified IAM user, IAM role, or root user. For example, you can view the resource types that are enabled for longer IDs. This request only returns information about resource types whose ID formats can be modified; it does not return information about other resource types. For more information, see Resource IDs in the Amazon Elastic Compute Cloud User Guide .
The following resource types support longer IDs: bundle
| conversion-task
| customer-gateway
| dhcp-options
| elastic-ip-allocation
| elastic-ip-association
| export-task
| flow-log
| image
| import-task
| instance
| internet-gateway
| network-acl
| network-acl-association
| network-interface
| network-interface-attachment
| prefix-list
| reservation
| route-table
| route-table-association
| security-group
| snapshot
| subnet
| subnet-cidr-block-association
| volume
| vpc
| vpc-cidr-block-association
| vpc-endpoint
| vpc-peering-connection
| vpn-connection
| vpn-gateway
.
These settings apply to the principal specified in the request. They do not apply to the principal that makes the request.
See also: AWS API Documentation
See ‘aws help’ for descriptions of global parameters.
describe-identity-id-format
--principal-arn <value>
[--resource <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
--principal-arn
(string)
The ARN of the principal, which can be an IAM role, IAM user, or the root user.
--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
|instance
|internet-gateway
|network-acl
|network-acl-association
|network-interface
|network-interface-attachment
|prefix-list
|reservation
|route-table
|route-table-association
|security-group
|snapshot
|subnet
|subnet-cidr-block-association
|volume
|vpc
|vpc-cidr-block-association
|vpc-endpoint
|vpc-peering-connection
|vpn-connection
|vpn-gateway
--cli-input-json
| --cli-input-yaml
(string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, those 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. This may not be specified along with --cli-input-yaml
.
--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
. Similarly, if provided yaml-input
it will print a sample input YAML that can be used with --cli-input-yaml
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
See ‘aws help’ for descriptions of global parameters.
Note
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 describe the ID format for an IAM role
The following describe-identity-id-format
example describes the ID format received by instances created by the IAM role EC2Role
in your AWS account.
aws ec2 describe-identity-id-format \
--principal-arn arn:aws:iam::123456789012:role/my-iam-role \
--resource instance
The following output indicates that instances created by this role receive IDs in long ID format.
{
"Statuses": [
{
"Deadline": "2016-12-15T00:00:00Z",
"Resource": "instance",
"UseLongIds": true
}
]
}
To describe the ID format for an IAM user
The following describe-identity-id-format
example describes the ID format received by snapshots created by the IAM user AdminUser
in your AWS account.
aws ec2 describe-identity-id-format \
--principal-arn arn:aws:iam::123456789012:user/AdminUser \
--resource snapshot
The output indicates that snapshots created by this user receive IDs in long ID format.
{
"Statuses": [
{
"Deadline": "2016-12-15T00:00:00Z",
"Resource": "snapshot",
"UseLongIds": true
}
]
}
Statuses -> (list)
Information about the ID format for the resources.
(structure)
Describes the ID format for a resource.
Deadline -> (timestamp)
The date in UTC at which you are permanently switched over to using longer IDs. If a deadline is not yet available for this resource type, this field is not returned.
Resource -> (string)
The type of resource.
UseLongIds -> (boolean)
Indicates whether longer IDs (17-character IDs) are enabled for the resource.