UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

200 lines 7.79 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Books and manages Autoscaling Instance policies. * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const up = new scaleway.autoscaling.InstancePolicy("up", { * instanceGroupId: main.id, * name: "scale-up-if-cpu-high", * action: "scale_up", * type: "flat_count", * value: 1, * priority: 1, * metrics: [{ * name: "cpu scale up", * managedMetric: "managed_metric_instance_cpu", * operator: "operator_greater_than", * aggregate: "aggregate_average", * samplingRangeMin: 5, * threshold: 70, * }], * }); * const down = new scaleway.autoscaling.InstancePolicy("down", { * instanceGroupId: main.id, * name: "scale-down-if-cpu-low", * action: "scale_down", * type: "flat_count", * value: 1, * priority: 2, * metrics: [{ * name: "cpu scale down", * managedMetric: "managed_metric_instance_cpu", * operator: "operator_less_than", * aggregate: "aggregate_average", * samplingRangeMin: 5, * threshold: 40, * }], * }); * ``` * * ## Import * * Autoscaling instance policies can be imported using `{zone}/{id}`, e.g. * * ```sh * $ pulumi import scaleway:autoscaling/instancePolicy:InstancePolicy main fr-par-1/11111111-1111-1111-1111-111111111111 * ``` */ export declare class InstancePolicy extends pulumi.CustomResource { /** * Get an existing InstancePolicy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstancePolicyState, opts?: pulumi.CustomResourceOptions): InstancePolicy; /** * Returns true if the given object is an instance of InstancePolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is InstancePolicy; /** * The action to execute when the metric-based condition is met. */ readonly action: pulumi.Output<string>; /** * The ID of the Instance group related to this policy. */ readonly instanceGroupId: pulumi.Output<string>; /** * Cockpit metric to use when determining whether to trigger a scale up/down action. */ readonly metrics: pulumi.Output<outputs.autoscaling.InstancePolicyMetric[]>; /** * The Instance policy name. */ readonly name: pulumi.Output<string>; /** * The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority. */ readonly priority: pulumi.Output<number>; /** * `projectId`) The ID of the Project the Instance policy is associated with. */ readonly projectId: pulumi.Output<string>; /** * How to use the number defined in `value` when determining by how many Instances to scale up/down. */ readonly type: pulumi.Output<string>; /** * The value representing the magnitude of the scaling action to take for the Instance group. Depending on the `type` parameter, this number could represent a total number of Instances in the group, a number of Instances to add, or a percentage to scale the group by. */ readonly value: pulumi.Output<number>; /** * `zone`) The zone in which the Instance policy exists. */ readonly zone: pulumi.Output<string | undefined>; /** * Create a InstancePolicy resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: InstancePolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering InstancePolicy resources. */ export interface InstancePolicyState { /** * The action to execute when the metric-based condition is met. */ action?: pulumi.Input<string | undefined>; /** * The ID of the Instance group related to this policy. */ instanceGroupId?: pulumi.Input<string | undefined>; /** * Cockpit metric to use when determining whether to trigger a scale up/down action. */ metrics?: pulumi.Input<pulumi.Input<inputs.autoscaling.InstancePolicyMetric>[] | undefined>; /** * The Instance policy name. */ name?: pulumi.Input<string | undefined>; /** * The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority. */ priority?: pulumi.Input<number | undefined>; /** * `projectId`) The ID of the Project the Instance policy is associated with. */ projectId?: pulumi.Input<string | undefined>; /** * How to use the number defined in `value` when determining by how many Instances to scale up/down. */ type?: pulumi.Input<string | undefined>; /** * The value representing the magnitude of the scaling action to take for the Instance group. Depending on the `type` parameter, this number could represent a total number of Instances in the group, a number of Instances to add, or a percentage to scale the group by. */ value?: pulumi.Input<number | undefined>; /** * `zone`) The zone in which the Instance policy exists. */ zone?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a InstancePolicy resource. */ export interface InstancePolicyArgs { /** * The action to execute when the metric-based condition is met. */ action: pulumi.Input<string>; /** * The ID of the Instance group related to this policy. */ instanceGroupId: pulumi.Input<string>; /** * Cockpit metric to use when determining whether to trigger a scale up/down action. */ metrics?: pulumi.Input<pulumi.Input<inputs.autoscaling.InstancePolicyMetric>[] | undefined>; /** * The Instance policy name. */ name?: pulumi.Input<string | undefined>; /** * The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority. */ priority: pulumi.Input<number>; /** * `projectId`) The ID of the Project the Instance policy is associated with. */ projectId?: pulumi.Input<string | undefined>; /** * How to use the number defined in `value` when determining by how many Instances to scale up/down. */ type: pulumi.Input<string>; /** * The value representing the magnitude of the scaling action to take for the Instance group. Depending on the `type` parameter, this number could represent a total number of Instances in the group, a number of Instances to add, or a percentage to scale the group by. */ value: pulumi.Input<number>; /** * `zone`) The zone in which the Instance policy exists. */ zone?: pulumi.Input<string | undefined>; } //# sourceMappingURL=instancePolicy.d.ts.map