1. Packages
  2. Volcengine
  3. API Docs
  4. autoscaling
  5. ScalingGroupEnabler
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.autoscaling.ScalingGroupEnabler

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

    Provides a resource to manage scaling group enabler

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        // 创建步骤:terraform init -> pulumi preview -> pulumi up
        // 删除步骤: terraform state rm volcengine_scaling_configuration.foo1 -> terraform destroy
        // 创建伸缩组
        var foo = new Volcengine.Autoscaling.ScalingGroup("foo", new()
        {
            ScalingGroupName = "zzm-tf-test",
            SubnetIds = new[]
            {
                "subnet-2fegl9waotzi859gp67relkhv",
            },
            MultiAzPolicy = "BALANCE",
            DesireInstanceNumber = 0,
            MinInstanceNumber = 0,
            MaxInstanceNumber = 1,
            InstanceTerminatePolicy = "OldestInstance",
            DefaultCooldown = 10,
        });
    
        // 创建伸缩配置
        var foo1 = new Volcengine.Autoscaling.ScalingConfiguration("foo1", new()
        {
            ScalingConfigurationName = "terraform-test",
            ScalingGroupId = foo.ScalingGroupId,
            ImageId = "image-ybx2d38wdfl8j1pupx7b",
            InstanceTypes = new[]
            {
                "ecs.g1.2xlarge",
            },
            InstanceName = "tf-test",
            InstanceDescription = "",
            HostName = "",
            Password = "",
            KeyPairName = "zktest",
            SecurityEnhancementStrategy = "InActive",
            Volumes = new[]
            {
                new Volcengine.Autoscaling.Inputs.ScalingConfigurationVolumeArgs
                {
                    VolumeType = "ESSD_PL0",
                    Size = 20,
                    DeleteWithInstance = false,
                },
                new Volcengine.Autoscaling.Inputs.ScalingConfigurationVolumeArgs
                {
                    VolumeType = "ESSD_PL0",
                    Size = 20,
                    DeleteWithInstance = true,
                },
            },
            SecurityGroupIds = new[]
            {
                "sg-12b8llnkn1la817q7y1be4kop",
            },
            EipBandwidth = 0,
            EipIsp = "ChinaMobile",
            EipBillingType = "PostPaidByBandwidth",
        });
    
        // 绑定伸缩配置
        var foo2 = new Volcengine.Autoscaling.ScalingConfigurationAttachment("foo2", new()
        {
            ScalingConfigurationId = foo1.ScalingConfigurationId,
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                foo1,
            },
        });
    
        // 启用伸缩组
        var foo3 = new Volcengine.Autoscaling.ScalingGroupEnabler("foo3", new()
        {
            ScalingGroupId = foo.ScalingGroupId,
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                foo2,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/autoscaling"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := autoscaling.NewScalingGroup(ctx, "foo", &autoscaling.ScalingGroupArgs{
    			ScalingGroupName: pulumi.String("zzm-tf-test"),
    			SubnetIds: pulumi.StringArray{
    				pulumi.String("subnet-2fegl9waotzi859gp67relkhv"),
    			},
    			MultiAzPolicy:           pulumi.String("BALANCE"),
    			DesireInstanceNumber:    pulumi.Int(0),
    			MinInstanceNumber:       pulumi.Int(0),
    			MaxInstanceNumber:       pulumi.Int(1),
    			InstanceTerminatePolicy: pulumi.String("OldestInstance"),
    			DefaultCooldown:         pulumi.Int(10),
    		})
    		if err != nil {
    			return err
    		}
    		foo1, err := autoscaling.NewScalingConfiguration(ctx, "foo1", &autoscaling.ScalingConfigurationArgs{
    			ScalingConfigurationName: pulumi.String("terraform-test"),
    			ScalingGroupId:           foo.ScalingGroupId,
    			ImageId:                  pulumi.String("image-ybx2d38wdfl8j1pupx7b"),
    			InstanceTypes: pulumi.StringArray{
    				pulumi.String("ecs.g1.2xlarge"),
    			},
    			InstanceName:                pulumi.String("tf-test"),
    			InstanceDescription:         pulumi.String(""),
    			HostName:                    pulumi.String(""),
    			Password:                    pulumi.String(""),
    			KeyPairName:                 pulumi.String("zktest"),
    			SecurityEnhancementStrategy: pulumi.String("InActive"),
    			Volumes: autoscaling.ScalingConfigurationVolumeArray{
    				&autoscaling.ScalingConfigurationVolumeArgs{
    					VolumeType:         pulumi.String("ESSD_PL0"),
    					Size:               pulumi.Int(20),
    					DeleteWithInstance: pulumi.Bool(false),
    				},
    				&autoscaling.ScalingConfigurationVolumeArgs{
    					VolumeType:         pulumi.String("ESSD_PL0"),
    					Size:               pulumi.Int(20),
    					DeleteWithInstance: pulumi.Bool(true),
    				},
    			},
    			SecurityGroupIds: pulumi.StringArray{
    				pulumi.String("sg-12b8llnkn1la817q7y1be4kop"),
    			},
    			EipBandwidth:   pulumi.Int(0),
    			EipIsp:         pulumi.String("ChinaMobile"),
    			EipBillingType: pulumi.String("PostPaidByBandwidth"),
    		})
    		if err != nil {
    			return err
    		}
    		foo2, err := autoscaling.NewScalingConfigurationAttachment(ctx, "foo2", &autoscaling.ScalingConfigurationAttachmentArgs{
    			ScalingConfigurationId: foo1.ScalingConfigurationId,
    		}, pulumi.DependsOn([]pulumi.Resource{
    			foo1,
    		}))
    		if err != nil {
    			return err
    		}
    		_, err = autoscaling.NewScalingGroupEnabler(ctx, "foo3", &autoscaling.ScalingGroupEnablerArgs{
    			ScalingGroupId: foo.ScalingGroupId,
    		}, pulumi.DependsOn([]pulumi.Resource{
    			foo2,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.autoscaling.ScalingGroup;
    import com.pulumi.volcengine.autoscaling.ScalingGroupArgs;
    import com.pulumi.volcengine.autoscaling.ScalingConfiguration;
    import com.pulumi.volcengine.autoscaling.ScalingConfigurationArgs;
    import com.pulumi.volcengine.autoscaling.inputs.ScalingConfigurationVolumeArgs;
    import com.pulumi.volcengine.autoscaling.ScalingConfigurationAttachment;
    import com.pulumi.volcengine.autoscaling.ScalingConfigurationAttachmentArgs;
    import com.pulumi.volcengine.autoscaling.ScalingGroupEnabler;
    import com.pulumi.volcengine.autoscaling.ScalingGroupEnablerArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 foo = new ScalingGroup("foo", ScalingGroupArgs.builder()        
                .scalingGroupName("zzm-tf-test")
                .subnetIds("subnet-2fegl9waotzi859gp67relkhv")
                .multiAzPolicy("BALANCE")
                .desireInstanceNumber(0)
                .minInstanceNumber(0)
                .maxInstanceNumber(1)
                .instanceTerminatePolicy("OldestInstance")
                .defaultCooldown(10)
                .build());
    
            var foo1 = new ScalingConfiguration("foo1", ScalingConfigurationArgs.builder()        
                .scalingConfigurationName("terraform-test")
                .scalingGroupId(foo.scalingGroupId())
                .imageId("image-ybx2d38wdfl8j1pupx7b")
                .instanceTypes("ecs.g1.2xlarge")
                .instanceName("tf-test")
                .instanceDescription("")
                .hostName("")
                .password("")
                .keyPairName("zktest")
                .securityEnhancementStrategy("InActive")
                .volumes(            
                    ScalingConfigurationVolumeArgs.builder()
                        .volumeType("ESSD_PL0")
                        .size(20)
                        .deleteWithInstance(false)
                        .build(),
                    ScalingConfigurationVolumeArgs.builder()
                        .volumeType("ESSD_PL0")
                        .size(20)
                        .deleteWithInstance(true)
                        .build())
                .securityGroupIds("sg-12b8llnkn1la817q7y1be4kop")
                .eipBandwidth(0)
                .eipIsp("ChinaMobile")
                .eipBillingType("PostPaidByBandwidth")
                .build());
    
            var foo2 = new ScalingConfigurationAttachment("foo2", ScalingConfigurationAttachmentArgs.builder()        
                .scalingConfigurationId(foo1.scalingConfigurationId())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(foo1)
                    .build());
    
            var foo3 = new ScalingGroupEnabler("foo3", ScalingGroupEnablerArgs.builder()        
                .scalingGroupId(foo.scalingGroupId())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(foo2)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    # 创建步骤:terraform init -> pulumi preview -> pulumi up
    # 删除步骤: terraform state rm volcengine_scaling_configuration.foo1 -> terraform destroy
    # 创建伸缩组
    foo = volcengine.autoscaling.ScalingGroup("foo",
        scaling_group_name="zzm-tf-test",
        subnet_ids=["subnet-2fegl9waotzi859gp67relkhv"],
        multi_az_policy="BALANCE",
        desire_instance_number=0,
        min_instance_number=0,
        max_instance_number=1,
        instance_terminate_policy="OldestInstance",
        default_cooldown=10)
    # 创建伸缩配置
    foo1 = volcengine.autoscaling.ScalingConfiguration("foo1",
        scaling_configuration_name="terraform-test",
        scaling_group_id=foo.scaling_group_id,
        image_id="image-ybx2d38wdfl8j1pupx7b",
        instance_types=["ecs.g1.2xlarge"],
        instance_name="tf-test",
        instance_description="",
        host_name="",
        password="",
        key_pair_name="zktest",
        security_enhancement_strategy="InActive",
        volumes=[
            volcengine.autoscaling.ScalingConfigurationVolumeArgs(
                volume_type="ESSD_PL0",
                size=20,
                delete_with_instance=False,
            ),
            volcengine.autoscaling.ScalingConfigurationVolumeArgs(
                volume_type="ESSD_PL0",
                size=20,
                delete_with_instance=True,
            ),
        ],
        security_group_ids=["sg-12b8llnkn1la817q7y1be4kop"],
        eip_bandwidth=0,
        eip_isp="ChinaMobile",
        eip_billing_type="PostPaidByBandwidth")
    # 绑定伸缩配置
    foo2 = volcengine.autoscaling.ScalingConfigurationAttachment("foo2", scaling_configuration_id=foo1.scaling_configuration_id,
    opts=pulumi.ResourceOptions(depends_on=[foo1]))
    # 启用伸缩组
    foo3 = volcengine.autoscaling.ScalingGroupEnabler("foo3", scaling_group_id=foo.scaling_group_id,
    opts=pulumi.ResourceOptions(depends_on=[foo2]))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    // 创建步骤:terraform init -> pulumi preview -> pulumi up
    // 删除步骤: terraform state rm volcengine_scaling_configuration.foo1 -> terraform destroy
    // 创建伸缩组
    const foo = new volcengine.autoscaling.ScalingGroup("foo", {
        scalingGroupName: "zzm-tf-test",
        subnetIds: ["subnet-2fegl9waotzi859gp67relkhv"],
        multiAzPolicy: "BALANCE",
        desireInstanceNumber: 0,
        minInstanceNumber: 0,
        maxInstanceNumber: 1,
        instanceTerminatePolicy: "OldestInstance",
        defaultCooldown: 10,
    });
    // 创建伸缩配置
    const foo1 = new volcengine.autoscaling.ScalingConfiguration("foo1", {
        scalingConfigurationName: "terraform-test",
        scalingGroupId: foo.scalingGroupId,
        imageId: "image-ybx2d38wdfl8j1pupx7b",
        instanceTypes: ["ecs.g1.2xlarge"],
        instanceName: "tf-test",
        instanceDescription: "",
        hostName: "",
        password: "",
        keyPairName: "zktest",
        securityEnhancementStrategy: "InActive",
        volumes: [
            {
                volumeType: "ESSD_PL0",
                size: 20,
                deleteWithInstance: false,
            },
            {
                volumeType: "ESSD_PL0",
                size: 20,
                deleteWithInstance: true,
            },
        ],
        securityGroupIds: ["sg-12b8llnkn1la817q7y1be4kop"],
        eipBandwidth: 0,
        eipIsp: "ChinaMobile",
        eipBillingType: "PostPaidByBandwidth",
    });
    // 绑定伸缩配置
    const foo2 = new volcengine.autoscaling.ScalingConfigurationAttachment("foo2", {scalingConfigurationId: foo1.scalingConfigurationId}, {
        dependsOn: [foo1],
    });
    // 启用伸缩组
    const foo3 = new volcengine.autoscaling.ScalingGroupEnabler("foo3", {scalingGroupId: foo.scalingGroupId}, {
        dependsOn: [foo2],
    });
    
    resources:
      # 创建步骤:terraform init -> pulumi preview -> pulumi up
      # // 删除步骤: terraform state rm volcengine_scaling_configuration.foo1 -> terraform destroy
    
      # // 创建伸缩组
      foo:
        type: volcengine:autoscaling:ScalingGroup
        properties:
          scalingGroupName: zzm-tf-test
          subnetIds:
            - subnet-2fegl9waotzi859gp67relkhv
          multiAzPolicy: BALANCE
          desireInstanceNumber: 0
          minInstanceNumber: 0
          maxInstanceNumber: 1
          instanceTerminatePolicy: OldestInstance
          defaultCooldown: 10
      # 创建伸缩配置
      foo1:
        type: volcengine:autoscaling:ScalingConfiguration
        properties:
          scalingConfigurationName: terraform-test
          scalingGroupId: ${foo.scalingGroupId}
          imageId: image-ybx2d38wdfl8j1pupx7b
          instanceTypes:
            - ecs.g1.2xlarge
          instanceName: tf-test
          instanceDescription:
          hostName:
          password:
          keyPairName: zktest
          securityEnhancementStrategy: InActive
          volumes:
            - volumeType: ESSD_PL0
              size: 20
              deleteWithInstance: false
            - volumeType: ESSD_PL0
              size: 20
              deleteWithInstance: true
          securityGroupIds:
            - sg-12b8llnkn1la817q7y1be4kop
          eipBandwidth: 0
          eipIsp: ChinaMobile
          eipBillingType: PostPaidByBandwidth
      # 绑定伸缩配置
      foo2:
        type: volcengine:autoscaling:ScalingConfigurationAttachment
        properties:
          scalingConfigurationId: ${foo1.scalingConfigurationId}
        options:
          dependson:
            - ${foo1}
      # 启用伸缩组
      foo3:
        type: volcengine:autoscaling:ScalingGroupEnabler
        properties:
          scalingGroupId: ${foo.scalingGroupId}
        options:
          dependson:
            - ${foo2}
    

    Create ScalingGroupEnabler Resource

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

    Constructor syntax

    new ScalingGroupEnabler(name: string, args: ScalingGroupEnablerArgs, opts?: CustomResourceOptions);
    @overload
    def ScalingGroupEnabler(resource_name: str,
                            args: ScalingGroupEnablerArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def ScalingGroupEnabler(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            scaling_group_id: Optional[str] = None)
    func NewScalingGroupEnabler(ctx *Context, name string, args ScalingGroupEnablerArgs, opts ...ResourceOption) (*ScalingGroupEnabler, error)
    public ScalingGroupEnabler(string name, ScalingGroupEnablerArgs args, CustomResourceOptions? opts = null)
    public ScalingGroupEnabler(String name, ScalingGroupEnablerArgs args)
    public ScalingGroupEnabler(String name, ScalingGroupEnablerArgs args, CustomResourceOptions options)
    
    type: volcengine:autoscaling:ScalingGroupEnabler
    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 ScalingGroupEnablerArgs
    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 ScalingGroupEnablerArgs
    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 ScalingGroupEnablerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ScalingGroupEnablerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ScalingGroupEnablerArgs
    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 scalingGroupEnablerResource = new Volcengine.Autoscaling.ScalingGroupEnabler("scalingGroupEnablerResource", new()
    {
        ScalingGroupId = "string",
    });
    
    example, err := autoscaling.NewScalingGroupEnabler(ctx, "scalingGroupEnablerResource", &autoscaling.ScalingGroupEnablerArgs{
    	ScalingGroupId: pulumi.String("string"),
    })
    
    var scalingGroupEnablerResource = new ScalingGroupEnabler("scalingGroupEnablerResource", ScalingGroupEnablerArgs.builder()
        .scalingGroupId("string")
        .build());
    
    scaling_group_enabler_resource = volcengine.autoscaling.ScalingGroupEnabler("scalingGroupEnablerResource", scaling_group_id="string")
    
    const scalingGroupEnablerResource = new volcengine.autoscaling.ScalingGroupEnabler("scalingGroupEnablerResource", {scalingGroupId: "string"});
    
    type: volcengine:autoscaling:ScalingGroupEnabler
    properties:
        scalingGroupId: string
    

    ScalingGroupEnabler 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 ScalingGroupEnabler resource accepts the following input properties:

    ScalingGroupId string
    The id of the scaling group.
    ScalingGroupId string
    The id of the scaling group.
    scalingGroupId String
    The id of the scaling group.
    scalingGroupId string
    The id of the scaling group.
    scaling_group_id str
    The id of the scaling group.
    scalingGroupId String
    The id of the scaling group.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ScalingGroupEnabler 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 ScalingGroupEnabler Resource

    Get an existing ScalingGroupEnabler 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?: ScalingGroupEnablerState, opts?: CustomResourceOptions): ScalingGroupEnabler
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            scaling_group_id: Optional[str] = None) -> ScalingGroupEnabler
    func GetScalingGroupEnabler(ctx *Context, name string, id IDInput, state *ScalingGroupEnablerState, opts ...ResourceOption) (*ScalingGroupEnabler, error)
    public static ScalingGroupEnabler Get(string name, Input<string> id, ScalingGroupEnablerState? state, CustomResourceOptions? opts = null)
    public static ScalingGroupEnabler get(String name, Output<String> id, ScalingGroupEnablerState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    ScalingGroupId string
    The id of the scaling group.
    ScalingGroupId string
    The id of the scaling group.
    scalingGroupId String
    The id of the scaling group.
    scalingGroupId string
    The id of the scaling group.
    scaling_group_id str
    The id of the scaling group.
    scalingGroupId String
    The id of the scaling group.

    Import

    Scaling Group enabler can be imported using the scaling_group_id, e.g.

     $ pulumi import volcengine:autoscaling/scalingGroupEnabler:ScalingGroupEnabler default enable:scg-mizl7m1kqccg5smt1bdpijuj
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine