Skip to content

update_destination

update_destination(
    delivery_stream_name: DeliveryStreamName,
    current_delivery_stream_version_id: DeliveryStreamVersionId,
    destination_id: DestinationId,
    *,
    config_overrides: Optional[FirehoseClientConfig] = None,
    s3_destination_update: Optional[S3DestinationUpdate] = None,
    extended_s3_destination_update: Optional[ExtendedS3DestinationUpdate] = None,
    redshift_destination_update: Optional[RedshiftDestinationUpdate] = None,
    elasticsearch_destination_update: Optional[ElasticsearchDestinationUpdate] = None,
    amazonopensearchservice_destination_update: Optional[
        AmazonopensearchserviceDestinationUpdate
    ] = None,
    splunk_destination_update: Optional[SplunkDestinationUpdate] = None,
    http_endpoint_destination_update: Optional[HttpEndpointDestinationUpdate] = None,
    amazon_open_search_serverless_destination_update: Optional[
        AmazonOpenSearchServerlessDestinationUpdate
    ] = None,
    snowflake_destination_update: Optional[SnowflakeDestinationUpdate] = None,
    iceberg_destination_update: Optional[IcebergDestinationUpdate] = None,
) -> UpdateDestinationOutput

Updates the specified destination of the specified Firehose stream.

Use this operation to change the destination type (for example, to replace the Amazon S3 destination with Amazon Redshift) or change the parameters associated with a destination (for example, to change the bucket name of the Amazon S3 destination). The update might not occur immediately. The target Firehose stream remains active while the configurations are updated, so data writes to the Firehose stream can continue during this process. The updated configurations are usually effective within a few minutes.

Switching between Amazon OpenSearch Service and other services is not supported. For an Amazon OpenSearch Service destination, you can only update to another Amazon OpenSearch Service destination.

If the destination type is the same, Firehose merges the configuration parameters specified with the destination configuration that already exists on the delivery stream. If any of the parameters are not specified in the call, the existing values are retained. For example, in the Amazon S3 destination, if EncryptionConfiguration is not specified, then the existing EncryptionConfiguration is maintained on the destination.

If the destination type is not the same, for example, changing the destination from Amazon S3 to Amazon Redshift, Firehose does not merge any parameters. In this case, all parameters must be specified.

Firehose uses CurrentDeliveryStreamVersionId to avoid race conditions and conflicting merges. This is a required field, and the service updates the configuration only if the existing configuration has a version ID that matches. After the update is applied successfully, the version ID is updated, and can be retrieved using DescribeDeliveryStream. Use the new version ID to set CurrentDeliveryStreamVersionId in the next call.

Parameters:

Raises:

Source code in docs_src/capo_firehose/_services/firehose.py
def update_destination(
    self,
    delivery_stream_name: "capo_firehose.types.delivery_stream_name.DeliveryStreamName",
    current_delivery_stream_version_id: "capo_firehose.types.delivery_stream_version_id.DeliveryStreamVersionId",
    destination_id: "capo_firehose.types.destination_id.DestinationId",
    *,
    config_overrides: Optional[FirehoseClientConfig] = None,
    s3_destination_update: Optional[
        "capo_firehose.types.s3_destination_update.S3DestinationUpdate"
    ] = None,
    extended_s3_destination_update: Optional[
        "capo_firehose.types.extended_s3_destination_update.ExtendedS3DestinationUpdate"
    ] = None,
    redshift_destination_update: Optional[
        "capo_firehose.types.redshift_destination_update.RedshiftDestinationUpdate"
    ] = None,
    elasticsearch_destination_update: Optional[
        "capo_firehose.types.elasticsearch_destination_update.ElasticsearchDestinationUpdate"
    ] = None,
    amazonopensearchservice_destination_update: Optional[
        "capo_firehose.types.amazonopensearchservice_destination_update.AmazonopensearchserviceDestinationUpdate"
    ] = None,
    splunk_destination_update: Optional[
        "capo_firehose.types.splunk_destination_update.SplunkDestinationUpdate"
    ] = None,
    http_endpoint_destination_update: Optional[
        "capo_firehose.types.http_endpoint_destination_update.HttpEndpointDestinationUpdate"
    ] = None,
    amazon_open_search_serverless_destination_update: Optional[
        "capo_firehose.types.amazon_open_search_serverless_destination_update.AmazonOpenSearchServerlessDestinationUpdate"
    ] = None,
    snowflake_destination_update: Optional[
        "capo_firehose.types.snowflake_destination_update.SnowflakeDestinationUpdate"
    ] = None,
    iceberg_destination_update: Optional[
        "capo_firehose.types.iceberg_destination_update.IcebergDestinationUpdate"
    ] = None,
) -> "capo_firehose.types.update_destination_output.UpdateDestinationOutput":
    """<p>Updates the specified destination of the specified Firehose stream.</p> <p>Use this operation to change the destination type (for example, to replace the Amazon S3 destination with Amazon Redshift) or change the parameters associated with a destination (for example, to change the bucket name of the Amazon S3 destination). The update might not occur immediately. The target Firehose stream remains active while the configurations are updated, so data writes to the Firehose stream can continue during this process. The updated configurations are usually effective within a few minutes.</p> <p>Switching between Amazon OpenSearch Service and other services is not supported. For an Amazon OpenSearch Service destination, you can only update to another Amazon OpenSearch Service destination.</p> <p>If the destination type is the same, Firehose merges the configuration parameters specified with the destination configuration that already exists on the delivery stream. If any of the parameters are not specified in the call, the existing values are retained. For example, in the Amazon S3 destination, if <a>EncryptionConfiguration</a> is not specified, then the existing <code>EncryptionConfiguration</code> is maintained on the destination.</p> <p>If the destination type is not the same, for example, changing the destination from Amazon S3 to Amazon Redshift, Firehose does not merge any parameters. In this case, all parameters must be specified.</p> <p>Firehose uses <code>CurrentDeliveryStreamVersionId</code> to avoid race conditions and conflicting merges. This is a required field, and the service updates the configuration only if the existing configuration has a version ID that matches. After the update is applied successfully, the version ID is updated, and can be retrieved using <a>DescribeDeliveryStream</a>. Use the new version ID to set <code>CurrentDeliveryStreamVersionId</code> in the next call.</p>

    Args:
        delivery_stream_name: <p>The name of the Firehose stream.</p>
        current_delivery_stream_version_id: <p>Obtain this value from the <code>VersionId</code> result of <a>DeliveryStreamDescription</a>. This value is required, and helps the service perform conditional operations. For example, if there is an interleaving update and this value is null, then the update destination fails. After the update is successful, the <code>VersionId</code> value is updated. The service then performs a merge of the old configuration with the new configuration.</p>
        destination_id: <p>The ID of the destination.</p>
        s3_destination_update: <p>[Deprecated] Describes an update for a destination in Amazon S3.</p>
        extended_s3_destination_update: <p>Describes an update for a destination in Amazon S3.</p>
        redshift_destination_update: <p>Describes an update for a destination in Amazon Redshift.</p>
        elasticsearch_destination_update: <p>Describes an update for a destination in Amazon OpenSearch Service.</p>
        amazonopensearchservice_destination_update: <p>Describes an update for a destination in Amazon OpenSearch Service.</p>
        splunk_destination_update: <p>Describes an update for a destination in Splunk.</p>
        http_endpoint_destination_update: <p>Describes an update to the specified HTTP endpoint destination.</p>
        amazon_open_search_serverless_destination_update: <p>Describes an update for a destination in the Serverless offering for Amazon OpenSearch Service.</p>
        snowflake_destination_update: <p>Update to the Snowflake destination configuration settings.</p>
        iceberg_destination_update: <p> Describes an update for a destination in Apache Iceberg Tables. </p>

    Raises:
        capo_firehose.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Another modification has already happened. Fetch <code>VersionId</code> again and use it to update the destination.</p>
        capo_firehose.errors.invalid_argument_exception.InvalidArgumentException: <p>The specified input parameter has a value that is not valid.</p>
        capo_firehose.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is already in use and not available for this operation.</p>
        capo_firehose.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_firehose.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_firehose.types.update_destination_input.UpdateDestinationInput]",
    ) -> OperationResponse[
        "capo_firehose.types.update_destination_output.UpdateDestinationOutput"
    ]:
        import capo_firehose._operations.firehose_20150804.update_destination

        output, http_response = (
            capo_firehose._operations.firehose_20150804.update_destination.update_destination(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_firehose.types.update_destination_input.UpdateDestinationInput",
    ) -> dict[str, Any]:
        import capo_firehose.types.update_destination_input

        return capo_firehose.types.update_destination_input.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateDestination", redact_input=_redact_input),
    )
    input_: capo_firehose.types.update_destination_input.UpdateDestinationInput = {
        "delivery_stream_name": delivery_stream_name,
        "current_delivery_stream_version_id": current_delivery_stream_version_id,
        "destination_id": destination_id,
    }
    if s3_destination_update is not None:
        input_["s3_destination_update"] = s3_destination_update
    if extended_s3_destination_update is not None:
        input_["extended_s3_destination_update"] = extended_s3_destination_update
    if redshift_destination_update is not None:
        input_["redshift_destination_update"] = redshift_destination_update
    if elasticsearch_destination_update is not None:
        input_["elasticsearch_destination_update"] = (
            elasticsearch_destination_update
        )
    if amazonopensearchservice_destination_update is not None:
        input_["amazonopensearchservice_destination_update"] = (
            amazonopensearchservice_destination_update
        )
    if splunk_destination_update is not None:
        input_["splunk_destination_update"] = splunk_destination_update
    if http_endpoint_destination_update is not None:
        input_["http_endpoint_destination_update"] = (
            http_endpoint_destination_update
        )
    if amazon_open_search_serverless_destination_update is not None:
        input_["amazon_open_search_serverless_destination_update"] = (
            amazon_open_search_serverless_destination_update
        )
    if snowflake_destination_update is not None:
        input_["snowflake_destination_update"] = snowflake_destination_update
    if iceberg_destination_update is not None:
        input_["iceberg_destination_update"] = iceberg_destination_update

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