Skip to content

disassociate_resource

disassociate_resource(
    application: ApplicationSpecifier,
    resource_type: ResourceType,
    resource: ResourceSpecifier,
    *,
    config_overrides: Optional[ServiceCatalogAppRegistryClientConfig] = None,
) -> DisassociateResourceResponse

Disassociates a resource from application. Both the resource and the application can be specified either by ID or name.

Minimum permissions

You must have the following permissions to remove a resource that's been associated with an application using the APPLY_APPLICATION_TAG option for AssociateResource.

  • tag:GetResources

  • tag:UntagResources

You must also have the following permissions if you don't use the AWSServiceCatalogAppRegistryFullAccess policy. For more information, see AWSServiceCatalogAppRegistryFullAccess in the AppRegistry Administrator Guide.

  • resource-groups:DisassociateResource

  • cloudformation:UpdateStack

  • cloudformation:DescribeStacks

In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource. For more information, see UntagResources in the Resource Groups Tagging API Reference.

Parameters:

Raises:

Source code in docs_src/capo_service_catalog_appregistry/_services/service_catalog_app_registry.py
def disassociate_resource(
    self,
    application: "capo_service_catalog_appregistry.types.application_specifier.ApplicationSpecifier",
    resource_type: "capo_service_catalog_appregistry.types.resource_type.ResourceType",
    resource: "capo_service_catalog_appregistry.types.resource_specifier.ResourceSpecifier",
    *,
    config_overrides: Optional[ServiceCatalogAppRegistryClientConfig] = None,
) -> "capo_service_catalog_appregistry.types.disassociate_resource_response.DisassociateResourceResponse":
    """<p> Disassociates a resource from application. Both the resource and the application can be specified either by ID or name. </p> <p> <b>Minimum permissions</b> </p> <p> You must have the following permissions to remove a resource that's been associated with an application using the <code>APPLY_APPLICATION_TAG</code> option for <a href="https://docs.aws.amazon.com/servicecatalog/latest/dg/API_app-registry_AssociateResource.html">AssociateResource</a>. </p> <ul> <li> <p> <code>tag:GetResources</code> </p> </li> <li> <p> <code>tag:UntagResources</code> </p> </li> </ul> <p> You must also have the following permissions if you don't use the <code>AWSServiceCatalogAppRegistryFullAccess</code> policy. For more information, see <a href="https://docs.aws.amazon.com/servicecatalog/latest/arguide/full.html">AWSServiceCatalogAppRegistryFullAccess</a> in the AppRegistry Administrator Guide. </p> <ul> <li> <p> <code>resource-groups:DisassociateResource</code> </p> </li> <li> <p> <code>cloudformation:UpdateStack</code> </p> </li> <li> <p> <code>cloudformation:DescribeStacks</code> </p> </li> </ul> <note> <p> In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource. For more information, see <a href="https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_UntTagResources.html">UntagResources</a> in the <i>Resource Groups Tagging API Reference</i>. </p> </note>

    Args:
        application: <p>The name or ID of the application.</p>
        resource_type: <p>The type of the resource that is being disassociated.</p>
        resource: <p>The name or ID of the resource.</p>

    Raises:
        capo_service_catalog_appregistry.errors.internal_server_exception.InternalServerException: <p>The service is experiencing internal problems.</p>
        capo_service_catalog_appregistry.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_service_catalog_appregistry.errors.throttling_exception.ThrottlingException: <p> The maximum number of API requests has been exceeded. </p>
        capo_service_catalog_appregistry.errors.validation_exception.ValidationException: <p>The request has invalid or missing parameters.</p>
        capo_service_catalog_appregistry.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_service_catalog_appregistry.types.disassociate_resource_request.DisassociateResourceRequest]",
    ) -> OperationResponse[
        "capo_service_catalog_appregistry.types.disassociate_resource_response.DisassociateResourceResponse"
    ]:
        import capo_service_catalog_appregistry._operations.aws242_app_registry.disassociate_resource

        output, http_response = (
            capo_service_catalog_appregistry._operations.aws242_app_registry.disassociate_resource.disassociate_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateResource")
    )
    input_: capo_service_catalog_appregistry.types.disassociate_resource_request.DisassociateResourceRequest = {
        "application": application,
        "resource_type": resource_type,
        "resource": resource,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output