| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Updates the policy that controls who can assume a given role.
Note
Currently, permission to assume a role is limited to Amazon EC2 instances in your AWS account only.
iam-roleupdateassumepolicy -r
ROLENAME
[ -f POLICYDOCUMENTFILE | -s SERVICE]
[-o]
| Name | Description | Required |
|---|---|---|
|
|
Name of the role to update. Type: String Default: None |
Yes |
|
|
The entity that can assume the role. Currently, the only entity that can assume
a role is an Amazon EC2 instance. For Amazon EC2,
the value is the EC2 endpoint Type: String Condition: Either Default: None |
Conditional |
|
|
Path and name of the file containing the policy. Type: String Condition: Either Default: None |
Conditional |
|
|
Causes the response to include the new JSON policy document. Type: String Default: None |
No |
If the command is successful, the output is empty.
The following example updates a role so that an Amazon EC2 instance can assume the role.
The -o option causes the output to include the role's JSON policy document.
PROMPT> iam-roleupdateassumepolicy -r myrole -s ec2.amazonaws.com -o
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":["ec2.amazonaws.com"]},"Action":["sts:AssumeRole"]}]}