disassociateResource method

Future<DisassociateResourceResponse> disassociateResource({
  1. required String application,
  2. required String resource,
  3. required ResourceType resourceType,
})

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

May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter application : The name or ID of the application.

Parameter resource : The name or ID of the resource.

Parameter resourceType : The type of the resource that is being disassociated.

Implementation

Future<DisassociateResourceResponse> disassociateResource({
  required String application,
  required String resource,
  required ResourceType resourceType,
}) async {
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/applications/${Uri.encodeComponent(application)}/resources/${Uri.encodeComponent(resourceType.value)}/${Uri.encodeComponent(resource)}',
    exceptionFnMap: _exceptionFns,
  );
  return DisassociateResourceResponse.fromJson(response);
}