Class BTAssumeRole

java.lang.Object
overit.geocall.bl.BusinessTask<AssumeRoleEvent>
overit.geocall.aws.sts.task.BTAssumeRole
All Implemented Interfaces:
Serializable, Tool

@Event(AssumeRoleEvent.class) public class BTAssumeRole extends BusinessTask<AssumeRoleEvent>
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 Details

    • BTAssumeRole

      public BTAssumeRole()
  • Method Details

    • body

      protected void body(AssumeRoleEvent event, PoolKit pk) throws DAException, DAValidateException
      Description copied from class: BusinessTask
      Implements this method to write the specific task logic to handle the input parameter.
      Specified by:
      body in class BusinessTask<AssumeRoleEvent>
      Parameters:
      event - the object upon which the task will works on
      pk - the poolkit containing the reference to the database connection that can be used
      Throws:
      DAException - in case of database error
      DAValidateException - in case of database validation error
    • getStsClient

      protected final software.amazon.awssdk.services.sts.StsClient getStsClient(String region)
    • createRoleSessionName

      protected String 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 in AssumeRoleRequest.roleSessionName(). The session name is built as SERVICE_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)