Skip to content

tag_resource

tag_resource(
    resource_arn: str,
    tags: TagMap,
    *,
    config_overrides: Optional[SSMIncidentsClientConfig] = None,
) -> TagResourceResponse

Adds a tag to a response plan.

Parameters:

  • resource_arn (str) –

    The Amazon Resource Name (ARN) of the response plan you're adding the tags to.

  • tags (TagMap) –

    A list of tags to add to the response plan.

Raises:

Source code in docs_src/capo_ssm_incidents/_services/ssm_incidents.py
def tag_resource(
    self,
    resource_arn: str,
    tags: "capo_ssm_incidents.types.tag_map.TagMap",
    *,
    config_overrides: Optional[SSMIncidentsClientConfig] = None,
) -> "capo_ssm_incidents.types.tag_resource_response.TagResourceResponse":
    """<p>Adds a tag to a response plan.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the response plan you're adding the tags to.</p>
        tags: <p>A list of tags to add to the response plan.</p>

    Raises:
        capo_ssm_incidents.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
        capo_ssm_incidents.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource causes an inconsistent state.</p>
        capo_ssm_incidents.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_ssm_incidents.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which doesn't exist. </p>
        capo_ssm_incidents.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_ssm_incidents.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_ssm_incidents.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ssm_incidents.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm_incidents.types.tag_resource_request.TagResourceRequest]",
    ) -> OperationResponse[
        "capo_ssm_incidents.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_ssm_incidents._operations.ssm_incidents.tag_resource

        output, http_response = (
            capo_ssm_incidents._operations.ssm_incidents.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_ssm_incidents.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