Skip to content

put_intelligence_configuration async

put_intelligence_configuration(
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    kms_key_arn: Optional[IntelligenceKmsKeyArn] = None,
    remove_kms_key: Optional[bool] = None,
    client_token: Optional[ClientToken] = None,
) -> PutIntelligenceConfigurationOutput

Creates or updates the intelligence configuration for the calling account. Account is identified via FAS (caller identity).

Parameters:

  • kms_key_arn (Optional[IntelligenceKmsKeyArn], default: None ) –

    Optional KMS key ARN to configure customer-managed encryption for anomaly data.

  • remove_kms_key (Optional[bool], default: None ) –

    Set to true to disassociate the configured KMS key. Mutually exclusive with kmsKeyArn; the service returns ValidationException if both are provided.

  • client_token (Optional[ClientToken], default: None ) –

    Idempotency token for safe retries. Repeating a request with the same token applies the update at most once instead of reprocessing it.

Raises:

Examples:

Configure a customer-managed KMS key The following example sets the customer-managed KMS key used to encrypt the account's intelligence data. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> await client.put_intelligence_configuration(kms_key_arn='arn:aws:kms:us-east-1:123456789012:key/1a2b3c4d-5e6f-4a3b-8c9d-0e1f2a3b4c5d', client_token='b3f8c7d6-5b4a-4c3d-9e2f-1a0b2c3d4e5f')
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
async def put_intelligence_configuration(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    kms_key_arn: Optional[
        "capo_cloudwatchomni.types.intelligence_kms_key_arn.IntelligenceKmsKeyArn"
    ] = None,
    remove_kms_key: Optional[bool] = None,
    client_token: Optional[
        "capo_cloudwatchomni.types.client_token.ClientToken"
    ] = None,
) -> "capo_cloudwatchomni.types.put_intelligence_configuration_output.PutIntelligenceConfigurationOutput":
    """Creates or updates the intelligence configuration for the calling account. Account is identified via FAS (caller identity).

    Args:
        kms_key_arn: Optional KMS key ARN to configure customer-managed encryption for anomaly data.
        remove_kms_key: Set to true to disassociate the configured KMS key. Mutually exclusive with kmsKeyArn; the service returns ValidationException if both are provided.
        client_token: Idempotency token for safe retries. Repeating a request with the same token applies the update at most once instead of reprocessing it.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Configure a customer-managed KMS key
        The following example sets the customer-managed KMS key used to encrypt the account's intelligence data. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> await client.put_intelligence_configuration(kms_key_arn='arn:aws:kms:us-east-1:123456789012:key/1a2b3c4d-5e6f-4a3b-8c9d-0e1f2a3b4c5d', client_token='b3f8c7d6-5b4a-4c3d-9e2f-1a0b2c3d4e5f')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatchomni.types.put_intelligence_configuration_input.PutIntelligenceConfigurationInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatchomni.types.put_intelligence_configuration_output.PutIntelligenceConfigurationOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.put_intelligence_configuration

        (
            output,
            http_response,
        ) = await capo_cloudwatchomni._operations.cloud_watch_omni_frontend.put_intelligence_configuration.async_put_intelligence_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutIntelligenceConfiguration")
    )
    input_: capo_cloudwatchomni.types.put_intelligence_configuration_input.PutIntelligenceConfigurationInput = {}
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn
    if remove_kms_key is not None:
        input_["remove_kms_key"] = remove_kms_key
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output