{"record":{"id":"8a302530a6bdc112","repo":"boto/boto3","slug":"the-service-name-resource-does-not-exist-the","errorCode":null,"errorMessage":"The '{service_name}' resource does not exist.\nThe available resources are:\n   - {available_services}\nConsider using a boto3.client('{service_name}') instead of a resource for '{service_name}'","messagePattern":"The '(.+?)' resource does not exist\\.\nThe available resources are:\n   - (.+?)\nConsider using a boto3\\.client\\('(.+?)'\\) instead of a resource for '(.+?)'","errorType":"exception","errorClass":"ResourceNotExistsError","httpStatus":null,"severity":"error","filePath":"boto3/session.py","lineNumber":433,"sourceCode":"            a region_name value passed explicitly to the method.  If\n            user_agent_extra is specified in the client config, it overrides\n            the default user_agent_extra provided by the resource API. See\n            `botocore config documentation\n            <https://docs.aws.amazon.com/botocore/latest/reference/config.html>`_\n            for more details.\n\n        :return: Subclass of :py:class:`~boto3.resources.base.ServiceResource`\n        \"\"\"\n        try:\n            resource_model = self._loader.load_service_model(\n                service_name, 'resources-1', api_version\n            )\n        except UnknownServiceError:\n            available = self.get_available_resources()\n            has_low_level_client = (\n                service_name in self.get_available_services()\n            )\n            raise ResourceNotExistsError(\n                service_name, available, has_low_level_client\n            )\n        except DataNotFoundError:\n            # This is because we've provided an invalid API version.\n            available_api_versions = self._loader.list_api_versions(\n                service_name, 'resources-1'\n            )\n            raise UnknownAPIVersionError(\n                service_name, api_version, ', '.join(available_api_versions)\n            )\n\n        if api_version is None:\n            # Even though botocore's load_service_model() can handle\n            # using the latest api_version if not provided, we need\n            # to track this api_version in boto3 in order to ensure\n            # we're pairing a resource model with a client model\n            # of the same API version.  It's possible for the latest\n            # API version of a resource model in boto3 to not be","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/boto/boto3/blob/6e10b029c1326a437932a8b24f38af69fd986e15/boto3/session.py#L415-L451","documentation":"`ResourceNotExistsError` is raised when `Session.resource(service_name)` cannot find a high-level resource model for the requested service in the bundled `resources-1` data — i.e. boto3 ships a low-level client for the service but no resource layer (or the service name is unknown entirely). The message lists available resources and notes whether a client exists, steering you toward `boto3.client(...)`. Resources are only generated for a subset of AWS services.","triggerScenarios":"Calling `boto3.resource('cloudfront')`, `boto3.resource('route53')`, or any other service for which no resource model exists; misspelling a service name (`boto3.resource('s3bucket')`); using `Session().resource(name)` on a name that has a client but no resource.","commonSituations":"Assuming every AWS service has a resource interface; copy-pasting a service name from the client docs into a `resource()` call; a typo in a service-name constant; an old boto3 that predates a newer service's resource model.","solutions":["Switch to the low-level client for that service: `client = boto3.client('cloudfront')`.","Check the catalog: `boto3.session.Session().get_available_resources()` and use only those names with `resource()`.","Upgrade boto3 — a resource model may have been added since your installed version.","Correct the service-name spelling against `get_available_services()`."],"exampleFix":"# before\nboto3.resource('cloudfront')  # ResourceNotExistsError\n\n# after\nboto3.client('cloudfront')\n# verify which services have a resource layer\nimport boto3\nprint(boto3.session.Session().get_available_resources())","handlingStrategy":"validation","validationCode":"def get_handle(session, service, use_resource=True):\n    if use_resource and service in session.get_available_resources():\n        return session.resource(service)\n    return session.client(service)\n\n# usage: get_handle(boto3.session.Session(), 'cloudfront')  # -> client","typeGuard":"def has_resource(session, service) -> bool:\n    return service in session.get_available_resources()","tryCatchPattern":"from boto3.exceptions import ResourceNotExistsError\ntry:\n    handle = boto3.resource(service)\nexcept ResourceNotExistsError:\n    handle = boto3.client(service)","preventionTips":["Check get_available_resources() before assuming a resource layer exists.","Default to boto3.client() for services without resources.","Validate service-name strings against get_available_services()."],"tags":["session","resource","service-not-found","api-surface"],"backgroundTag":null,"analyzedSha":"6e10b029c1326a437932a8b24f38af69fd986e15","analyzedAt":"2026-08-11T20:52:47.213Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}