Skip to content

modify_activity_stream

modify_activity_stream(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    resource_arn: Optional[String] = None,
    audit_policy_state: Optional[AuditPolicyState] = None,
) -> ModifyActivityStreamResponse

Changes the audit policy state of a database activity stream to either locked (default) or unlocked. A locked policy is read-only, whereas an unlocked policy is read/write. If your activity stream is started and locked, you can unlock it, customize your audit policy, and then lock your activity stream. Restarting the activity stream isn't required. For more information, see Modifying a database activity stream in the Amazon RDS User Guide.

This operation is supported for RDS for Oracle and Microsoft SQL Server.

Parameters:

  • resource_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the RDS for Oracle or Microsoft SQL Server DB instance. For example, arn:aws:rds:us-east-1:12345667890:db:my-orcl-db.

  • audit_policy_state (Optional[AuditPolicyState], default: None ) –

    The audit policy state. When a policy is unlocked, it is read/write. When it is locked, it is read-only. You can edit your audit policy only when the activity stream is unlocked or stopped.

Raises:

Source code in docs_src/capo_rds/_services/rds.py
def modify_activity_stream(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    resource_arn: Optional["capo_rds.types.string.String"] = None,
    audit_policy_state: Optional[
        "capo_rds.types.audit_policy_state.AuditPolicyState"
    ] = None,
) -> "capo_rds.types.modify_activity_stream_response.ModifyActivityStreamResponse":
    """<p>Changes the audit policy state of a database activity stream to either locked (default) or unlocked. A locked policy is read-only, whereas an unlocked policy is read/write. If your activity stream is started and locked, you can unlock it, customize your audit policy, and then lock your activity stream. Restarting the activity stream isn't required. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/DBActivityStreams.Modifying.html"> Modifying a database activity stream</a> in the <i>Amazon RDS User Guide</i>. </p> <p>This operation is supported for RDS for Oracle and Microsoft SQL Server.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the RDS for Oracle or Microsoft SQL Server DB instance. For example, <code>arn:aws:rds:us-east-1:12345667890:db:my-orcl-db</code>.</p>
        audit_policy_state: <p>The audit policy state. When a policy is unlocked, it is read/write. When it is locked, it is read-only. You can edit your audit policy only when the activity stream is unlocked or stopped.</p>

    Raises:
        capo_rds.errors.db_instance_not_found_fault.DBInstanceNotFoundFault: <p> <code>DBInstanceIdentifier</code> doesn't refer to an existing DB instance.</p>
        capo_rds.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The DB instance isn't in a valid state.</p>
        capo_rds.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The specified resource ID was not found.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.modify_activity_stream_request.ModifyActivityStreamRequest]",
    ) -> OperationResponse[
        "capo_rds.types.modify_activity_stream_response.ModifyActivityStreamResponse"
    ]:
        import capo_rds._operations.amazon_rd_sv19.modify_activity_stream

        output, http_response = (
            capo_rds._operations.amazon_rd_sv19.modify_activity_stream.modify_activity_stream(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyActivityStream")
    )
    input_: capo_rds.types.modify_activity_stream_request.ModifyActivityStreamRequest = {}
    if resource_arn is not None:
        input_["resource_arn"] = resource_arn
    if audit_policy_state is not None:
        input_["audit_policy_state"] = audit_policy_state

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