Package overit.geocall.aws.sts.task
Class BTAssumeRole
- All Implemented Interfaces:
Serializable,Tool
Usage: roleArn - The Amazon Resource Name (ARN) of the role to assume (for
example, arn:aws:iam::000008047983:role/s3role).
Task that listen to
AssumeRoleEvent and assume a role in AWS. It
returns the temporary AWS credentials needed to perform the operations in the
AWS service you need.- Since:
- 11.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AWSAssumeRoleResponseassumeGivenRole(software.amazon.awssdk.services.sts.StsClient stsClient, String roleArn) protected voidbody(AssumeRoleEvent event, PoolKit pk) Implements this method to write the specific task logic to handle the input parameter.protected software.amazon.awssdk.services.sts.model.AssumeRoleRequestcreateRoleRequest(String roleArn) protected StringReturns the session name to be used when calling the STS service.protected final software.amazon.awssdk.services.sts.StsClientgetStsClient(String region) Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTAssumeRole
public BTAssumeRole()
-
-
Method Details
-
body
Description copied from class:BusinessTaskImplements this method to write the specific task logic to handle the input parameter.- Specified by:
bodyin classBusinessTask<AssumeRoleEvent>- Parameters:
event- the object upon which the task will works onpk- the poolkit containing the reference to the database connection that can be used- Throws:
DAException- in case of database errorDAValidateException- in case of database validation error
-
getStsClient
-
createRoleSessionName
Returns the session name to be used when calling the STS service. Subsequent cross-account API requests that use the temporary security credentials will expose the role session name to the external account in their CloudTrail logs as provided inAssumeRoleRequest.roleSessionName(). The session name is built asSERVICE_IDENTIFIER-user@company.- Returns:
- the session name to be used
-
createRoleRequest
protected software.amazon.awssdk.services.sts.model.AssumeRoleRequest createRoleRequest(String roleArn) -
assumeGivenRole
protected AWSAssumeRoleResponse assumeGivenRole(software.amazon.awssdk.services.sts.StsClient stsClient, String roleArn)
-