def get_assumed_creds(sts, arn):
    """Retrieves the AWS assume role credentials.

    Args:
        sts: boto3 sts object
        arn: Arn of the role we want to assume

    Returns:
        AWS credentials
    """
    if arn:
        credentials = sts.assume_role(
            RoleArn=arn,
            RoleSessionName="AssumeRoleSession1"
        )["Credentials"]

        result = {
            "aws_access_key_id": credentials['AccessKeyId'],
            "aws_secret_access_key": credentials['SecretAccessKey'],
            "aws_session_token": credentials['SessionToken']
        }
    else:
        result = {}

    return result