Removes the tags of a given resource. Tags are metadata which can be used to manage a resource. To tag a resource, the caller account must be the same as the resource’s OwnerAccountId. Tagging resources in other accounts is not supported.
Amazon Web Services Migration Hub Refactor Spaces does not propagate tags to orchestrated resources, such as an environment’s transit gateway.
Parameters:
-
resource_arn
(String)
–
The Amazon Resource Name (ARN) of the resource.
-
tags
(TagMap)
–
The new or modified tags for the resource.
Raises:
Source code in docs_src/capo_migration_hub_refactor_spaces/_services/migration_hub_refactor_spaces.py
| def tag_resource(
self,
resource_arn: "capo_migration_hub_refactor_spaces.types.string.String",
tags: "capo_migration_hub_refactor_spaces.types.tag_map.TagMap",
*,
config_overrides: Optional[MigrationHubRefactorSpacesClientConfig] = None,
) -> "capo_migration_hub_refactor_spaces.types.tag_resource_response.TagResourceResponse":
"""<p>Removes the tags of a given resource. Tags are metadata which can be used to manage a resource. To tag a resource, the caller account must be the same as the resource’s <code>OwnerAccountId</code>. Tagging resources in other accounts is not supported.</p> <note> <p>Amazon Web Services Migration Hub Refactor Spaces does not propagate tags to orchestrated resources, such as an environment’s transit gateway.</p> </note>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource.</p>
tags: <p>The new or modified tags for the resource.</p>
Raises:
capo_migration_hub_refactor_spaces.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing the request.</p>
capo_migration_hub_refactor_spaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist. </p>
capo_migration_hub_refactor_spaces.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an Amazon Web Service. </p>
capo_migration_hub_refactor_spaces.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_migration_hub_refactor_spaces.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_migration_hub_refactor_spaces.types.tag_resource_response.TagResourceResponse"
]:
import capo_migration_hub_refactor_spaces._operations.refactor_spaces.tag_resource
output, http_response = (
capo_migration_hub_refactor_spaces._operations.refactor_spaces.tag_resource.tag_resource(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_migration_hub_refactor_spaces.types.tag_resource_request.TagResourceRequest",
) -> dict[str, Any]:
import capo_migration_hub_refactor_spaces.types.tag_resource_request
return capo_migration_hub_refactor_spaces.types.tag_resource_request.redact_sensitive(
input_
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("TagResource", redact_input=_redact_input),
)
input_: capo_migration_hub_refactor_spaces.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn,
"tags": tags,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|