Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.securitytoken.model
Class AssumeRoleRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.securitytoken.model.AssumeRoleRequest

public class AssumeRoleRequest
extends AmazonWebServiceRequest

Container for the parameters to the AssumeRole operation.

The AssumeRole action returns a set of temporary security credentials that you can use to access resources that are defined in the role's policy. The returned credentials consist of an Access Key ID, a Secret Access Key, and a security token.

Important: Only IAM users can assume a role. If you use AWS account credentials to call AssumeRole, access is denied.

The credentials are valid for the duration that you specified when calling AssumeRole , which can be from 15 minutes to 1 hour.

When you assume a role, you have the privileges that are defined in the role. You can further restrict the privileges by passing a policy when calling AssumeRole .

To assume a role, you must be an IAM user from a trusted entity and have permission to call AssumeRole . Trusted entites are defined when the IAM role is created. Permission to call AssumeRole is defined in your or your group's IAM policy.

See Also:
AWSSecurityTokenService.assumeRole(AssumeRoleRequest)

Constructor Summary
AssumeRoleRequest()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Integer getDurationSeconds()
          The duration, in seconds, of the role session.
 java.lang.String getExternalId()
          A unique identifier that is generated by a third party for each of their customers.
 java.lang.String getPolicy()
          A supplemental policy that can be associated with the temporary security credentials.
 java.lang.String getRoleArn()
          The Amazon Resource Name (ARN) of the role that the caller is assuming.
 java.lang.String getRoleSessionName()
          An identifier for the assumed role session.
 int hashCode()
           
 void setDurationSeconds(java.lang.Integer durationSeconds)
          The duration, in seconds, of the role session.
 void setExternalId(java.lang.String externalId)
          A unique identifier that is generated by a third party for each of their customers.
 void setPolicy(java.lang.String policy)
          A supplemental policy that can be associated with the temporary security credentials.
 void setRoleArn(java.lang.String roleArn)
          The Amazon Resource Name (ARN) of the role that the caller is assuming.
 void setRoleSessionName(java.lang.String roleSessionName)
          An identifier for the assumed role session.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 AssumeRoleRequest withDurationSeconds(java.lang.Integer durationSeconds)
          The duration, in seconds, of the role session.
 AssumeRoleRequest withExternalId(java.lang.String externalId)
          A unique identifier that is generated by a third party for each of their customers.
 AssumeRoleRequest withPolicy(java.lang.String policy)
          A supplemental policy that can be associated with the temporary security credentials.
 AssumeRoleRequest withRoleArn(java.lang.String roleArn)
          The Amazon Resource Name (ARN) of the role that the caller is assuming.
 AssumeRoleRequest withRoleSessionName(java.lang.String roleSessionName)
          An identifier for the assumed role session.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getRequestClientOptions, getRequestCredentials, setRequestCredentials
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssumeRoleRequest

public AssumeRoleRequest()
Method Detail

getRoleArn

public java.lang.String getRoleArn()
The Amazon Resource Name (ARN) of the role that the caller is assuming.

Constraints:
Length: 20 - 2048

Returns:
The Amazon Resource Name (ARN) of the role that the caller is assuming.

setRoleArn

public void setRoleArn(java.lang.String roleArn)
The Amazon Resource Name (ARN) of the role that the caller is assuming.

Constraints:
Length: 20 - 2048

Parameters:
roleArn - The Amazon Resource Name (ARN) of the role that the caller is assuming.

withRoleArn

public AssumeRoleRequest withRoleArn(java.lang.String roleArn)
The Amazon Resource Name (ARN) of the role that the caller is assuming.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 20 - 2048

Parameters:
roleArn - The Amazon Resource Name (ARN) of the role that the caller is assuming.
Returns:
A reference to this updated object so that method calls can be chained together.

getRoleSessionName

public java.lang.String getRoleSessionName()
An identifier for the assumed role session. The session name is included as part of the AssumedRoleUser.

Constraints:
Length: 2 - 32
Pattern: [\w+=,.@-]*

Returns:
An identifier for the assumed role session. The session name is included as part of the AssumedRoleUser.

setRoleSessionName

public void setRoleSessionName(java.lang.String roleSessionName)
An identifier for the assumed role session. The session name is included as part of the AssumedRoleUser.

Constraints:
Length: 2 - 32
Pattern: [\w+=,.@-]*

Parameters:
roleSessionName - An identifier for the assumed role session. The session name is included as part of the AssumedRoleUser.

withRoleSessionName

public AssumeRoleRequest withRoleSessionName(java.lang.String roleSessionName)
An identifier for the assumed role session. The session name is included as part of the AssumedRoleUser.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 2 - 32
Pattern: [\w+=,.@-]*

Parameters:
roleSessionName - An identifier for the assumed role session. The session name is included as part of the AssumedRoleUser.
Returns:
A reference to this updated object so that method calls can be chained together.

getPolicy

public java.lang.String getPolicy()
A supplemental policy that can be associated with the temporary security credentials. The caller can restrict the permissions that are available on the role's temporary security credentials to maintain the least amount of privileges. When a service call is made with the temporary security credentials, both the role's permission policy and supplemental policy are checked. For more information about how permissions work in the context of temporary credentials, see Controlling Permissions in Temporary Credentials.

Constraints:
Length: 1 - 2048
Pattern: [ -?]+

Returns:
A supplemental policy that can be associated with the temporary security credentials. The caller can restrict the permissions that are available on the role's temporary security credentials to maintain the least amount of privileges. When a service call is made with the temporary security credentials, both the role's permission policy and supplemental policy are checked. For more information about how permissions work in the context of temporary credentials, see Controlling Permissions in Temporary Credentials.

setPolicy

public void setPolicy(java.lang.String policy)
A supplemental policy that can be associated with the temporary security credentials. The caller can restrict the permissions that are available on the role's temporary security credentials to maintain the least amount of privileges. When a service call is made with the temporary security credentials, both the role's permission policy and supplemental policy are checked. For more information about how permissions work in the context of temporary credentials, see Controlling Permissions in Temporary Credentials.

Constraints:
Length: 1 - 2048
Pattern: [ -?]+

Parameters:
policy - A supplemental policy that can be associated with the temporary security credentials. The caller can restrict the permissions that are available on the role's temporary security credentials to maintain the least amount of privileges. When a service call is made with the temporary security credentials, both the role's permission policy and supplemental policy are checked. For more information about how permissions work in the context of temporary credentials, see Controlling Permissions in Temporary Credentials.

withPolicy

public AssumeRoleRequest withPolicy(java.lang.String policy)
A supplemental policy that can be associated with the temporary security credentials. The caller can restrict the permissions that are available on the role's temporary security credentials to maintain the least amount of privileges. When a service call is made with the temporary security credentials, both the role's permission policy and supplemental policy are checked. For more information about how permissions work in the context of temporary credentials, see Controlling Permissions in Temporary Credentials.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 2048
Pattern: [ -?]+

Parameters:
policy - A supplemental policy that can be associated with the temporary security credentials. The caller can restrict the permissions that are available on the role's temporary security credentials to maintain the least amount of privileges. When a service call is made with the temporary security credentials, both the role's permission policy and supplemental policy are checked. For more information about how permissions work in the context of temporary credentials, see Controlling Permissions in Temporary Credentials.
Returns:
A reference to this updated object so that method calls can be chained together.

getDurationSeconds

public java.lang.Integer getDurationSeconds()
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds (1 hour).

Constraints:
Range: 900 - 3600

Returns:
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds (1 hour).

setDurationSeconds

public void setDurationSeconds(java.lang.Integer durationSeconds)
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds (1 hour).

Constraints:
Range: 900 - 3600

Parameters:
durationSeconds - The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds (1 hour).

withDurationSeconds

public AssumeRoleRequest withDurationSeconds(java.lang.Integer durationSeconds)
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds (1 hour).

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 900 - 3600

Parameters:
durationSeconds - The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds (1 hour).
Returns:
A reference to this updated object so that method calls can be chained together.

getExternalId

public java.lang.String getExternalId()
A unique identifier that is generated by a third party for each of their customers. For each role that the third party can assume, they should instruct their customers to create a role with the external ID that was generated by the third party. Each time the third party assumes the role, they must pass the customer's correct external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see About the External ID in Using Temporary Security Credentials.

Constraints:
Length: 2 - 96
Pattern: [\w+=,.@:-]*

Returns:
A unique identifier that is generated by a third party for each of their customers. For each role that the third party can assume, they should instruct their customers to create a role with the external ID that was generated by the third party. Each time the third party assumes the role, they must pass the customer's correct external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see About the External ID in Using Temporary Security Credentials.

setExternalId

public void setExternalId(java.lang.String externalId)
A unique identifier that is generated by a third party for each of their customers. For each role that the third party can assume, they should instruct their customers to create a role with the external ID that was generated by the third party. Each time the third party assumes the role, they must pass the customer's correct external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see About the External ID in Using Temporary Security Credentials.

Constraints:
Length: 2 - 96
Pattern: [\w+=,.@:-]*

Parameters:
externalId - A unique identifier that is generated by a third party for each of their customers. For each role that the third party can assume, they should instruct their customers to create a role with the external ID that was generated by the third party. Each time the third party assumes the role, they must pass the customer's correct external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see About the External ID in Using Temporary Security Credentials.

withExternalId

public AssumeRoleRequest withExternalId(java.lang.String externalId)
A unique identifier that is generated by a third party for each of their customers. For each role that the third party can assume, they should instruct their customers to create a role with the external ID that was generated by the third party. Each time the third party assumes the role, they must pass the customer's correct external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see About the External ID in Using Temporary Security Credentials.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 2 - 96
Pattern: [\w+=,.@:-]*

Parameters:
externalId - A unique identifier that is generated by a third party for each of their customers. For each role that the third party can assume, they should instruct their customers to create a role with the external ID that was generated by the third party. Each time the third party assumes the role, they must pass the customer's correct external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see About the External ID in Using Temporary Security Credentials.
Returns:
A reference to this updated object so that method calls can be chained together.

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.