Skip to content

update_archive

update_archive(
    archive_name: ArchiveName,
    *,
    config_overrides: Optional[EventBridgeClientConfig] = None,
    description: Optional[ArchiveDescription] = None,
    event_pattern: Optional[EventPattern] = None,
    retention_days: Optional[RetentionDays] = None,
    kms_key_identifier: Optional[KmsKeyIdentifier] = None,
) -> UpdateArchiveResponse

Updates the specified archive.

Parameters:

  • archive_name (ArchiveName) –

    The name of the archive to update.

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

    The description for the archive.

  • event_pattern (Optional[EventPattern], default: None ) –

    The event pattern to use to filter events sent to the archive.

  • retention_days (Optional[RetentionDays], default: None ) –

    The number of days to retain events in the archive.

  • kms_key_identifier (Optional[KmsKeyIdentifier], default: None ) –

    The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.

    If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the archive.

    For more information, see Identify and view keys in the Key Management Service Developer Guide.

    If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.

    For more information, see Encrypting archives in the Amazon EventBridge User Guide.

Raises:

Source code in docs_src/capo_eventbridge/_services/event_bridge.py
def update_archive(
    self,
    archive_name: "capo_eventbridge.types.archive_name.ArchiveName",
    *,
    config_overrides: Optional[EventBridgeClientConfig] = None,
    description: Optional[
        "capo_eventbridge.types.archive_description.ArchiveDescription"
    ] = None,
    event_pattern: Optional[
        "capo_eventbridge.types.event_pattern.EventPattern"
    ] = None,
    retention_days: Optional[
        "capo_eventbridge.types.retention_days.RetentionDays"
    ] = None,
    kms_key_identifier: Optional[
        "capo_eventbridge.types.kms_key_identifier.KmsKeyIdentifier"
    ] = None,
) -> "capo_eventbridge.types.update_archive_response.UpdateArchiveResponse":
    """<p>Updates the specified archive.</p>

    Args:
        archive_name: <p>The name of the archive to update.</p>
        description: <p>The description for the archive.</p>
        event_pattern: <p>The event pattern to use to filter events sent to the archive.</p>
        retention_days: <p>The number of days to retain events in the archive.</p>
        kms_key_identifier: <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p> <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the archive.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>. </p> <important> <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well. </p> <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p> </important>

    Raises:
        capo_eventbridge.errors.concurrent_modification_exception.ConcurrentModificationException: <p>There is concurrent modification on a rule, target, archive, or replay.</p>
        capo_eventbridge.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_eventbridge.errors.invalid_event_pattern_exception.InvalidEventPatternException: <p>The event pattern is not valid.</p>
        capo_eventbridge.errors.limit_exceeded_exception.LimitExceededException: <p>The request failed because it attempted to create resource beyond the allowed service quota.</p>
        capo_eventbridge.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</p>
        capo_eventbridge.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_eventbridge.types.update_archive_request.UpdateArchiveRequest]",
    ) -> OperationResponse[
        "capo_eventbridge.types.update_archive_response.UpdateArchiveResponse"
    ]:
        import capo_eventbridge._operations.aws_events.update_archive

        output, http_response = (
            capo_eventbridge._operations.aws_events.update_archive.update_archive(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateArchive")
    )
    input_: capo_eventbridge.types.update_archive_request.UpdateArchiveRequest = {
        "archive_name": archive_name
    }
    if description is not None:
        input_["description"] = description
    if event_pattern is not None:
        input_["event_pattern"] = event_pattern
    if retention_days is not None:
        input_["retention_days"] = retention_days
    if kms_key_identifier is not None:
        input_["kms_key_identifier"] = kms_key_identifier

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