public class AssumeRoleRequest
extends com.aliyun.tea.TeaModel
| 限定符和类型 | 字段和说明 |
|---|---|
Long |
durationSeconds
The validity period of the STS token.
|
String |
externalId
The external ID of the RAM role.
|
String |
policy
The policy that specifies the permissions of the returned STS token.
|
String |
roleArn
The Alibaba Cloud Resource Name (ARN) of the RAM role.
|
String |
roleSessionName
The custom name of the role session.
|
String |
sourceIdentity |
| 构造器和说明 |
|---|
AssumeRoleRequest() |
| 限定符和类型 | 方法和说明 |
|---|---|
static AssumeRoleRequest |
build(Map<String,?> map) |
Long |
getDurationSeconds() |
String |
getExternalId() |
String |
getPolicy() |
String |
getRoleArn() |
String |
getRoleSessionName() |
String |
getSourceIdentity() |
AssumeRoleRequest |
setDurationSeconds(Long durationSeconds) |
AssumeRoleRequest |
setExternalId(String externalId) |
AssumeRoleRequest |
setPolicy(String policy) |
AssumeRoleRequest |
setRoleArn(String roleArn) |
AssumeRoleRequest |
setRoleSessionName(String roleSessionName) |
AssumeRoleRequest |
setSourceIdentity(String sourceIdentity) |
@NameInMap(value="DurationSeconds") public Long durationSeconds
The validity period of the STS token. Unit: seconds.
Minimum value: 900. Maximum value: the value of the MaxSessionDuration parameter. Default value: 3600.
You can call the CreateRole or UpdateRole operation to configure the MaxSessionDuration parameter. For more information, see CreateRole or UpdateRole.
3600
@NameInMap(value="ExternalId") public String externalId
The external ID of the RAM role.
This parameter is provided by an external party and is used to prevent the confused deputy problem. For more information, see Use ExternalId to prevent the confused deputy problem.
The value must be 2 to 1,224 characters in length and can contain letters, digits, and the following special characters: = , . @ : / - _. The regular expression for this parameter is [\\w+=,.@:\\/-]*.
abcd1234
@NameInMap(value="Policy") public String policy
The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role.
The value must be 1 to 2,048 characters in length.
For more information about policy elements and sample policies, see Policy elements and Overview of sample policies.
example:{"Statement": [{"Action": [""],"Effect": "Allow","Resource": [""]}],"Version":"1"}
@NameInMap(value="RoleArn") public String roleArn
The Alibaba Cloud Resource Name (ARN) of the RAM role.
The trusted entity of the RAM role is an Alibaba Cloud account. For more information, see Create a RAM role for a trusted Alibaba Cloud account or CreateRole.
Format: acs:ram::<account_id>:role/<role_name>.
You can view the ARN in the RAM console or by calling operations. The following items describe the validity periods of storage addresses:
This parameter is required.
example:acs:ram::123456789012****:role/adminrole
@NameInMap(value="RoleSessionName") public String roleSessionName
The custom name of the role session.
Set this parameter based on your business requirements. In most cases, you can set this parameter to the identity of the API caller. For example, you can specify a username. You can specify RoleSessionName to identify API callers that assume the same RAM role in ActionTrail logs. This allows you to track the users that perform the operations.
The value must be 2 to 64 characters in length and can contain letters, digits, and the following special characters: . @ - _.
This parameter is required.
example:alice
@NameInMap(value="SourceIdentity") public String sourceIdentity
public static AssumeRoleRequest build(Map<String,?> map) throws Exception
Exceptionpublic AssumeRoleRequest setDurationSeconds(Long durationSeconds)
public Long getDurationSeconds()
public AssumeRoleRequest setExternalId(String externalId)
public String getExternalId()
public AssumeRoleRequest setPolicy(String policy)
public String getPolicy()
public AssumeRoleRequest setRoleArn(String roleArn)
public String getRoleArn()
public AssumeRoleRequest setRoleSessionName(String roleSessionName)
public String getRoleSessionName()
public AssumeRoleRequest setSourceIdentity(String sourceIdentity)
public String getSourceIdentity()
Copyright © 2025. All rights reserved.