Test if resource_name is defined first