Skip to content

update_resiliency_policy

update_resiliency_policy(
    policy_arn: Arn,
    *,
    config_overrides: Optional[resiliencehubClientConfig] = None,
    policy_name: Optional[EntityName] = None,
    policy_description: Optional[EntityDescription] = None,
    data_location_constraint: Optional[DataLocationConstraint] = None,
    tier: Optional[ResiliencyPolicyTier] = None,
    policy: Optional[DisruptionPolicy] = None,
) -> UpdateResiliencyPolicyResponse

Updates a resiliency policy.

Resilience Hub allows you to provide a value of zero for rtoInSecs and rpoInSecs of your resiliency policy. But, while assessing your application, the lowest possible assessment result is near zero. Hence, if you provide value zero for rtoInSecs and rpoInSecs, the estimated workload RTO and estimated workload RPO result will be near zero and the Compliance status for your application will be set to Policy breached.

Parameters:

  • policy_arn (Arn) –

    Amazon Resource Name (ARN) of the resiliency policy. The format for this ARN is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide.

  • policy_name (Optional[EntityName], default: None ) –

    Name of the resiliency policy.

  • policy_description (Optional[EntityDescription], default: None ) –

    Description of the resiliency policy.

  • data_location_constraint (Optional[DataLocationConstraint], default: None ) –

    Specifies a high-level geographical location constraint for where your resilience policy data can be stored.

  • tier (Optional[ResiliencyPolicyTier], default: None ) –

    The tier for this resiliency policy, ranging from the highest severity (MissionCritical) to lowest (NonCritical).

  • policy (Optional[DisruptionPolicy], default: None ) –

    Resiliency policy to be created, including the recovery time objective (RTO) and recovery point objective (RPO) in seconds.

Raises:

  • AccessDeniedException –

    You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.

  • ConflictException –

    This exception occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.

  • InternalServerException –

    This exception occurs when there is an internal failure in the Resilience Hub service.

  • ResourceNotFoundException –

    This exception occurs when the specified resource could not be found.

  • ThrottlingException –

    This exception occurs when you have exceeded the limit on the number of requests per second.

  • ValidationException –

    This exception occurs when a request is not valid.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_resiliencehub/_services/resiliencehub.py
def update_resiliency_policy(
    self,
    policy_arn: "capo_resiliencehub.types.arn.Arn",
    *,
    config_overrides: Optional[resiliencehubClientConfig] = None,
    policy_name: Optional["capo_resiliencehub.types.entity_name.EntityName"] = None,
    policy_description: Optional[
        "capo_resiliencehub.types.entity_description.EntityDescription"
    ] = None,
    data_location_constraint: Optional[
        "capo_resiliencehub.types.data_location_constraint.DataLocationConstraint"
    ] = None,
    tier: Optional[
        "capo_resiliencehub.types.resiliency_policy_tier.ResiliencyPolicyTier"
    ] = None,
    policy: Optional[
        "capo_resiliencehub.types.disruption_policy.DisruptionPolicy"
    ] = None,
) -> "capo_resiliencehub.types.update_resiliency_policy_response.UpdateResiliencyPolicyResponse":
    """<p>Updates a resiliency policy.</p> <note> <p>Resilience Hub allows you to provide a value of zero for <code>rtoInSecs</code> and <code>rpoInSecs</code> of your resiliency policy. But, while assessing your application, the lowest possible assessment result is near zero. Hence, if you provide value zero for <code>rtoInSecs</code> and <code>rpoInSecs</code>, the estimated workload RTO and estimated workload RPO result will be near zero and the <b>Compliance status</b> for your application will be set to <b>Policy breached</b>.</p> </note>

    Args:
        policy_arn: <p>Amazon Resource Name (ARN) of the resiliency policy. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:resiliency-policy/<code>policy-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
        policy_name: <p>Name of the resiliency policy.</p>
        policy_description: <p>Description of the resiliency policy.</p>
        data_location_constraint: <p>Specifies a high-level geographical location constraint for where your resilience policy data can be stored.</p>
        tier: <p>The tier for this resiliency policy, ranging from the highest severity (<code>MissionCritical</code>) to lowest (<code>NonCritical</code>).</p>
        policy: <p>Resiliency policy to be created, including the recovery time objective (RTO) and recovery point objective (RPO) in seconds.</p>

    Raises:
        capo_resiliencehub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.</p>
        capo_resiliencehub.errors.conflict_exception.ConflictException: <p>This exception occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
        capo_resiliencehub.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Resilience Hub service.</p>
        capo_resiliencehub.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception occurs when the specified resource could not be found.</p>
        capo_resiliencehub.errors.throttling_exception.ThrottlingException: <p>This exception occurs when you have exceeded the limit on the number of requests per second.</p>
        capo_resiliencehub.errors.validation_exception.ValidationException: <p>This exception occurs when a request is not valid.</p>
        capo_resiliencehub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_resiliencehub.types.update_resiliency_policy_request.UpdateResiliencyPolicyRequest]",
    ) -> OperationResponse[
        "capo_resiliencehub.types.update_resiliency_policy_response.UpdateResiliencyPolicyResponse"
    ]:
        import capo_resiliencehub._operations.aws_resilience_hub.update_resiliency_policy

        output, http_response = (
            capo_resiliencehub._operations.aws_resilience_hub.update_resiliency_policy.update_resiliency_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_resiliencehub.types.update_resiliency_policy_response.UpdateResiliencyPolicyResponse",
    ) -> dict[str, Any]:
        import capo_resiliencehub.types.update_resiliency_policy_response

        return capo_resiliencehub.types.update_resiliency_policy_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateResiliencyPolicy", redact_output=_redact_output),
    )
    input_: capo_resiliencehub.types.update_resiliency_policy_request.UpdateResiliencyPolicyRequest = {
        "policy_arn": policy_arn
    }
    if policy_name is not None:
        input_["policy_name"] = policy_name
    if policy_description is not None:
        input_["policy_description"] = policy_description
    if data_location_constraint is not None:
        input_["data_location_constraint"] = data_location_constraint
    if tier is not None:
        input_["tier"] = tier
    if policy is not None:
        input_["policy"] = policy

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