def METHOD_NAME(service_name, aws_details):
    auth_data = {}
    auth_data['region_name'] = aws_details['region']
    if 'access_key' in aws_details:
        auth_data['aws_access_key_id'] = aws_details['access_key']
        auth_data['aws_secret_access_key'] = aws_details['secret_key']
    elif 'assume_role' in aws_details:
        temp_cred = generate_temp_credentials(aws_details['assume_role']['role_arn'], auth_data['region_name'])
        auth_data['aws_access_key_id'] = temp_cred['AccessKeyId']
        auth_data['aws_secret_access_key'] = temp_cred['SecretAccessKey']
        auth_data['aws_session_token'] = temp_cred['SessionToken']
    return boto3.resource(service_name, **auth_data)