Skip to content

update_scaling_plan

update_scaling_plan(
    scaling_plan_name: ScalingPlanName,
    scaling_plan_version: ScalingPlanVersion,
    *,
    config_overrides: Optional[AutoScalingPlansClientConfig] = None,
    application_source: Optional[ApplicationSource] = None,
    scaling_instructions: Optional[ScalingInstructions] = None,
) -> UpdateScalingPlanResponse

Updates the specified scaling plan.

You cannot update a scaling plan if it is in the process of being created, updated, or deleted.

Parameters:

  • scaling_plan_name (ScalingPlanName) –

    The name of the scaling plan.

  • scaling_plan_version (ScalingPlanVersion) –

    The version number of the scaling plan. The only valid value is 1. Currently, you cannot have multiple scaling plan versions.

  • application_source (Optional[ApplicationSource], default: None ) –

    A CloudFormation stack or set of tags.

    For more information, see ApplicationSource in the AWS Auto Scaling API Reference.

  • scaling_instructions (Optional[ScalingInstructions], default: None ) –

    The scaling instructions.

    For more information, see ScalingInstruction in the AWS Auto Scaling API Reference.

Raises:

Source code in docs_src/capo_auto_scaling_plans/_services/auto_scaling_plans.py
def update_scaling_plan(
    self,
    scaling_plan_name: "capo_auto_scaling_plans.types.scaling_plan_name.ScalingPlanName",
    scaling_plan_version: "capo_auto_scaling_plans.types.scaling_plan_version.ScalingPlanVersion",
    *,
    config_overrides: Optional[AutoScalingPlansClientConfig] = None,
    application_source: Optional[
        "capo_auto_scaling_plans.types.application_source.ApplicationSource"
    ] = None,
    scaling_instructions: Optional[
        "capo_auto_scaling_plans.types.scaling_instructions.ScalingInstructions"
    ] = None,
) -> "capo_auto_scaling_plans.types.update_scaling_plan_response.UpdateScalingPlanResponse":
    """<p>Updates the specified scaling plan.</p> <p>You cannot update a scaling plan if it is in the process of being created, updated, or deleted.</p>

    Args:
        scaling_plan_name: <p>The name of the scaling plan.</p>
        scaling_plan_version: <p>The version number of the scaling plan. The only valid value is <code>1</code>. Currently, you cannot have multiple scaling plan versions.</p>
        application_source: <p>A CloudFormation stack or set of tags.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/plans/APIReference/API_ApplicationSource.html">ApplicationSource</a> in the <i>AWS Auto Scaling API Reference</i>.</p>
        scaling_instructions: <p>The scaling instructions.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/plans/APIReference/API_ScalingInstruction.html">ScalingInstruction</a> in the <i>AWS Auto Scaling API Reference</i>.</p>

    Raises:
        capo_auto_scaling_plans.errors.concurrent_update_exception.ConcurrentUpdateException: <p>Concurrent updates caused an exception, for example, if you request an update to a scaling plan that already has a pending update.</p>
        capo_auto_scaling_plans.errors.internal_service_exception.InternalServiceException: <p>The service encountered an internal error.</p>
        capo_auto_scaling_plans.errors.object_not_found_exception.ObjectNotFoundException: <p>The specified object could not be found.</p>
        capo_auto_scaling_plans.errors.validation_exception.ValidationException: <p>An exception was thrown for a validation issue. Review the parameters provided.</p>
        capo_auto_scaling_plans.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_auto_scaling_plans.types.update_scaling_plan_request.UpdateScalingPlanRequest]",
    ) -> OperationResponse[
        "capo_auto_scaling_plans.types.update_scaling_plan_response.UpdateScalingPlanResponse"
    ]:
        import capo_auto_scaling_plans._operations.any_scale_scaling_planner_frontend_service.update_scaling_plan

        output, http_response = (
            capo_auto_scaling_plans._operations.any_scale_scaling_planner_frontend_service.update_scaling_plan.update_scaling_plan(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateScalingPlan")
    )
    input_: capo_auto_scaling_plans.types.update_scaling_plan_request.UpdateScalingPlanRequest = {
        "scaling_plan_name": scaling_plan_name,
        "scaling_plan_version": scaling_plan_version,
    }
    if application_source is not None:
        input_["application_source"] = application_source
    if scaling_instructions is not None:
        input_["scaling_instructions"] = scaling_instructions

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