Removes tags from a resource.
Parameters:
-
resource_arn
(ResourceArn)
–
The Amazon Resource Name (ARN) of the resource.
-
tag_keys
(TagKeyList)
–
The keys of the tags to remove from the resource.
Raises:
Examples:
Remove a tag from a governance environment
Removes the team tag from the governance environment when ownership of the environment changes.
>>> await client.untag_resource(resource_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', tag_keys=['team'])
Source code in docs_src/capo_assurance/_services/async_assurance.py
| async def untag_resource(
self,
resource_arn: "capo_assurance.types.resource_arn.ResourceArn",
tag_keys: "capo_assurance.types.tag_key_list.TagKeyList",
*,
config_overrides: Optional[AsyncAssuranceClientConfig] = None,
) -> "capo_assurance.types.untag_resource_output.UntagResourceOutput":
"""<p>Removes tags from a resource.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource.</p>
tag_keys: <p>The keys of the tags to remove from the resource.</p>
Raises:
capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Remove a tag from a governance environment
Removes the team tag from the governance environment when ownership of the environment changes.
>>> await client.untag_resource(resource_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', tag_keys=['team'])
"""
async def _handler(
req: "AsyncOperationRequest[capo_assurance.types.untag_resource_input.UntagResourceInput]",
) -> AsyncOperationResponse[
"capo_assurance.types.untag_resource_output.UntagResourceOutput"
]:
import capo_assurance._operations.assurance.untag_resource
(
output,
http_response,
) = await capo_assurance._operations.assurance.untag_resource.async_untag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UntagResource")
)
input_: capo_assurance.types.untag_resource_input.UntagResourceInput = {
"resource_arn": resource_arn,
"tag_keys": tag_keys,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|