Creates a new IAM Role in the caller's namespace or x-emc-namespace header if provided.
| RoleName | The name of the role to create. |
| AssumeRolePolicyDocument | The trust relationship policy document that grants an entity permission to assume the role |
| MaxSessionDuration | The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours |
| Description | A description of the role. |
| Path | The path to the role. Optional, defaults to "/" and only "/" is allowed. |
| PermissionsBoundary | The ARN of the policy that is used to set the permissions boundary for the role. |
| Tags | A list of tags that you want to attach to the role being created. |
This call has no restrictions.
No Request Payload
| Field | Description | Type | Notes |
| CreateRoleResponse | |||
| Result | |||
| Role | |||
| Arn | Arn that identifies the role. | String | |
| AssumeRolePolicyDocument | The trust relationship policy document that grants an entity permission to assume the role. | String | |
| CreateDate | ISO 8601 DateTime when role was created. | String | |
| Description | The description of the IAM role. | String | |
| MaxSessionDuration | The maximum session duration (in seconds) that you want to set for the specified role. | Integer | |
| Path | The path to the IAM role. | String | |
| RoleId | Unique Id associated with the role. | String | |
| RoleName | Simple name identifying the role. | String | |
| Tags | The list of Tags associated with the role. | ||
| Tags |
0-* Elements |
||
| PermissionsBoundary | |||
| PermissionsBoundaryArn | The ARN of the policy set as permissions boundary. | String | |
| PermissionsBoundaryType | The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy. | String | |
| ResponseMetadata | |||
| RequestId | String |
NOTE: AssumeRolePolicyDocument must be url-encoded as a query parameter for the REST API request.
AssumeRolePolicyDocument in json format:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"urn:ecs:iam::ns:user/payroll1"
]
},
"Action": "sts:AssumeRole"
}
]
}
POST https://192.168.0.0::4443/iam?Action=CreateRole&RoleName=FinanceRoleAll&Path=%2F&AssumeRolePolicyDocument=%7B%22Version%22%3A%222012-10-17%22%2C%22Statement%22%3A%5B%7B%22Effect%22%3A%22Allow%22%2C%22Principal%22%3A%7B%22AWS%22%3A%5B%22urn%3Aecs%3Aiam%3A%3Ans%3Auser%2Fpayroll1%22%5D%7D%2C%22Action%22%3A%22sts%3AAssumeRole%22%7D%5D%7D&Tags.member.1.Key=Department&Tags.member.1.Value=Finance&MaxSessionDuration=3600
Accept: application/xml
X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
x-emc-namespace: <namespace>
HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:CreateRoleResponse xmlns:ns2="none">
<ResponseMetadata>
<RequestId>0af9f5b8:171648dacb1:19b24:1ca</RequestId>
</ResponseMetadata>
<CreateRoleResult>
<Role>
<Arn>urn:ecs:iam::ns:role/FinanceRoleAll</Arn>
<AssumeRolePolicyDocument>{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":["urn:ecs:iam::ns:user/payroll1"]},"Action":"sts:AssumeRole"}]}</AssumeRolePolicyDocument>
<CreateDate>2020-04-13T19:16:49Z</CreateDate>
<Description></Description>
<MaxSessionDuration>3600</MaxSessionDuration>
<Path>/</Path>
<RoleId>AROA01293C069EA32003</RoleId>
<RoleName>FinanceRoleAll</RoleName>
<Tags>
<member>
<Key>Department</Key>
<Value>Finance</Value>
</member>
</Tags>
</Role>
</CreateRoleResult>
</ns2:CreateRoleResponse>