Skip to content

tag_resource async

tag_resource(
    resource_arn: Arn,
    tags: Tags,
    *,
    config_overrides: Optional[AsyncGameLiftStreamsClientConfig] = None,
) -> TagResourceResponse

Assigns one or more tags to a Amazon GameLift Streams resource. Use tags to organize Amazon Web Services resources for a range of purposes. You can assign tags to the following Amazon GameLift Streams resource types:

  • Application

  • StreamGroup

Learn more

Tagging Amazon Web Services Resources in the Amazon Web Services General Reference

Amazon Web Services Tagging Strategies

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the Amazon GameLift Streams resource that you want to apply tags to.

  • tags (Tags) –

    A list of tags, in the form of key-value pairs, to assign to the specified Amazon GameLift Streams resource.

Raises:

  • AccessDeniedException –

    You don't have the required permissions to access this Amazon GameLift Streams resource. Correct the permissions before you try again.

  • InternalServerException –

    The service encountered an internal error and is unable to complete the request.

  • ThrottlingException –

    The request was denied due to request throttling. Retry the request after the suggested wait time.

  • ValidationException –

    One or more parameter values in the request fail to satisfy the specified constraints. Correct the invalid parameter values before retrying the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_gameliftstreams/_services/async_game_lift_streams.py
async def tag_resource(
    self,
    resource_arn: "capo_gameliftstreams.types.arn.Arn",
    tags: "capo_gameliftstreams.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncGameLiftStreamsClientConfig] = None,
) -> "capo_gameliftstreams.types.tag_resource_response.TagResourceResponse":
    """<p>Assigns one or more tags to a Amazon GameLift Streams resource. Use tags to organize Amazon Web Services resources for a range of purposes. You can assign tags to the following Amazon GameLift Streams resource types:</p> <ul> <li> <p>Application</p> </li> <li> <p>StreamGroup</p> </li> </ul> <p> <b>Learn more</b> </p> <p> <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> <p> <a href="http://aws.amazon.com/answers/account-management/aws-tagging-strategies/"> Amazon Web Services Tagging Strategies</a> </p>

    Args:
        resource_arn: <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> of the Amazon GameLift Streams resource that you want to apply tags to.</p>
        tags: <p>A list of tags, in the form of key-value pairs, to assign to the specified Amazon GameLift Streams resource.</p>

    Raises:
        capo_gameliftstreams.errors.access_denied_exception.AccessDeniedException: <p>You don't have the required permissions to access this Amazon GameLift Streams resource. Correct the permissions before you try again.</p>
        capo_gameliftstreams.errors.internal_server_exception.InternalServerException: <p>The service encountered an internal error and is unable to complete the request.</p>
        capo_gameliftstreams.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request after the suggested wait time.</p>
        capo_gameliftstreams.errors.validation_exception.ValidationException: <p>One or more parameter values in the request fail to satisfy the specified constraints. Correct the invalid parameter values before retrying the request.</p>
        capo_gameliftstreams.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_gameliftstreams.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_gameliftstreams.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_gameliftstreams._operations.game_lift_streams.tag_resource

        (
            output,
            http_response,
        ) = await capo_gameliftstreams._operations.game_lift_streams.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_gameliftstreams.types.tag_resource_request.TagResourceRequest = {
        "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