def activity_region(activity_arn):
    """
    Return the region for an AWS activity_arn.

    'arn:aws:states:us-east-2:123456789012:stateMachine:hello_world' => 'us-east-2'
    """
    if activity_arn:
        parts = activity_arn.split(':')
        return parts[3] if len(parts) >= 4 else None
    else:
        return None