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
See ‘aws help’ for descriptions of global parameters.
modify-identity-id-format
--principal-arn <value>
--resource <value>
--use-long-ids | --no-use-long-ids
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
--principal-arn
(string)
The ARN of the principal, which can be an IAM user, IAM role, or the root user. Specify
all
to modify the ID format for all IAM users, IAM roles, and the root user of the account.
--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)
--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.
See ‘aws help’ for descriptions of global parameters.
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