Skip to content

tag_resource async

tag_resource(
    resource_arn: SimSpaceWeaverArn,
    tags: TagMap,
    *,
    config_overrides: Optional[AsyncSimSpaceWeaverClientConfig] = None,
) -> TagResourceOutput

Adds tags to a SimSpace Weaver resource. For more information about tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.

Parameters:

  • resource_arn (SimSpaceWeaverArn) –

    The Amazon Resource Name (ARN) of the resource that you want to add tags to. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

  • tags (TagMap) –

    A list of tags to apply to the resource.

Raises:

Source code in docs_src/capo_simspaceweaver/_services/async_sim_space_weaver.py
async def tag_resource(
    self,
    resource_arn: "capo_simspaceweaver.types.sim_space_weaver_arn.SimSpaceWeaverArn",
    tags: "capo_simspaceweaver.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncSimSpaceWeaverClientConfig] = None,
) -> "capo_simspaceweaver.types.tag_resource_output.TagResourceOutput":
    """<p>Adds tags to a SimSpace Weaver resource. For more information about tags, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to add tags to. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
        tags: <p>A list of tags to apply to the resource.</p>

    Raises:
        capo_simspaceweaver.errors.resource_not_found_exception.ResourceNotFoundException: <p/>
        capo_simspaceweaver.errors.too_many_tags_exception.TooManyTagsException: <p/>
        capo_simspaceweaver.errors.validation_exception.ValidationException: <p/>
        capo_simspaceweaver.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_simspaceweaver.types.tag_resource_input.TagResourceInput]",
    ) -> AsyncOperationResponse[
        "capo_simspaceweaver.types.tag_resource_output.TagResourceOutput"
    ]:
        import capo_simspaceweaver._operations.sim_space_weaver.tag_resource

        (
            output,
            http_response,
        ) = await capo_simspaceweaver._operations.sim_space_weaver.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_simspaceweaver.types.tag_resource_input.TagResourceInput = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output