1. Packages
  2. Volcengine
  3. API Docs
  4. autoscaling
  5. ScalingInstanceAttachment
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.autoscaling.ScalingInstanceAttachment

Explore with Pulumi AI

Provides a resource to manage scaling instance attachment

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";

const fooZones = volcengine.ecs.Zones({});
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
    vpcName: "acc-test-vpc",
    cidrBlock: "172.16.0.0/16",
});
const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
    subnetName: "acc-test-subnet",
    cidrBlock: "172.16.0.0/24",
    zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
    vpcId: fooVpc.id,
});
const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
    securityGroupName: "acc-test-security-group",
    vpcId: fooVpc.id,
});
const fooImages = volcengine.ecs.Images({
    osType: "Linux",
    visibility: "public",
    instanceTypeId: "ecs.g1.large",
});
const fooKeyPair = new volcengine.ecs.KeyPair("fooKeyPair", {
    description: "acc-test-2",
    keyPairName: "acc-test-key-pair-name",
});
const fooLaunchTemplate = new volcengine.ecs.LaunchTemplate("fooLaunchTemplate", {
    description: "acc-test-desc",
    eipBandwidth: 200,
    eipBillingType: "PostPaidByBandwidth",
    eipIsp: "BGP",
    hostName: "acc-hostname",
    imageId: fooImages.then(fooImages => fooImages.images?.[0]?.imageId),
    instanceChargeType: "PostPaid",
    instanceName: "acc-instance-name",
    instanceTypeId: "ecs.g1.large",
    keyPairName: fooKeyPair.keyPairName,
    launchTemplateName: "acc-test-template",
    networkInterfaces: [{
        subnetId: fooSubnet.id,
        securityGroupIds: [fooSecurityGroup.id],
    }],
    volumes: [{
        volumeType: "ESSD_PL0",
        size: 50,
        deleteWithInstance: true,
    }],
});
const fooScalingGroup = new volcengine.autoscaling.ScalingGroup("fooScalingGroup", {
    scalingGroupName: "acc-test-scaling-group",
    subnetIds: [fooSubnet.id],
    multiAzPolicy: "BALANCE",
    desireInstanceNumber: -1,
    minInstanceNumber: 0,
    maxInstanceNumber: 1,
    instanceTerminatePolicy: "OldestInstance",
    defaultCooldown: 10,
    launchTemplateId: fooLaunchTemplate.id,
    launchTemplateVersion: "Default",
});
const fooScalingGroupEnabler = new volcengine.autoscaling.ScalingGroupEnabler("fooScalingGroupEnabler", {scalingGroupId: fooScalingGroup.id});
const fooInstance = new volcengine.ecs.Instance("fooInstance", {
    instanceName: "acc-test-ecs",
    description: "acc-test",
    hostName: "tf-acc-test",
    imageId: fooImages.then(fooImages => fooImages.images?.[0]?.imageId),
    instanceType: "ecs.g1.large",
    password: "93f0cb0614Aab12",
    instanceChargeType: "PostPaid",
    systemVolumeType: "ESSD_PL0",
    systemVolumeSize: 40,
    subnetId: fooSubnet.id,
    securityGroupIds: [fooSecurityGroup.id],
});
const fooScalingInstanceAttachment = new volcengine.autoscaling.ScalingInstanceAttachment("fooScalingInstanceAttachment", {
    instanceId: fooInstance.id,
    scalingGroupId: fooScalingGroup.id,
    entrusted: true,
}, {
    dependsOn: [fooScalingGroupEnabler],
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo_zones = volcengine.ecs.zones()
foo_vpc = volcengine.vpc.Vpc("fooVpc",
    vpc_name="acc-test-vpc",
    cidr_block="172.16.0.0/16")
foo_subnet = volcengine.vpc.Subnet("fooSubnet",
    subnet_name="acc-test-subnet",
    cidr_block="172.16.0.0/24",
    zone_id=foo_zones.zones[0].id,
    vpc_id=foo_vpc.id)
foo_security_group = volcengine.vpc.SecurityGroup("fooSecurityGroup",
    security_group_name="acc-test-security-group",
    vpc_id=foo_vpc.id)
foo_images = volcengine.ecs.images(os_type="Linux",
    visibility="public",
    instance_type_id="ecs.g1.large")
foo_key_pair = volcengine.ecs.KeyPair("fooKeyPair",
    description="acc-test-2",
    key_pair_name="acc-test-key-pair-name")
foo_launch_template = volcengine.ecs.LaunchTemplate("fooLaunchTemplate",
    description="acc-test-desc",
    eip_bandwidth=200,
    eip_billing_type="PostPaidByBandwidth",
    eip_isp="BGP",
    host_name="acc-hostname",
    image_id=foo_images.images[0].image_id,
    instance_charge_type="PostPaid",
    instance_name="acc-instance-name",
    instance_type_id="ecs.g1.large",
    key_pair_name=foo_key_pair.key_pair_name,
    launch_template_name="acc-test-template",
    network_interfaces=[volcengine.ecs.LaunchTemplateNetworkInterfaceArgs(
        subnet_id=foo_subnet.id,
        security_group_ids=[foo_security_group.id],
    )],
    volumes=[volcengine.ecs.LaunchTemplateVolumeArgs(
        volume_type="ESSD_PL0",
        size=50,
        delete_with_instance=True,
    )])
foo_scaling_group = volcengine.autoscaling.ScalingGroup("fooScalingGroup",
    scaling_group_name="acc-test-scaling-group",
    subnet_ids=[foo_subnet.id],
    multi_az_policy="BALANCE",
    desire_instance_number=-1,
    min_instance_number=0,
    max_instance_number=1,
    instance_terminate_policy="OldestInstance",
    default_cooldown=10,
    launch_template_id=foo_launch_template.id,
    launch_template_version="Default")
foo_scaling_group_enabler = volcengine.autoscaling.ScalingGroupEnabler("fooScalingGroupEnabler", scaling_group_id=foo_scaling_group.id)
foo_instance = volcengine.ecs.Instance("fooInstance",
    instance_name="acc-test-ecs",
    description="acc-test",
    host_name="tf-acc-test",
    image_id=foo_images.images[0].image_id,
    instance_type="ecs.g1.large",
    password="93f0cb0614Aab12",
    instance_charge_type="PostPaid",
    system_volume_type="ESSD_PL0",
    system_volume_size=40,
    subnet_id=foo_subnet.id,
    security_group_ids=[foo_security_group.id])
foo_scaling_instance_attachment = volcengine.autoscaling.ScalingInstanceAttachment("fooScalingInstanceAttachment",
    instance_id=foo_instance.id,
    scaling_group_id=foo_scaling_group.id,
    entrusted=True,
    opts=pulumi.ResourceOptions(depends_on=[foo_scaling_group_enabler]))
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/autoscaling"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooZones, err := ecs.Zones(ctx, nil, nil)
		if err != nil {
			return err
		}
		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
			VpcName:   pulumi.String("acc-test-vpc"),
			CidrBlock: pulumi.String("172.16.0.0/16"),
		})
		if err != nil {
			return err
		}
		fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
			SubnetName: pulumi.String("acc-test-subnet"),
			CidrBlock:  pulumi.String("172.16.0.0/24"),
			ZoneId:     pulumi.String(fooZones.Zones[0].Id),
			VpcId:      fooVpc.ID(),
		})
		if err != nil {
			return err
		}
		fooSecurityGroup, err := vpc.NewSecurityGroup(ctx, "fooSecurityGroup", &vpc.SecurityGroupArgs{
			SecurityGroupName: pulumi.String("acc-test-security-group"),
			VpcId:             fooVpc.ID(),
		})
		if err != nil {
			return err
		}
		fooImages, err := ecs.Images(ctx, &ecs.ImagesArgs{
			OsType:         pulumi.StringRef("Linux"),
			Visibility:     pulumi.StringRef("public"),
			InstanceTypeId: pulumi.StringRef("ecs.g1.large"),
		}, nil)
		if err != nil {
			return err
		}
		fooKeyPair, err := ecs.NewKeyPair(ctx, "fooKeyPair", &ecs.KeyPairArgs{
			Description: pulumi.String("acc-test-2"),
			KeyPairName: pulumi.String("acc-test-key-pair-name"),
		})
		if err != nil {
			return err
		}
		fooLaunchTemplate, err := ecs.NewLaunchTemplate(ctx, "fooLaunchTemplate", &ecs.LaunchTemplateArgs{
			Description:        pulumi.String("acc-test-desc"),
			EipBandwidth:       pulumi.Int(200),
			EipBillingType:     pulumi.String("PostPaidByBandwidth"),
			EipIsp:             pulumi.String("BGP"),
			HostName:           pulumi.String("acc-hostname"),
			ImageId:            pulumi.String(fooImages.Images[0].ImageId),
			InstanceChargeType: pulumi.String("PostPaid"),
			InstanceName:       pulumi.String("acc-instance-name"),
			InstanceTypeId:     pulumi.String("ecs.g1.large"),
			KeyPairName:        fooKeyPair.KeyPairName,
			LaunchTemplateName: pulumi.String("acc-test-template"),
			NetworkInterfaces: ecs.LaunchTemplateNetworkInterfaceArray{
				&ecs.LaunchTemplateNetworkInterfaceArgs{
					SubnetId: fooSubnet.ID(),
					SecurityGroupIds: pulumi.StringArray{
						fooSecurityGroup.ID(),
					},
				},
			},
			Volumes: ecs.LaunchTemplateVolumeArray{
				&ecs.LaunchTemplateVolumeArgs{
					VolumeType:         pulumi.String("ESSD_PL0"),
					Size:               pulumi.Int(50),
					DeleteWithInstance: pulumi.Bool(true),
				},
			},
		})
		if err != nil {
			return err
		}
		fooScalingGroup, err := autoscaling.NewScalingGroup(ctx, "fooScalingGroup", &autoscaling.ScalingGroupArgs{
			ScalingGroupName: pulumi.String("acc-test-scaling-group"),
			SubnetIds: pulumi.StringArray{
				fooSubnet.ID(),
			},
			MultiAzPolicy:           pulumi.String("BALANCE"),
			DesireInstanceNumber:    -1,
			MinInstanceNumber:       pulumi.Int(0),
			MaxInstanceNumber:       pulumi.Int(1),
			InstanceTerminatePolicy: pulumi.String("OldestInstance"),
			DefaultCooldown:         pulumi.Int(10),
			LaunchTemplateId:        fooLaunchTemplate.ID(),
			LaunchTemplateVersion:   pulumi.String("Default"),
		})
		if err != nil {
			return err
		}
		fooScalingGroupEnabler, err := autoscaling.NewScalingGroupEnabler(ctx, "fooScalingGroupEnabler", &autoscaling.ScalingGroupEnablerArgs{
			ScalingGroupId: fooScalingGroup.ID(),
		})
		if err != nil {
			return err
		}
		fooInstance, err := ecs.NewInstance(ctx, "fooInstance", &ecs.InstanceArgs{
			InstanceName:       pulumi.String("acc-test-ecs"),
			Description:        pulumi.String("acc-test"),
			HostName:           pulumi.String("tf-acc-test"),
			ImageId:            pulumi.String(fooImages.Images[0].ImageId),
			InstanceType:       pulumi.String("ecs.g1.large"),
			Password:           pulumi.String("93f0cb0614Aab12"),
			InstanceChargeType: pulumi.String("PostPaid"),
			SystemVolumeType:   pulumi.String("ESSD_PL0"),
			SystemVolumeSize:   pulumi.Int(40),
			SubnetId:           fooSubnet.ID(),
			SecurityGroupIds: pulumi.StringArray{
				fooSecurityGroup.ID(),
			},
		})
		if err != nil {
			return err
		}
		_, err = autoscaling.NewScalingInstanceAttachment(ctx, "fooScalingInstanceAttachment", &autoscaling.ScalingInstanceAttachmentArgs{
			InstanceId:     fooInstance.ID(),
			ScalingGroupId: fooScalingGroup.ID(),
			Entrusted:      pulumi.Bool(true),
		}, pulumi.DependsOn([]pulumi.Resource{
			fooScalingGroupEnabler,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var fooZones = Volcengine.Ecs.Zones.Invoke();

    var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
    {
        VpcName = "acc-test-vpc",
        CidrBlock = "172.16.0.0/16",
    });

    var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
    {
        SubnetName = "acc-test-subnet",
        CidrBlock = "172.16.0.0/24",
        ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
        VpcId = fooVpc.Id,
    });

    var fooSecurityGroup = new Volcengine.Vpc.SecurityGroup("fooSecurityGroup", new()
    {
        SecurityGroupName = "acc-test-security-group",
        VpcId = fooVpc.Id,
    });

    var fooImages = Volcengine.Ecs.Images.Invoke(new()
    {
        OsType = "Linux",
        Visibility = "public",
        InstanceTypeId = "ecs.g1.large",
    });

    var fooKeyPair = new Volcengine.Ecs.KeyPair("fooKeyPair", new()
    {
        Description = "acc-test-2",
        KeyPairName = "acc-test-key-pair-name",
    });

    var fooLaunchTemplate = new Volcengine.Ecs.LaunchTemplate("fooLaunchTemplate", new()
    {
        Description = "acc-test-desc",
        EipBandwidth = 200,
        EipBillingType = "PostPaidByBandwidth",
        EipIsp = "BGP",
        HostName = "acc-hostname",
        ImageId = fooImages.Apply(imagesResult => imagesResult.Images[0]?.ImageId),
        InstanceChargeType = "PostPaid",
        InstanceName = "acc-instance-name",
        InstanceTypeId = "ecs.g1.large",
        KeyPairName = fooKeyPair.KeyPairName,
        LaunchTemplateName = "acc-test-template",
        NetworkInterfaces = new[]
        {
            new Volcengine.Ecs.Inputs.LaunchTemplateNetworkInterfaceArgs
            {
                SubnetId = fooSubnet.Id,
                SecurityGroupIds = new[]
                {
                    fooSecurityGroup.Id,
                },
            },
        },
        Volumes = new[]
        {
            new Volcengine.Ecs.Inputs.LaunchTemplateVolumeArgs
            {
                VolumeType = "ESSD_PL0",
                Size = 50,
                DeleteWithInstance = true,
            },
        },
    });

    var fooScalingGroup = new Volcengine.Autoscaling.ScalingGroup("fooScalingGroup", new()
    {
        ScalingGroupName = "acc-test-scaling-group",
        SubnetIds = new[]
        {
            fooSubnet.Id,
        },
        MultiAzPolicy = "BALANCE",
        DesireInstanceNumber = -1,
        MinInstanceNumber = 0,
        MaxInstanceNumber = 1,
        InstanceTerminatePolicy = "OldestInstance",
        DefaultCooldown = 10,
        LaunchTemplateId = fooLaunchTemplate.Id,
        LaunchTemplateVersion = "Default",
    });

    var fooScalingGroupEnabler = new Volcengine.Autoscaling.ScalingGroupEnabler("fooScalingGroupEnabler", new()
    {
        ScalingGroupId = fooScalingGroup.Id,
    });

    var fooInstance = new Volcengine.Ecs.Instance("fooInstance", new()
    {
        InstanceName = "acc-test-ecs",
        Description = "acc-test",
        HostName = "tf-acc-test",
        ImageId = fooImages.Apply(imagesResult => imagesResult.Images[0]?.ImageId),
        InstanceType = "ecs.g1.large",
        Password = "93f0cb0614Aab12",
        InstanceChargeType = "PostPaid",
        SystemVolumeType = "ESSD_PL0",
        SystemVolumeSize = 40,
        SubnetId = fooSubnet.Id,
        SecurityGroupIds = new[]
        {
            fooSecurityGroup.Id,
        },
    });

    var fooScalingInstanceAttachment = new Volcengine.Autoscaling.ScalingInstanceAttachment("fooScalingInstanceAttachment", new()
    {
        InstanceId = fooInstance.Id,
        ScalingGroupId = fooScalingGroup.Id,
        Entrusted = true,
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            fooScalingGroupEnabler,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
import com.pulumi.volcengine.vpc.Vpc;
import com.pulumi.volcengine.vpc.VpcArgs;
import com.pulumi.volcengine.vpc.Subnet;
import com.pulumi.volcengine.vpc.SubnetArgs;
import com.pulumi.volcengine.vpc.SecurityGroup;
import com.pulumi.volcengine.vpc.SecurityGroupArgs;
import com.pulumi.volcengine.ecs.inputs.ImagesArgs;
import com.pulumi.volcengine.ecs.KeyPair;
import com.pulumi.volcengine.ecs.KeyPairArgs;
import com.pulumi.volcengine.ecs.LaunchTemplate;
import com.pulumi.volcengine.ecs.LaunchTemplateArgs;
import com.pulumi.volcengine.ecs.inputs.LaunchTemplateNetworkInterfaceArgs;
import com.pulumi.volcengine.ecs.inputs.LaunchTemplateVolumeArgs;
import com.pulumi.volcengine.autoscaling.ScalingGroup;
import com.pulumi.volcengine.autoscaling.ScalingGroupArgs;
import com.pulumi.volcengine.autoscaling.ScalingGroupEnabler;
import com.pulumi.volcengine.autoscaling.ScalingGroupEnablerArgs;
import com.pulumi.volcengine.ecs.Instance;
import com.pulumi.volcengine.ecs.InstanceArgs;
import com.pulumi.volcengine.autoscaling.ScalingInstanceAttachment;
import com.pulumi.volcengine.autoscaling.ScalingInstanceAttachmentArgs;
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) {
        final var fooZones = EcsFunctions.Zones();

        var fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
            .vpcName("acc-test-vpc")
            .cidrBlock("172.16.0.0/16")
            .build());

        var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()        
            .subnetName("acc-test-subnet")
            .cidrBlock("172.16.0.0/24")
            .zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
            .vpcId(fooVpc.id())
            .build());

        var fooSecurityGroup = new SecurityGroup("fooSecurityGroup", SecurityGroupArgs.builder()        
            .securityGroupName("acc-test-security-group")
            .vpcId(fooVpc.id())
            .build());

        final var fooImages = EcsFunctions.Images(ImagesArgs.builder()
            .osType("Linux")
            .visibility("public")
            .instanceTypeId("ecs.g1.large")
            .build());

        var fooKeyPair = new KeyPair("fooKeyPair", KeyPairArgs.builder()        
            .description("acc-test-2")
            .keyPairName("acc-test-key-pair-name")
            .build());

        var fooLaunchTemplate = new LaunchTemplate("fooLaunchTemplate", LaunchTemplateArgs.builder()        
            .description("acc-test-desc")
            .eipBandwidth(200)
            .eipBillingType("PostPaidByBandwidth")
            .eipIsp("BGP")
            .hostName("acc-hostname")
            .imageId(fooImages.applyValue(imagesResult -> imagesResult.images()[0].imageId()))
            .instanceChargeType("PostPaid")
            .instanceName("acc-instance-name")
            .instanceTypeId("ecs.g1.large")
            .keyPairName(fooKeyPair.keyPairName())
            .launchTemplateName("acc-test-template")
            .networkInterfaces(LaunchTemplateNetworkInterfaceArgs.builder()
                .subnetId(fooSubnet.id())
                .securityGroupIds(fooSecurityGroup.id())
                .build())
            .volumes(LaunchTemplateVolumeArgs.builder()
                .volumeType("ESSD_PL0")
                .size(50)
                .deleteWithInstance(true)
                .build())
            .build());

        var fooScalingGroup = new ScalingGroup("fooScalingGroup", ScalingGroupArgs.builder()        
            .scalingGroupName("acc-test-scaling-group")
            .subnetIds(fooSubnet.id())
            .multiAzPolicy("BALANCE")
            .desireInstanceNumber("TODO: GenUnaryOpExpression")
            .minInstanceNumber(0)
            .maxInstanceNumber(1)
            .instanceTerminatePolicy("OldestInstance")
            .defaultCooldown(10)
            .launchTemplateId(fooLaunchTemplate.id())
            .launchTemplateVersion("Default")
            .build());

        var fooScalingGroupEnabler = new ScalingGroupEnabler("fooScalingGroupEnabler", ScalingGroupEnablerArgs.builder()        
            .scalingGroupId(fooScalingGroup.id())
            .build());

        var fooInstance = new Instance("fooInstance", InstanceArgs.builder()        
            .instanceName("acc-test-ecs")
            .description("acc-test")
            .hostName("tf-acc-test")
            .imageId(fooImages.applyValue(imagesResult -> imagesResult.images()[0].imageId()))
            .instanceType("ecs.g1.large")
            .password("93f0cb0614Aab12")
            .instanceChargeType("PostPaid")
            .systemVolumeType("ESSD_PL0")
            .systemVolumeSize(40)
            .subnetId(fooSubnet.id())
            .securityGroupIds(fooSecurityGroup.id())
            .build());

        var fooScalingInstanceAttachment = new ScalingInstanceAttachment("fooScalingInstanceAttachment", ScalingInstanceAttachmentArgs.builder()        
            .instanceId(fooInstance.id())
            .scalingGroupId(fooScalingGroup.id())
            .entrusted(true)
            .build(), CustomResourceOptions.builder()
                .dependsOn(fooScalingGroupEnabler)
                .build());

    }
}
Copy
Coming soon!

Create ScalingInstanceAttachment Resource

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

Constructor syntax

new ScalingInstanceAttachment(name: string, args: ScalingInstanceAttachmentArgs, opts?: CustomResourceOptions);
@overload
def ScalingInstanceAttachment(resource_name: str,
                              args: ScalingInstanceAttachmentArgs,
                              opts: Optional[ResourceOptions] = None)

@overload
def ScalingInstanceAttachment(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              instance_id: Optional[str] = None,
                              scaling_group_id: Optional[str] = None,
                              delete_type: Optional[str] = None,
                              detach_option: Optional[str] = None,
                              entrusted: Optional[bool] = None)
func NewScalingInstanceAttachment(ctx *Context, name string, args ScalingInstanceAttachmentArgs, opts ...ResourceOption) (*ScalingInstanceAttachment, error)
public ScalingInstanceAttachment(string name, ScalingInstanceAttachmentArgs args, CustomResourceOptions? opts = null)
public ScalingInstanceAttachment(String name, ScalingInstanceAttachmentArgs args)
public ScalingInstanceAttachment(String name, ScalingInstanceAttachmentArgs args, CustomResourceOptions options)
type: volcengine:autoscaling:ScalingInstanceAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ScalingInstanceAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ScalingInstanceAttachmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ScalingInstanceAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ScalingInstanceAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ScalingInstanceAttachmentArgs
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 scalingInstanceAttachmentResource = new Volcengine.Autoscaling.ScalingInstanceAttachment("scalingInstanceAttachmentResource", new()
{
    InstanceId = "string",
    ScalingGroupId = "string",
    DeleteType = "string",
    DetachOption = "string",
    Entrusted = false,
});
Copy
example, err := autoscaling.NewScalingInstanceAttachment(ctx, "scalingInstanceAttachmentResource", &autoscaling.ScalingInstanceAttachmentArgs{
	InstanceId:     pulumi.String("string"),
	ScalingGroupId: pulumi.String("string"),
	DeleteType:     pulumi.String("string"),
	DetachOption:   pulumi.String("string"),
	Entrusted:      pulumi.Bool(false),
})
Copy
var scalingInstanceAttachmentResource = new ScalingInstanceAttachment("scalingInstanceAttachmentResource", ScalingInstanceAttachmentArgs.builder()
    .instanceId("string")
    .scalingGroupId("string")
    .deleteType("string")
    .detachOption("string")
    .entrusted(false)
    .build());
Copy
scaling_instance_attachment_resource = volcengine.autoscaling.ScalingInstanceAttachment("scalingInstanceAttachmentResource",
    instance_id="string",
    scaling_group_id="string",
    delete_type="string",
    detach_option="string",
    entrusted=False)
Copy
const scalingInstanceAttachmentResource = new volcengine.autoscaling.ScalingInstanceAttachment("scalingInstanceAttachmentResource", {
    instanceId: "string",
    scalingGroupId: "string",
    deleteType: "string",
    detachOption: "string",
    entrusted: false,
});
Copy
type: volcengine:autoscaling:ScalingInstanceAttachment
properties:
    deleteType: string
    detachOption: string
    entrusted: false
    instanceId: string
    scalingGroupId: string
Copy

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

InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The id of the instance.
ScalingGroupId
This property is required.
Changes to this property will trigger replacement.
string
The id of the scaling group.
DeleteType string
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
DetachOption string
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
Entrusted Changes to this property will trigger replacement. bool
Whether to host the instance to a scaling group. Default value is false.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The id of the instance.
ScalingGroupId
This property is required.
Changes to this property will trigger replacement.
string
The id of the scaling group.
DeleteType string
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
DetachOption string
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
Entrusted Changes to this property will trigger replacement. bool
Whether to host the instance to a scaling group. Default value is false.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The id of the instance.
scalingGroupId
This property is required.
Changes to this property will trigger replacement.
String
The id of the scaling group.
deleteType String
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
detachOption String
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
entrusted Changes to this property will trigger replacement. Boolean
Whether to host the instance to a scaling group. Default value is false.
instanceId
This property is required.
Changes to this property will trigger replacement.
string
The id of the instance.
scalingGroupId
This property is required.
Changes to this property will trigger replacement.
string
The id of the scaling group.
deleteType string
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
detachOption string
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
entrusted Changes to this property will trigger replacement. boolean
Whether to host the instance to a scaling group. Default value is false.
instance_id
This property is required.
Changes to this property will trigger replacement.
str
The id of the instance.
scaling_group_id
This property is required.
Changes to this property will trigger replacement.
str
The id of the scaling group.
delete_type str
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
detach_option str
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
entrusted Changes to this property will trigger replacement. bool
Whether to host the instance to a scaling group. Default value is false.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The id of the instance.
scalingGroupId
This property is required.
Changes to this property will trigger replacement.
String
The id of the scaling group.
deleteType String
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
detachOption String
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
entrusted Changes to this property will trigger replacement. Boolean
Whether to host the instance to a scaling group. Default value is false.

Outputs

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

Get an existing ScalingInstanceAttachment 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?: ScalingInstanceAttachmentState, opts?: CustomResourceOptions): ScalingInstanceAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        delete_type: Optional[str] = None,
        detach_option: Optional[str] = None,
        entrusted: Optional[bool] = None,
        instance_id: Optional[str] = None,
        scaling_group_id: Optional[str] = None) -> ScalingInstanceAttachment
func GetScalingInstanceAttachment(ctx *Context, name string, id IDInput, state *ScalingInstanceAttachmentState, opts ...ResourceOption) (*ScalingInstanceAttachment, error)
public static ScalingInstanceAttachment Get(string name, Input<string> id, ScalingInstanceAttachmentState? state, CustomResourceOptions? opts = null)
public static ScalingInstanceAttachment get(String name, Output<String> id, ScalingInstanceAttachmentState state, CustomResourceOptions options)
resources:  _:    type: volcengine:autoscaling:ScalingInstanceAttachment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DeleteType string
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
DetachOption string
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
Entrusted Changes to this property will trigger replacement. bool
Whether to host the instance to a scaling group. Default value is false.
InstanceId Changes to this property will trigger replacement. string
The id of the instance.
ScalingGroupId Changes to this property will trigger replacement. string
The id of the scaling group.
DeleteType string
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
DetachOption string
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
Entrusted Changes to this property will trigger replacement. bool
Whether to host the instance to a scaling group. Default value is false.
InstanceId Changes to this property will trigger replacement. string
The id of the instance.
ScalingGroupId Changes to this property will trigger replacement. string
The id of the scaling group.
deleteType String
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
detachOption String
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
entrusted Changes to this property will trigger replacement. Boolean
Whether to host the instance to a scaling group. Default value is false.
instanceId Changes to this property will trigger replacement. String
The id of the instance.
scalingGroupId Changes to this property will trigger replacement. String
The id of the scaling group.
deleteType string
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
detachOption string
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
entrusted Changes to this property will trigger replacement. boolean
Whether to host the instance to a scaling group. Default value is false.
instanceId Changes to this property will trigger replacement. string
The id of the instance.
scalingGroupId Changes to this property will trigger replacement. string
The id of the scaling group.
delete_type str
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
detach_option str
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
entrusted Changes to this property will trigger replacement. bool
Whether to host the instance to a scaling group. Default value is false.
instance_id Changes to this property will trigger replacement. str
The id of the instance.
scaling_group_id Changes to this property will trigger replacement. str
The id of the scaling group.
deleteType String
The type of delete activity. Valid values: Remove, Detach. Default value is Remove.
detachOption String
Whether to cancel the association of the instance with the load balancing and public network IP. Valid values: both, none. Default value is both.
entrusted Changes to this property will trigger replacement. Boolean
Whether to host the instance to a scaling group. Default value is false.
instanceId Changes to this property will trigger replacement. String
The id of the instance.
scalingGroupId Changes to this property will trigger replacement. String
The id of the scaling group.

Import

Scaling instance attachment can be imported using the scaling_group_id and instance_id, e.g. You can choose to remove or detach the instance according to the delete_type field.

$ pulumi import volcengine:autoscaling/scalingInstanceAttachment:ScalingInstanceAttachment default scg-mizl7m1kqccg5smt1bdpijuj:i-l8u2ai4j0fauo6mrpgk8
Copy

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.