Skip to content

Commit 2cc0dee

Browse files
Merge pull request aws#2040 from awsdocs/ec2-examples
New EC2 examples
2 parents f8df4da + 17d2b34 commit 2cc0dee

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
**To describe the ID format for an IAM role**
2+
3+
This example describes the ID format of the ``instance`` resource for the IAM role ``EC2Role`` in your AWS account. The output indicates that instances are enabled for longer IDs - instances created by this role receive longer IDs.
4+
5+
Command::
6+
7+
aws ec2 describe-identity-id-format --principal-arn arn:aws:iam::123456789012:role/EC2Role --resource instance
8+
9+
Output::
10+
11+
{
12+
"Statuses": [
13+
{
14+
"UseLongIds": true,
15+
"Resource": "instance"
16+
}
17+
]
18+
}
19+
20+
**To describe the ID format for an IAM user**
21+
22+
This example describes the ID format of the ``snapshot`` resource for the IAM user ``AdminUser`` in your AWS account. The output indicates that snapshots are enabled for longer IDs - snapshots created by this user receive longer IDs.
23+
24+
Command::
25+
26+
aws ec2 describe-identity-id-format --principal-arn arn:aws:iam::123456789012:user/AdminUser --resource snapshot
27+
28+
Output::
29+
30+
{
31+
"Statuses": [
32+
{
33+
"UseLongIds": true,
34+
"Resource": "snapshot"
35+
}
36+
]
37+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
**To enable an IAM role to use longer IDs for a resource**
2+
3+
This example enables the IAM role ``EC2Role`` in your AWS account to use the longer ID format for the ``instance`` resource type. If the request is successful, no output is returned.
4+
5+
Command::
6+
7+
aws ec2 modify-identity-id-format --principal-arn arn:aws:iam::123456789012:role/EC2Role --resource instance --use-long-ids
8+
9+
**To enable an IAM user to use longer IDs for a resource**
10+
11+
This example enables the IAM user ``AdminUser`` in your AWS account to use the longer ID format for the ``volume`` resource type. If the request is successful, no output is returned.
12+
13+
Command::
14+
15+
aws ec2 modify-identity-id-format --principal-arn arn:aws:iam::123456789012:user/AdminUser --resource volume --use-long-ids

0 commit comments

Comments
 (0)