Skip to content

update_lookup_table

update_lookup_table(
    lookup_table_arn: Arn,
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
    description: Optional[LookupTableDescription] = None,
    table_body: Optional[TableBody] = None,
    query_id: Optional[QueryId] = None,
    kms_key_id: Optional[KmsKeyId] = None,
) -> UpdateLookupTableResponse

Updates an existing lookup table by replacing all of its content with new CSV data or CloudWatch Logs query results. After the update completes, queries that use this table use the new data.

This is a full replacement operation. All existing content is replaced. You must specify either tableBody or queryId, but not both.

Parameters:

  • lookup_table_arn (Arn) –

    The ARN of the lookup table to update.

  • description (Optional[LookupTableDescription], default: None ) –

    An updated description of the lookup table.

  • table_body (Optional[TableBody], default: None ) –

    The new CSV content to replace the existing data. The first row must be a header row with column names. The content must use UTF-8 encoding and not exceed 10 MB.

    You must specify either tableBody or queryId, but not both.

  • query_id (Optional[QueryId], default: None ) –

    The ID of a completed or cancelled CloudWatch Logs query whose results replace the lookup table content. A cancelled query replaces the content with the partial results that were available when the query was stopped.

    You must specify either tableBody or queryId, but not both.

  • kms_key_id (Optional[KmsKeyId], default: None ) –

    The ARN of the KMS key to use to encrypt the lookup table data. You can use this parameter to add, update, or remove the KMS key. To remove the KMS key and use an Amazon Web Services-owned key instead, specify an empty string.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/cloud_watch_logs.py
def update_lookup_table(
    self,
    lookup_table_arn: "capo_cloudwatch_logs.types.arn.Arn",
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
    description: Optional[
        "capo_cloudwatch_logs.types.lookup_table_description.LookupTableDescription"
    ] = None,
    table_body: Optional["capo_cloudwatch_logs.types.table_body.TableBody"] = None,
    query_id: Optional["capo_cloudwatch_logs.types.query_id.QueryId"] = None,
    kms_key_id: Optional["capo_cloudwatch_logs.types.kms_key_id.KmsKeyId"] = None,
) -> "capo_cloudwatch_logs.types.update_lookup_table_response.UpdateLookupTableResponse":
    """<p>Updates an existing lookup table by replacing all of its content with new CSV data or CloudWatch Logs query results. After the update completes, queries that use this table use the new data.</p> <p>This is a full replacement operation. All existing content is replaced. You must specify either <code>tableBody</code> or <code>queryId</code>, but not both.</p>

    Args:
        lookup_table_arn: <p>The ARN of the lookup table to update.</p>
        description: <p>An updated description of the lookup table.</p>
        table_body: <p>The new CSV content to replace the existing data. The first row must be a header row with column names. The content must use UTF-8 encoding and not exceed 10 MB.</p> <p>You must specify either <code>tableBody</code> or <code>queryId</code>, but not both.</p>
        query_id: <p>The ID of a completed or cancelled CloudWatch Logs query whose results replace the lookup table content. A cancelled query replaces the content with the partial results that were available when the query was stopped.</p> <p>You must specify either <code>tableBody</code> or <code>queryId</code>, but not both.</p>
        kms_key_id: <p>The ARN of the KMS key to use to encrypt the lookup table data. You can use this parameter to add, update, or remove the KMS key. To remove the KMS key and use an Amazon Web Services-owned key instead, specify an empty string.</p>

    Raises:
        capo_cloudwatch_logs.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
        capo_cloudwatch_logs.errors.validation_exception.ValidationException: <p>One of the parameters for the request is not valid.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatch_logs.types.update_lookup_table_request.UpdateLookupTableRequest]",
    ) -> OperationResponse[
        "capo_cloudwatch_logs.types.update_lookup_table_response.UpdateLookupTableResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.update_lookup_table

        output, http_response = (
            capo_cloudwatch_logs._operations.logs_20140328.update_lookup_table.update_lookup_table(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateLookupTable")
    )
    input_: capo_cloudwatch_logs.types.update_lookup_table_request.UpdateLookupTableRequest = {
        "lookup_table_arn": lookup_table_arn
    }
    if description is not None:
        input_["description"] = description
    if table_body is not None:
        input_["table_body"] = table_body
    if query_id is not None:
        input_["query_id"] = query_id
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output