{"id":"f71db44dd00dd5ce","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}\n[Consider using a boto3.client('{service_name}') instead of a resource for '{service_name}']","messagePattern":"The '(.+?)' resource does not exist\\.\nThe available resources are:\n   - (.+?)\n\\[Consider 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/c7b4afac237b976d48395d7523eaf7cec3a450b3/boto3/session.py#L415-L451","documentation":"Raised as boto3.exceptions.ResourceNotExistsError by Session.resource() when the loader cannot find a resource model for the requested service_name (UnknownServiceError from load_service_model). The resource API only covers a subset of AWS services that have hand-authored resource models in boto3, so requesting a resource for an unsupported service yields this error, which lists the available resources and, if a low-level client exists, suggests using boto3.client() instead.","triggerScenarios":"Calling boto3.resource('service') (or session.resource('service')) for a service without a bundled resource model — e.g. a newer/less-common service, a typo, or a service name using the wrong casing. Also triggered by passing an api_version that resolves to no resource data.","commonSituations":"Assuming every AWS service has a resource interface; typos or wrong service-name casing (e.g. 'S3' vs 's3'); using a service added after your pinned boto3 version; migrating from client to resource API for a service that has no resource model.","solutions":["Use the low-level client instead: boto3.client('service') — it supports all services.","Check the list in the error message (or boto3.session.Session().get_available_resources()) and correct the service name/casing.","Upgrade boto3 to pick up newer resource models.","If the service name is correct but still missing, it has no resource model — switch your code to the client API for that service."],"exampleFix":"// before\nresource = boto3.resource('servicewithnoresource')  # ResourceNotExistsError\n\n// after\nclient = boto3.client('servicewithnoresource')  # low-level client always works","handlingStrategy":"fallback","validationCode":"available_resources = boto3.session.Session().get_available_resources()\nif service_name not in available_resources:\n    obj = boto3.client(service_name)  # fallback to low-level client\nelse:\n    obj = boto3.resource(service_name)","typeGuard":"def has_resource_model(service_name: str) -> bool:\n    return service_name in boto3.session.Session().get_available_resources()","tryCatchPattern":"from boto3.exceptions import ResourceNotExistsError\ntry:\n    obj = boto3.resource(service_name)\nexcept ResourceNotExistsError:\n    obj = boto3.client(service_name)  # every AWS service has a client","preventionTips":["Check get_available_resources() before assuming a resource interface exists.","Default to boto3.client() for services you are unsure about.","Keep boto3 current so newer services gain resource models over time."],"tags":["boto3","session","resource-api","api-misuse"],"analyzedSha":"c7b4afac237b976d48395d7523eaf7cec3a450b3","analyzedAt":"2026-08-04T20:35:51.598Z","schemaVersion":2}