Skip to content

tag_resource

tag_resource(
    resource_arn: EnvironmentArn,
    tags: TagList,
    *,
    config_overrides: Optional[Cloud9ClientConfig] = None,
) -> TagResourceResponse

Adds tags to an Cloud9 development environment.

Cloud9 is no longer available to new customers. Existing customers of Cloud9 can continue to use the service as normal. Learn more"

Tags that you add to an Cloud9 environment by using this method will NOT be automatically propagated to underlying resources.

Parameters:

  • resource_arn (EnvironmentArn) –

    The Amazon Resource Name (ARN) of the Cloud9 development environment to add tags to.

  • tags (TagList) –

    The list of tags to add to the given Cloud9 development environment.

Raises:

Source code in docs_src/capo_cloud9/_services/cloud9.py
def tag_resource(
    self,
    resource_arn: "capo_cloud9.types.environment_arn.EnvironmentArn",
    tags: "capo_cloud9.types.tag_list.TagList",
    *,
    config_overrides: Optional[Cloud9ClientConfig] = None,
) -> "capo_cloud9.types.tag_resource_response.TagResourceResponse":
    """<p>Adds tags to an Cloud9 development environment.</p> <important> <p>Cloud9 is no longer available to new customers. Existing customers of Cloud9 can continue to use the service as normal. <a href="http://aws.amazon.com/blogs/devops/how-to-migrate-from-aws-cloud9-to-aws-ide-toolkits-or-aws-cloudshell/">Learn more"</a> </p> </important> <important> <p>Tags that you add to an Cloud9 environment by using this method will NOT be automatically propagated to underlying resources.</p> </important>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the Cloud9 development environment to add tags to.</p>
        tags: <p>The list of tags to add to the given Cloud9 development environment.</p>

    Raises:
        capo_cloud9.errors.bad_request_exception.BadRequestException: <p>The target request is invalid.</p>
        capo_cloud9.errors.concurrent_access_exception.ConcurrentAccessException: <p>A concurrent access issue occurred.</p>
        capo_cloud9.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error occurred.</p>
        capo_cloud9.errors.not_found_exception.NotFoundException: <p>The target resource cannot be found.</p>
        capo_cloud9.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_cloud9._operations.aws_cloud9_workspace_management_service.tag_resource.tag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cloud9.types.tag_resource_request.TagResourceRequest",
    ) -> dict[str, Any]:
        import capo_cloud9.types.tag_resource_request

        return capo_cloud9.types.tag_resource_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("TagResource", redact_input=_redact_input),
    )
    input_: capo_cloud9.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