import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Represents an Autoscaler resource. * * Autoscalers allow you to automatically scale virtual machine instances in * managed instance groups according to an autoscaling policy that you * define. * * To get more information about RegionAutoscaler, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionAutoscalers) * * How-to Guides * * [Autoscaling Groups of Instances](https://cloud.google.com/compute/docs/autoscaler/) * * ## Example Usage * * ### Region Autoscaler Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const foobarInstanceTemplate = new gcp.compute.InstanceTemplate("foobar", { * name: "my-instance-template", * machineType: "e2-standard-4", * disks: [{ * sourceImage: "debian-cloud/debian-11", * diskSizeGb: 250, * }], * networkInterfaces: [{ * network: "default", * accessConfigs: [{ * networkTier: "PREMIUM", * }], * }], * serviceAccount: { * scopes: [ * "https://www.googleapis.com/auth/devstorage.read_only", * "https://www.googleapis.com/auth/logging.write", * "https://www.googleapis.com/auth/monitoring.write", * "https://www.googleapis.com/auth/pubsub", * "https://www.googleapis.com/auth/service.management.readonly", * "https://www.googleapis.com/auth/servicecontrol", * "https://www.googleapis.com/auth/trace.append", * ], * }, * }); * const foobarTargetPool = new gcp.compute.TargetPool("foobar", {name: "my-target-pool"}); * const foobarRegionInstanceGroupManager = new gcp.compute.RegionInstanceGroupManager("foobar", { * name: "my-region-igm", * region: "us-central1", * versions: [{ * instanceTemplate: foobarInstanceTemplate.id, * name: "primary", * }], * targetPools: [foobarTargetPool.id], * baseInstanceName: "foobar", * }); * const foobar = new gcp.compute.RegionAutoscaler("foobar", { * name: "my-region-autoscaler", * region: "us-central1", * target: foobarRegionInstanceGroupManager.id, * autoscalingPolicy: { * maxReplicas: 5, * minReplicas: 1, * cooldownPeriod: 60, * cpuUtilization: { * target: 0.5, * }, * }, * }); * const debian9 = gcp.compute.getImage({ * family: "debian-11", * project: "debian-cloud", * }); * ``` * * ## Import * * RegionAutoscaler can be imported using any of these accepted formats: * * * `projects/{{project}}/regions/{{region}}/autoscalers/{{name}}` * * `{{project}}/{{region}}/{{name}}` * * `{{region}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, RegionAutoscaler can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/regionAutoscaler:RegionAutoscaler default projects/{{project}}/regions/{{region}}/autoscalers/{{name}} * $ pulumi import gcp:compute/regionAutoscaler:RegionAutoscaler default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:compute/regionAutoscaler:RegionAutoscaler default {{region}}/{{name}} * $ pulumi import gcp:compute/regionAutoscaler:RegionAutoscaler default {{name}} * ``` */ export declare class RegionAutoscaler extends pulumi.CustomResource { /** * Get an existing RegionAutoscaler 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, state?: RegionAutoscalerState, opts?: pulumi.CustomResourceOptions): RegionAutoscaler; /** * Returns true if the given object is an instance of RegionAutoscaler. 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 RegionAutoscaler; /** * The configuration parameters for the autoscaling algorithm. You can * define one or more of the policies for an autoscaler: cpuUtilization, * customMetricUtilizations, and loadBalancingUtilization. * If none of these are specified, the default will be to autoscale based * on cpuUtilization to 0.6 or 60%. * Structure is documented below. */ readonly autoscalingPolicy: pulumi.Output; /** * Creation timestamp in RFC3339 text format. */ readonly creationTimestamp: pulumi.Output; /** * An optional description of this resource. */ readonly description: pulumi.Output; /** * Name of the resource. The name must be 1-63 characters long and match * the regular expression `a-z?` which means the * first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * URL of the region where the instance group resides. */ readonly region: pulumi.Output; /** * The URI of the created resource. */ readonly selfLink: pulumi.Output; /** * URL of the managed instance group that this autoscaler will scale. */ readonly target: pulumi.Output; /** * Create a RegionAutoscaler 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: RegionAutoscalerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RegionAutoscaler resources. */ export interface RegionAutoscalerState { /** * The configuration parameters for the autoscaling algorithm. You can * define one or more of the policies for an autoscaler: cpuUtilization, * customMetricUtilizations, and loadBalancingUtilization. * If none of these are specified, the default will be to autoscale based * on cpuUtilization to 0.6 or 60%. * Structure is documented below. */ autoscalingPolicy?: pulumi.Input; /** * Creation timestamp in RFC3339 text format. */ creationTimestamp?: pulumi.Input; /** * An optional description of this resource. */ description?: pulumi.Input; /** * Name of the resource. The name must be 1-63 characters long and match * the regular expression `a-z?` which means the * first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * URL of the region where the instance group resides. */ region?: pulumi.Input; /** * The URI of the created resource. */ selfLink?: pulumi.Input; /** * URL of the managed instance group that this autoscaler will scale. */ target?: pulumi.Input; } /** * The set of arguments for constructing a RegionAutoscaler resource. */ export interface RegionAutoscalerArgs { /** * The configuration parameters for the autoscaling algorithm. You can * define one or more of the policies for an autoscaler: cpuUtilization, * customMetricUtilizations, and loadBalancingUtilization. * If none of these are specified, the default will be to autoscale based * on cpuUtilization to 0.6 or 60%. * Structure is documented below. */ autoscalingPolicy: pulumi.Input; /** * An optional description of this resource. */ description?: pulumi.Input; /** * Name of the resource. The name must be 1-63 characters long and match * the regular expression `a-z?` which means the * first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * URL of the region where the instance group resides. */ region?: pulumi.Input; /** * URL of the managed instance group that this autoscaler will scale. */ target: pulumi.Input; }