@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
296 lines • 10.5 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Books and manages Autoscaling Instance groups.
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.autoscaling.InstanceGroup("main", {
* name: "asg-group",
* templateId: mainScalewayAutoscalingInstanceTemplate.id,
* tags: [
* "terraform-test",
* "instance-group",
* ],
* capacities: [{
* maxReplicas: 5,
* minReplicas: 1,
* cooldownDelay: 300,
* }],
* loadBalancers: [{
* id: mainScalewayLb.id,
* backendIds: [mainScalewayLbBackend.id],
* privateNetworkId: mainScalewayVpcPrivateNetwork.id,
* }],
* });
* ```
*
* ### With template and policies
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.network.Vpc("main", {name: "TestAccAutoscalingVPC"});
* const mainPrivateNetwork = new scaleway.network.PrivateNetwork("main", {
* name: "TestAccAutoscalingVPC",
* vpcId: main.id,
* });
* const mainVolume = new scaleway.block.Volume("main", {
* iops: 5000,
* sizeInGb: 10,
* });
* const mainSnapshot = new scaleway.block.Snapshot("main", {
* name: "test-ds-block-snapshot-basic",
* volumeId: mainVolume.id,
* });
* const mainIp = new scaleway.loadbalancers.Ip("main", {});
* const mainLoadBalancer = new scaleway.loadbalancers.LoadBalancer("main", {
* ipId: mainIp.id,
* name: "test-lb",
* type: "lb-s",
* privateNetworks: [{
* privateNetworkId: mainPrivateNetwork.id,
* }],
* });
* const mainBackend = new scaleway.loadbalancers.Backend("main", {
* lbId: mainLoadBalancer.id,
* forwardProtocol: "tcp",
* forwardPort: 80,
* proxyProtocol: "none",
* });
* const mainInstanceTemplate = new scaleway.autoscaling.InstanceTemplate("main", {
* name: "autoscaling-instance-template-basic",
* commercialType: "PLAY2-MICRO",
* tags: [
* "terraform-test",
* "basic",
* ],
* volumes: [{
* name: "as-volume",
* volumeType: "sbs",
* boot: true,
* fromSnapshot: {
* snapshotId: mainSnapshot.id,
* },
* perfIops: 5000,
* }],
* publicIpsV4Count: 1,
* privateNetworkIds: [mainPrivateNetwork.id],
* });
* const mainInstanceGroup = new scaleway.autoscaling.InstanceGroup("main", {
* name: "autoscaling-instance-group-basic",
* templateId: mainInstanceTemplate.id,
* tags: [
* "terraform-test",
* "instance-group",
* ],
* capacities: [{
* maxReplicas: 5,
* minReplicas: 1,
* cooldownDelay: 300,
* }],
* loadBalancers: [{
* id: mainLoadBalancer.id,
* backendIds: [mainBackend.id],
* privateNetworkId: mainPrivateNetwork.id,
* }],
* deleteServersOnDestroy: true,
* });
* const up = new scaleway.autoscaling.InstancePolicy("up", {
* instanceGroupId: mainInstanceGroup.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: mainInstanceGroup.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 groups can be imported using `{zone}/{id}`, e.g.
*
* ```sh
* $ pulumi import scaleway:autoscaling/instanceGroup:InstanceGroup main fr-par-1/11111111-1111-1111-1111-111111111111
* ```
*/
export declare class InstanceGroup extends pulumi.CustomResource {
/**
* Get an existing InstanceGroup 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?: InstanceGroupState, opts?: pulumi.CustomResourceOptions): InstanceGroup;
/**
* Returns true if the given object is an instance of InstanceGroup. 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 InstanceGroup;
/**
* The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
*/
readonly capacities: pulumi.Output<outputs.autoscaling.InstanceGroupCapacity[]>;
/**
* Date and time of Instance group's creation (RFC 3339 format).
*/
readonly createdAt: pulumi.Output<string>;
/**
* Whether to delete all instances in this group when the group is destroyed. Set to `true` to tear them down, `false` (the default) leaves them running.
*/
readonly deleteServersOnDestroy: pulumi.Output<boolean | undefined>;
/**
* The specification of the Load Balancer to link to the Instance group.
*/
readonly loadBalancers: pulumi.Output<outputs.autoscaling.InstanceGroupLoadBalancer[]>;
/**
* The Instance group name.
*/
readonly name: pulumi.Output<string>;
/**
* `projectId`) The ID of the Project the Instance group is associated with.
*/
readonly projectId: pulumi.Output<string>;
/**
* The tags associated with the Instance group.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* The ID of the Instance template to attach to the Instance group.
*/
readonly templateId: pulumi.Output<string>;
/**
* Date and time of Instance group's last update (RFC 3339 format).
*/
readonly updatedAt: pulumi.Output<string>;
/**
* `zone`) The zone in which the Instance group exists.
*/
readonly zone: pulumi.Output<string | undefined>;
/**
* Create a InstanceGroup 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: InstanceGroupArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering InstanceGroup resources.
*/
export interface InstanceGroupState {
/**
* The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
*/
capacities?: pulumi.Input<pulumi.Input<inputs.autoscaling.InstanceGroupCapacity>[] | undefined>;
/**
* Date and time of Instance group's creation (RFC 3339 format).
*/
createdAt?: pulumi.Input<string | undefined>;
/**
* Whether to delete all instances in this group when the group is destroyed. Set to `true` to tear them down, `false` (the default) leaves them running.
*/
deleteServersOnDestroy?: pulumi.Input<boolean | undefined>;
/**
* The specification of the Load Balancer to link to the Instance group.
*/
loadBalancers?: pulumi.Input<pulumi.Input<inputs.autoscaling.InstanceGroupLoadBalancer>[] | undefined>;
/**
* The Instance group name.
*/
name?: pulumi.Input<string | undefined>;
/**
* `projectId`) The ID of the Project the Instance group is associated with.
*/
projectId?: pulumi.Input<string | undefined>;
/**
* The tags associated with the Instance group.
*/
tags?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The ID of the Instance template to attach to the Instance group.
*/
templateId?: pulumi.Input<string | undefined>;
/**
* Date and time of Instance group's last update (RFC 3339 format).
*/
updatedAt?: pulumi.Input<string | undefined>;
/**
* `zone`) The zone in which the Instance group exists.
*/
zone?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a InstanceGroup resource.
*/
export interface InstanceGroupArgs {
/**
* The specification of the minimum and maximum replicas for the Instance group, and the cooldown interval between two scaling events.
*/
capacities?: pulumi.Input<pulumi.Input<inputs.autoscaling.InstanceGroupCapacity>[] | undefined>;
/**
* Whether to delete all instances in this group when the group is destroyed. Set to `true` to tear them down, `false` (the default) leaves them running.
*/
deleteServersOnDestroy?: pulumi.Input<boolean | undefined>;
/**
* The specification of the Load Balancer to link to the Instance group.
*/
loadBalancers?: pulumi.Input<pulumi.Input<inputs.autoscaling.InstanceGroupLoadBalancer>[] | undefined>;
/**
* The Instance group name.
*/
name?: pulumi.Input<string | undefined>;
/**
* `projectId`) The ID of the Project the Instance group is associated with.
*/
projectId?: pulumi.Input<string | undefined>;
/**
* The tags associated with the Instance group.
*/
tags?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The ID of the Instance template to attach to the Instance group.
*/
templateId: pulumi.Input<string>;
/**
* `zone`) The zone in which the Instance group exists.
*/
zone?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=instanceGroup.d.ts.map