Skip to content

apply_pending_maintenance_action async

apply_pending_maintenance_action(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    resource_identifier: Optional[String] = None,
    apply_action: Optional[String] = None,
    opt_in_type: Optional[String] = None,
) -> ApplyPendingMaintenanceActionResult

Applies a pending maintenance action to a resource (for example, to a DB instance).

Parameters:

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

    The RDS Amazon Resource Name (ARN) of the resource that the pending maintenance action applies to. For information about creating an ARN, see Constructing an RDS Amazon Resource Name (ARN).

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

    The pending maintenance action to apply to this resource.

    Valid Values:

    • ca-certificate-rotation

    • db-upgrade

    • hardware-maintenance

    • os-upgrade

    • system-update

    For more information about these actions, see Maintenance actions for Amazon Aurora or Maintenance actions for Amazon RDS.

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

    A value that specifies the type of opt-in request, or undoes an opt-in request. An opt-in request of type immediate can't be undone.

    Valid Values:

    • immediate - Apply the maintenance action immediately.

    • next-maintenance - Apply the maintenance action during the next maintenance window for the resource.

    • undo-opt-in - Cancel any existing next-maintenance opt-in requests.

Raises:

Examples:

To apply pending maintenance actions The following example applies the pending maintenance actions for a DB cluster.

>>> await client.apply_pending_maintenance_action(resource_identifier='arn:aws:rds:us-east-1:123456789012:cluster:my-db-cluster', apply_action='system-update', opt_in_type='immediate')
Source code in docs_src/capo_rds/_services/async_rds.py
async def apply_pending_maintenance_action(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    resource_identifier: Optional["capo_rds.types.string.String"] = None,
    apply_action: Optional["capo_rds.types.string.String"] = None,
    opt_in_type: Optional["capo_rds.types.string.String"] = None,
) -> "capo_rds.types.apply_pending_maintenance_action_result.ApplyPendingMaintenanceActionResult":
    """<p>Applies a pending maintenance action to a resource (for example, to a DB instance).</p>

    Args:
        resource_identifier: <p>The RDS Amazon Resource Name (ARN) of the resource that the pending maintenance action applies to. For information about creating an ARN, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing"> Constructing an RDS Amazon Resource Name (ARN)</a>.</p>
        apply_action: <p>The pending maintenance action to apply to this resource.</p> <p>Valid Values:</p> <ul> <li> <p> <code>ca-certificate-rotation</code> </p> </li> <li> <p> <code>db-upgrade</code> </p> </li> <li> <p> <code>hardware-maintenance</code> </p> </li> <li> <p> <code>os-upgrade</code> </p> </li> <li> <p> <code>system-update</code> </p> </li> </ul> <p>For more information about these actions, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#maintenance-actions-aurora">Maintenance actions for Amazon Aurora</a> or <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#maintenance-actions-rds">Maintenance actions for Amazon RDS</a>.</p>
        opt_in_type: <p>A value that specifies the type of opt-in request, or undoes an opt-in request. An opt-in request of type <code>immediate</code> can't be undone.</p> <p>Valid Values:</p> <ul> <li> <p> <code>immediate</code> - Apply the maintenance action immediately.</p> </li> <li> <p> <code>next-maintenance</code> - Apply the maintenance action during the next maintenance window for the resource.</p> </li> <li> <p> <code>undo-opt-in</code> - Cancel any existing <code>next-maintenance</code> opt-in requests.</p> </li> </ul>

    Raises:
        capo_rds.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The requested operation can't be performed while the cluster is in this state.</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.

    Examples:
        To apply pending maintenance actions
        The following example applies the pending maintenance actions for a DB cluster.

        >>> await client.apply_pending_maintenance_action(resource_identifier='arn:aws:rds:us-east-1:123456789012:cluster:my-db-cluster', apply_action='system-update', opt_in_type='immediate')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.apply_pending_maintenance_action_message.ApplyPendingMaintenanceActionMessage]",
    ) -> AsyncOperationResponse[
        "capo_rds.types.apply_pending_maintenance_action_result.ApplyPendingMaintenanceActionResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.apply_pending_maintenance_action

        (
            output,
            http_response,
        ) = await capo_rds._operations.amazon_rd_sv19.apply_pending_maintenance_action.async_apply_pending_maintenance_action(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ApplyPendingMaintenanceAction")
    )
    input_: capo_rds.types.apply_pending_maintenance_action_message.ApplyPendingMaintenanceActionMessage = {}
    if resource_identifier is not None:
        input_["resource_identifier"] = resource_identifier
    if apply_action is not None:
        input_["apply_action"] = apply_action
    if opt_in_type is not None:
        input_["opt_in_type"] = opt_in_type

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