Skip to content

tag_resource

tag_resource(
    resource_arn: Arn,
    tags: ResourceTagList,
    *,
    config_overrides: Optional[SWFClientConfig] = None,
) -> None

Add a tag to a Amazon SWF domain.

Amazon SWF supports a maximum of 50 tags per resource.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) for the Amazon SWF domain.

  • tags (ResourceTagList) –

    The list of tags to add to a domain.

    Tags may only contain unicode letters, digits, whitespace, or these symbols: _ . : / = + - @.

Raises:

  • LimitExceededFault –

    Returned by any operation if a system imposed limitation has been reached. To address this fault you should either clean up unused resources or increase the limit by contacting AWS.

  • OperationNotPermittedFault –

    Returned when the caller doesn't have sufficient permissions to invoke the action.

  • TooManyTagsFault –

    You've exceeded the number of tags allowed for a domain.

  • UnknownResourceFault –

    Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.

  • UnknownServiceError –

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

Source code in docs_src/capo_swf/_services/swf.py
def tag_resource(
    self,
    resource_arn: "capo_swf.types.arn.Arn",
    tags: "capo_swf.types.resource_tag_list.ResourceTagList",
    *,
    config_overrides: Optional[SWFClientConfig] = None,
) -> None:
    """<p>Add a tag to a Amazon SWF domain.</p> <note> <p>Amazon SWF supports a maximum of 50 tags per resource.</p> </note>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) for the Amazon SWF domain.</p>
        tags: <p>The list of tags to add to a domain. </p> <p>Tags may only contain unicode letters, digits, whitespace, or these symbols: <code>_ . : / = + - @</code>.</p>

    Raises:
        capo_swf.errors.limit_exceeded_fault.LimitExceededFault: <p>Returned by any operation if a system imposed limitation has been reached. To address this fault you should either clean up unused resources or increase the limit by contacting AWS.</p>
        capo_swf.errors.operation_not_permitted_fault.OperationNotPermittedFault: <p>Returned when the caller doesn't have sufficient permissions to invoke the action.</p>
        capo_swf.errors.too_many_tags_fault.TooManyTagsFault: <p>You've exceeded the number of tags allowed for a domain.</p>
        capo_swf.errors.unknown_resource_fault.UnknownResourceFault: <p>Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.</p>
        capo_swf.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_swf.types.tag_resource_input.TagResourceInput]",
    ) -> OperationResponse[None]:
        import capo_swf._operations.simple_workflow_service.tag_resource

        output, http_response = (
            capo_swf._operations.simple_workflow_service.tag_resource.tag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_swf.types.tag_resource_input.TagResourceInput = {
        "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