public static final class AssumeRoleRequest.Builder extends Object
限定符和类型 | 方法和说明 |
---|---|
AssumeRoleRequest |
build() |
AssumeRoleRequest.Builder |
durationSeconds(Long durationSeconds)
The validity period of the STS token.
|
AssumeRoleRequest.Builder |
externalId(String externalId)
The external ID of the RAM role.
|
AssumeRoleRequest.Builder |
policy(String policy)
The policy that specifies the permissions of the returned STS token.
|
AssumeRoleRequest.Builder |
roleArn(String roleArn)
The Alibaba Cloud Resource Name (ARN) of the RAM role.
|
AssumeRoleRequest.Builder |
roleSessionName(String roleSessionName)
The custom name of the role session.
|
public AssumeRoleRequest.Builder durationSeconds(Long durationSeconds)
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](~~28710~~) or [UpdateRole](~~28712~~).
public AssumeRoleRequest.Builder externalId(String externalId)
This parameter is provided by an external party and is used 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+=,.@:\/-]*`.
public AssumeRoleRequest.Builder policy(String policy)
* If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role. * If you do not specify this parameter, the returned STS token has all the permissions of 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](~~93738~~) and [Overview of sample policies](~~210969~~).
public AssumeRoleRequest.Builder roleArn(String roleArn)
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](~~93691~~) or [CreateRole](~~28710~~).
Format: `acs:ram::
public AssumeRoleRequest.Builder roleSessionName(String roleSessionName)
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: `. @ - _`.
public AssumeRoleRequest build()
Copyright © 2023. All rights reserved.