1. Packages
  2. Scaleway
  3. API Docs
  4. autoscaling
  5. InstancePolicy
Scaleway v1.32.0 published on Friday, Aug 1, 2025 by pulumiverse

scaleway.autoscaling.InstancePolicy

Explore with Pulumi AI

scaleway logo
Scaleway v1.32.0 published on Friday, Aug 1, 2025 by pulumiverse

    Books and manages Autoscaling Instance policies.

    Example Usage

    Basic

    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 pulumi
    import pulumiverse_scaleway as scaleway
    
    up = scaleway.autoscaling.InstancePolicy("up",
        instance_group_id=main["id"],
        name="scale-up-if-cpu-high",
        action="scale_up",
        type="flat_count",
        value=1,
        priority=1,
        metrics=[{
            "name": "cpu scale up",
            "managed_metric": "managed_metric_instance_cpu",
            "operator": "operator_greater_than",
            "aggregate": "aggregate_average",
            "sampling_range_min": 5,
            "threshold": 70,
        }])
    down = scaleway.autoscaling.InstancePolicy("down",
        instance_group_id=main["id"],
        name="scale-down-if-cpu-low",
        action="scale_down",
        type="flat_count",
        value=1,
        priority=2,
        metrics=[{
            "name": "cpu scale down",
            "managed_metric": "managed_metric_instance_cpu",
            "operator": "operator_less_than",
            "aggregate": "aggregate_average",
            "sampling_range_min": 5,
            "threshold": 40,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/autoscaling"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := autoscaling.NewInstancePolicy(ctx, "up", &autoscaling.InstancePolicyArgs{
    			InstanceGroupId: pulumi.Any(main.Id),
    			Name:            pulumi.String("scale-up-if-cpu-high"),
    			Action:          pulumi.String("scale_up"),
    			Type:            pulumi.String("flat_count"),
    			Value:           pulumi.Int(1),
    			Priority:        pulumi.Int(1),
    			Metrics: autoscaling.InstancePolicyMetricArray{
    				&autoscaling.InstancePolicyMetricArgs{
    					Name:             pulumi.String("cpu scale up"),
    					ManagedMetric:    pulumi.String("managed_metric_instance_cpu"),
    					Operator:         pulumi.String("operator_greater_than"),
    					Aggregate:        pulumi.String("aggregate_average"),
    					SamplingRangeMin: pulumi.Int(5),
    					Threshold:        pulumi.Int(70),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = autoscaling.NewInstancePolicy(ctx, "down", &autoscaling.InstancePolicyArgs{
    			InstanceGroupId: pulumi.Any(main.Id),
    			Name:            pulumi.String("scale-down-if-cpu-low"),
    			Action:          pulumi.String("scale_down"),
    			Type:            pulumi.String("flat_count"),
    			Value:           pulumi.Int(1),
    			Priority:        pulumi.Int(2),
    			Metrics: autoscaling.InstancePolicyMetricArray{
    				&autoscaling.InstancePolicyMetricArgs{
    					Name:             pulumi.String("cpu scale down"),
    					ManagedMetric:    pulumi.String("managed_metric_instance_cpu"),
    					Operator:         pulumi.String("operator_less_than"),
    					Aggregate:        pulumi.String("aggregate_average"),
    					SamplingRangeMin: pulumi.Int(5),
    					Threshold:        pulumi.Int(40),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var up = new Scaleway.Autoscaling.InstancePolicy("up", new()
        {
            InstanceGroupId = main.Id,
            Name = "scale-up-if-cpu-high",
            Action = "scale_up",
            Type = "flat_count",
            Value = 1,
            Priority = 1,
            Metrics = new[]
            {
                new Scaleway.Autoscaling.Inputs.InstancePolicyMetricArgs
                {
                    Name = "cpu scale up",
                    ManagedMetric = "managed_metric_instance_cpu",
                    Operator = "operator_greater_than",
                    Aggregate = "aggregate_average",
                    SamplingRangeMin = 5,
                    Threshold = 70,
                },
            },
        });
    
        var down = new Scaleway.Autoscaling.InstancePolicy("down", new()
        {
            InstanceGroupId = main.Id,
            Name = "scale-down-if-cpu-low",
            Action = "scale_down",
            Type = "flat_count",
            Value = 1,
            Priority = 2,
            Metrics = new[]
            {
                new Scaleway.Autoscaling.Inputs.InstancePolicyMetricArgs
                {
                    Name = "cpu scale down",
                    ManagedMetric = "managed_metric_instance_cpu",
                    Operator = "operator_less_than",
                    Aggregate = "aggregate_average",
                    SamplingRangeMin = 5,
                    Threshold = 40,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.autoscaling.InstancePolicy;
    import com.pulumi.scaleway.autoscaling.InstancePolicyArgs;
    import com.pulumi.scaleway.autoscaling.inputs.InstancePolicyMetricArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var up = new InstancePolicy("up", InstancePolicyArgs.builder()
                .instanceGroupId(main.id())
                .name("scale-up-if-cpu-high")
                .action("scale_up")
                .type("flat_count")
                .value(1)
                .priority(1)
                .metrics(InstancePolicyMetricArgs.builder()
                    .name("cpu scale up")
                    .managedMetric("managed_metric_instance_cpu")
                    .operator("operator_greater_than")
                    .aggregate("aggregate_average")
                    .samplingRangeMin(5)
                    .threshold(70)
                    .build())
                .build());
    
            var down = new InstancePolicy("down", InstancePolicyArgs.builder()
                .instanceGroupId(main.id())
                .name("scale-down-if-cpu-low")
                .action("scale_down")
                .type("flat_count")
                .value(1)
                .priority(2)
                .metrics(InstancePolicyMetricArgs.builder()
                    .name("cpu scale down")
                    .managedMetric("managed_metric_instance_cpu")
                    .operator("operator_less_than")
                    .aggregate("aggregate_average")
                    .samplingRangeMin(5)
                    .threshold(40)
                    .build())
                .build());
    
        }
    }
    
    resources:
      up:
        type: scaleway:autoscaling:InstancePolicy
        properties:
          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
      down:
        type: scaleway:autoscaling:InstancePolicy
        properties:
          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
    

    Create InstancePolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new InstancePolicy(name: string, args: InstancePolicyArgs, opts?: CustomResourceOptions);
    @overload
    def InstancePolicy(resource_name: str,
                       args: InstancePolicyArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def InstancePolicy(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       action: Optional[str] = None,
                       instance_group_id: Optional[str] = None,
                       priority: Optional[int] = None,
                       type: Optional[str] = None,
                       value: Optional[int] = None,
                       metrics: Optional[Sequence[InstancePolicyMetricArgs]] = None,
                       name: Optional[str] = None,
                       project_id: Optional[str] = None,
                       zone: Optional[str] = None)
    func NewInstancePolicy(ctx *Context, name string, args InstancePolicyArgs, opts ...ResourceOption) (*InstancePolicy, error)
    public InstancePolicy(string name, InstancePolicyArgs args, CustomResourceOptions? opts = null)
    public InstancePolicy(String name, InstancePolicyArgs args)
    public InstancePolicy(String name, InstancePolicyArgs args, CustomResourceOptions options)
    
    type: scaleway:autoscaling:InstancePolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args InstancePolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args InstancePolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args InstancePolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstancePolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstancePolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var instancePolicyResource = new Scaleway.Autoscaling.InstancePolicy("instancePolicyResource", new()
    {
        Action = "string",
        InstanceGroupId = "string",
        Priority = 0,
        Type = "string",
        Value = 0,
        Metrics = new[]
        {
            new Scaleway.Autoscaling.Inputs.InstancePolicyMetricArgs
            {
                Aggregate = "string",
                Name = "string",
                Operator = "string",
                CockpitMetricName = "string",
                ManagedMetric = "string",
                SamplingRangeMin = 0,
                Threshold = 0,
            },
        },
        Name = "string",
        ProjectId = "string",
        Zone = "string",
    });
    
    example, err := autoscaling.NewInstancePolicy(ctx, "instancePolicyResource", &autoscaling.InstancePolicyArgs{
    	Action:          pulumi.String("string"),
    	InstanceGroupId: pulumi.String("string"),
    	Priority:        pulumi.Int(0),
    	Type:            pulumi.String("string"),
    	Value:           pulumi.Int(0),
    	Metrics: autoscaling.InstancePolicyMetricArray{
    		&autoscaling.InstancePolicyMetricArgs{
    			Aggregate:         pulumi.String("string"),
    			Name:              pulumi.String("string"),
    			Operator:          pulumi.String("string"),
    			CockpitMetricName: pulumi.String("string"),
    			ManagedMetric:     pulumi.String("string"),
    			SamplingRangeMin:  pulumi.Int(0),
    			Threshold:         pulumi.Int(0),
    		},
    	},
    	Name:      pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	Zone:      pulumi.String("string"),
    })
    
    var instancePolicyResource = new InstancePolicy("instancePolicyResource", InstancePolicyArgs.builder()
        .action("string")
        .instanceGroupId("string")
        .priority(0)
        .type("string")
        .value(0)
        .metrics(InstancePolicyMetricArgs.builder()
            .aggregate("string")
            .name("string")
            .operator("string")
            .cockpitMetricName("string")
            .managedMetric("string")
            .samplingRangeMin(0)
            .threshold(0)
            .build())
        .name("string")
        .projectId("string")
        .zone("string")
        .build());
    
    instance_policy_resource = scaleway.autoscaling.InstancePolicy("instancePolicyResource",
        action="string",
        instance_group_id="string",
        priority=0,
        type="string",
        value=0,
        metrics=[{
            "aggregate": "string",
            "name": "string",
            "operator": "string",
            "cockpit_metric_name": "string",
            "managed_metric": "string",
            "sampling_range_min": 0,
            "threshold": 0,
        }],
        name="string",
        project_id="string",
        zone="string")
    
    const instancePolicyResource = new scaleway.autoscaling.InstancePolicy("instancePolicyResource", {
        action: "string",
        instanceGroupId: "string",
        priority: 0,
        type: "string",
        value: 0,
        metrics: [{
            aggregate: "string",
            name: "string",
            operator: "string",
            cockpitMetricName: "string",
            managedMetric: "string",
            samplingRangeMin: 0,
            threshold: 0,
        }],
        name: "string",
        projectId: "string",
        zone: "string",
    });
    
    type: scaleway:autoscaling:InstancePolicy
    properties:
        action: string
        instanceGroupId: string
        metrics:
            - aggregate: string
              cockpitMetricName: string
              managedMetric: string
              name: string
              operator: string
              samplingRangeMin: 0
              threshold: 0
        name: string
        priority: 0
        projectId: string
        type: string
        value: 0
        zone: string
    

    InstancePolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The InstancePolicy resource accepts the following input properties:

    Action string
    The action to execute when the metric-based condition is met.
    InstanceGroupId string
    The ID of the Instance group related to this policy.
    Priority int
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    Type string
    How to use the number defined in value when determining by how many Instances to scale up/down.
    Value int
    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.
    Metrics List<Pulumiverse.Scaleway.Autoscaling.Inputs.InstancePolicyMetric>
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    Name string
    The Instance policy name.
    ProjectId string
    project_id) The ID of the Project the Instance policy is associated with.
    Zone string
    zone) The zone in which the Instance policy exists.
    Action string
    The action to execute when the metric-based condition is met.
    InstanceGroupId string
    The ID of the Instance group related to this policy.
    Priority int
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    Type string
    How to use the number defined in value when determining by how many Instances to scale up/down.
    Value int
    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.
    Metrics []InstancePolicyMetricArgs
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    Name string
    The Instance policy name.
    ProjectId string
    project_id) The ID of the Project the Instance policy is associated with.
    Zone string
    zone) The zone in which the Instance policy exists.
    action String
    The action to execute when the metric-based condition is met.
    instanceGroupId String
    The ID of the Instance group related to this policy.
    priority Integer
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    type String
    How to use the number defined in value when determining by how many Instances to scale up/down.
    value Integer
    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.
    metrics List<InstancePolicyMetric>
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    name String
    The Instance policy name.
    projectId String
    project_id) The ID of the Project the Instance policy is associated with.
    zone String
    zone) The zone in which the Instance policy exists.
    action string
    The action to execute when the metric-based condition is met.
    instanceGroupId string
    The ID of the Instance group related to this policy.
    priority number
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    type string
    How to use the number defined in value when determining by how many Instances to scale up/down.
    value number
    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.
    metrics InstancePolicyMetric[]
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    name string
    The Instance policy name.
    projectId string
    project_id) The ID of the Project the Instance policy is associated with.
    zone string
    zone) The zone in which the Instance policy exists.
    action str
    The action to execute when the metric-based condition is met.
    instance_group_id str
    The ID of the Instance group related to this policy.
    priority int
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    type str
    How to use the number defined in value when determining by how many Instances to scale up/down.
    value int
    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.
    metrics Sequence[InstancePolicyMetricArgs]
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    name str
    The Instance policy name.
    project_id str
    project_id) The ID of the Project the Instance policy is associated with.
    zone str
    zone) The zone in which the Instance policy exists.
    action String
    The action to execute when the metric-based condition is met.
    instanceGroupId String
    The ID of the Instance group related to this policy.
    priority Number
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    type String
    How to use the number defined in value when determining by how many Instances to scale up/down.
    value Number
    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.
    metrics List<Property Map>
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    name String
    The Instance policy name.
    projectId String
    project_id) The ID of the Project the Instance policy is associated with.
    zone String
    zone) The zone in which the Instance policy exists.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the InstancePolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing InstancePolicy Resource

    Get an existing InstancePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: InstancePolicyState, opts?: CustomResourceOptions): InstancePolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            action: Optional[str] = None,
            instance_group_id: Optional[str] = None,
            metrics: Optional[Sequence[InstancePolicyMetricArgs]] = None,
            name: Optional[str] = None,
            priority: Optional[int] = None,
            project_id: Optional[str] = None,
            type: Optional[str] = None,
            value: Optional[int] = None,
            zone: Optional[str] = None) -> InstancePolicy
    func GetInstancePolicy(ctx *Context, name string, id IDInput, state *InstancePolicyState, opts ...ResourceOption) (*InstancePolicy, error)
    public static InstancePolicy Get(string name, Input<string> id, InstancePolicyState? state, CustomResourceOptions? opts = null)
    public static InstancePolicy get(String name, Output<String> id, InstancePolicyState state, CustomResourceOptions options)
    resources:  _:    type: scaleway:autoscaling:InstancePolicy    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Action string
    The action to execute when the metric-based condition is met.
    InstanceGroupId string
    The ID of the Instance group related to this policy.
    Metrics List<Pulumiverse.Scaleway.Autoscaling.Inputs.InstancePolicyMetric>
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    Name string
    The Instance policy name.
    Priority int
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    ProjectId string
    project_id) The ID of the Project the Instance policy is associated with.
    Type string
    How to use the number defined in value when determining by how many Instances to scale up/down.
    Value int
    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.
    Zone string
    zone) The zone in which the Instance policy exists.
    Action string
    The action to execute when the metric-based condition is met.
    InstanceGroupId string
    The ID of the Instance group related to this policy.
    Metrics []InstancePolicyMetricArgs
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    Name string
    The Instance policy name.
    Priority int
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    ProjectId string
    project_id) The ID of the Project the Instance policy is associated with.
    Type string
    How to use the number defined in value when determining by how many Instances to scale up/down.
    Value int
    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.
    Zone string
    zone) The zone in which the Instance policy exists.
    action String
    The action to execute when the metric-based condition is met.
    instanceGroupId String
    The ID of the Instance group related to this policy.
    metrics List<InstancePolicyMetric>
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    name String
    The Instance policy name.
    priority Integer
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    projectId String
    project_id) The ID of the Project the Instance policy is associated with.
    type String
    How to use the number defined in value when determining by how many Instances to scale up/down.
    value Integer
    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.
    zone String
    zone) The zone in which the Instance policy exists.
    action string
    The action to execute when the metric-based condition is met.
    instanceGroupId string
    The ID of the Instance group related to this policy.
    metrics InstancePolicyMetric[]
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    name string
    The Instance policy name.
    priority number
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    projectId string
    project_id) The ID of the Project the Instance policy is associated with.
    type string
    How to use the number defined in value when determining by how many Instances to scale up/down.
    value number
    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.
    zone string
    zone) The zone in which the Instance policy exists.
    action str
    The action to execute when the metric-based condition is met.
    instance_group_id str
    The ID of the Instance group related to this policy.
    metrics Sequence[InstancePolicyMetricArgs]
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    name str
    The Instance policy name.
    priority int
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    project_id str
    project_id) The ID of the Project the Instance policy is associated with.
    type str
    How to use the number defined in value when determining by how many Instances to scale up/down.
    value int
    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.
    zone str
    zone) The zone in which the Instance policy exists.
    action String
    The action to execute when the metric-based condition is met.
    instanceGroupId String
    The ID of the Instance group related to this policy.
    metrics List<Property Map>
    Cockpit metric to use when determining whether to trigger a scale up/down action.
    name String
    The Instance policy name.
    priority Number
    The priority of this policy compared to all other scaling policies. This determines the processing order. The lower the number, the higher the priority.
    projectId String
    project_id) The ID of the Project the Instance policy is associated with.
    type String
    How to use the number defined in value when determining by how many Instances to scale up/down.
    value Number
    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.
    zone String
    zone) The zone in which the Instance policy exists.

    Supporting Types

    InstancePolicyMetric, InstancePolicyMetricArgs

    Aggregate string
    How the values sampled for the metric should be aggregated.
    Name string
    Name or description of the metric policy.
    Operator string
    Operator used when comparing the threshold value of the chosen metric to the actual sampled and aggregated value.
    CockpitMetricName string
    The custom metric to use for this policy. This must be stored in Scaleway Cockpit. The metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered
    ManagedMetric string
    The managed metric to use for this policy. These are available by default in Cockpit without any configuration or node_exporter. The chosen metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered.
    SamplingRangeMin int
    The Interval of time, in minutes, during which metric is sampled.
    Threshold int
    The threshold value to measure the aggregated sampled metric value against. Combined with the operator field, determines whether a scaling action should be triggered.
    Aggregate string
    How the values sampled for the metric should be aggregated.
    Name string
    Name or description of the metric policy.
    Operator string
    Operator used when comparing the threshold value of the chosen metric to the actual sampled and aggregated value.
    CockpitMetricName string
    The custom metric to use for this policy. This must be stored in Scaleway Cockpit. The metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered
    ManagedMetric string
    The managed metric to use for this policy. These are available by default in Cockpit without any configuration or node_exporter. The chosen metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered.
    SamplingRangeMin int
    The Interval of time, in minutes, during which metric is sampled.
    Threshold int
    The threshold value to measure the aggregated sampled metric value against. Combined with the operator field, determines whether a scaling action should be triggered.
    aggregate String
    How the values sampled for the metric should be aggregated.
    name String
    Name or description of the metric policy.
    operator String
    Operator used when comparing the threshold value of the chosen metric to the actual sampled and aggregated value.
    cockpitMetricName String
    The custom metric to use for this policy. This must be stored in Scaleway Cockpit. The metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered
    managedMetric String
    The managed metric to use for this policy. These are available by default in Cockpit without any configuration or node_exporter. The chosen metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered.
    samplingRangeMin Integer
    The Interval of time, in minutes, during which metric is sampled.
    threshold Integer
    The threshold value to measure the aggregated sampled metric value against. Combined with the operator field, determines whether a scaling action should be triggered.
    aggregate string
    How the values sampled for the metric should be aggregated.
    name string
    Name or description of the metric policy.
    operator string
    Operator used when comparing the threshold value of the chosen metric to the actual sampled and aggregated value.
    cockpitMetricName string
    The custom metric to use for this policy. This must be stored in Scaleway Cockpit. The metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered
    managedMetric string
    The managed metric to use for this policy. These are available by default in Cockpit without any configuration or node_exporter. The chosen metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered.
    samplingRangeMin number
    The Interval of time, in minutes, during which metric is sampled.
    threshold number
    The threshold value to measure the aggregated sampled metric value against. Combined with the operator field, determines whether a scaling action should be triggered.
    aggregate str
    How the values sampled for the metric should be aggregated.
    name str
    Name or description of the metric policy.
    operator str
    Operator used when comparing the threshold value of the chosen metric to the actual sampled and aggregated value.
    cockpit_metric_name str
    The custom metric to use for this policy. This must be stored in Scaleway Cockpit. The metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered
    managed_metric str
    The managed metric to use for this policy. These are available by default in Cockpit without any configuration or node_exporter. The chosen metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered.
    sampling_range_min int
    The Interval of time, in minutes, during which metric is sampled.
    threshold int
    The threshold value to measure the aggregated sampled metric value against. Combined with the operator field, determines whether a scaling action should be triggered.
    aggregate String
    How the values sampled for the metric should be aggregated.
    name String
    Name or description of the metric policy.
    operator String
    Operator used when comparing the threshold value of the chosen metric to the actual sampled and aggregated value.
    cockpitMetricName String
    The custom metric to use for this policy. This must be stored in Scaleway Cockpit. The metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered
    managedMetric String
    The managed metric to use for this policy. These are available by default in Cockpit without any configuration or node_exporter. The chosen metric forms the basis of the condition that will be checked to determine whether a scaling action should be triggered.
    samplingRangeMin Number
    The Interval of time, in minutes, during which metric is sampled.
    threshold Number
    The threshold value to measure the aggregated sampled metric value against. Combined with the operator field, determines whether a scaling action should be triggered.

    Import

    Autoscaling instance policies can be imported using {zone}/{id}, e.g.

    bash

    $ pulumi import scaleway:autoscaling/instancePolicy:InstancePolicy main fr-par-1/11111111-1111-1111-1111-111111111111
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.32.0 published on Friday, Aug 1, 2025 by pulumiverse