1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ess
  5. LifecycleHook
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.ess.LifecycleHook

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    Provides a ESS lifecycle hook resource. More about Ess lifecycle hook, see LifecycleHook.

    NOTE: Available since v1.13.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const defaultRandomInteger = new random.RandomInteger("defaultRandomInteger", {
        min: 10000,
        max: 99999,
    });
    const myName = pulumi.interpolate`${name}-${defaultRandomInteger.result}`;
    const defaultZones = alicloud.getZones({
        availableDiskCategory: "cloud_efficiency",
        availableResourceCreation: "VSwitch",
    });
    const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
        vpcName: myName,
        cidrBlock: "172.16.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.0.0/24",
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
        vswitchName: myName,
    });
    const default2 = new alicloud.vpc.Switch("default2", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.1.0/24",
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
        vswitchName: `${name}-bar`,
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("defaultSecurityGroup", {vpcId: defaultNetwork.id});
    const defaultScalingGroup = new alicloud.ess.ScalingGroup("defaultScalingGroup", {
        minSize: 1,
        maxSize: 1,
        scalingGroupName: myName,
        defaultCooldown: 200,
        removalPolicies: [
            "OldestInstance",
            "NewestInstance",
        ],
        vswitchIds: [
            defaultSwitch.id,
            default2.id,
        ],
    });
    const defaultLifecycleHook = new alicloud.ess.LifecycleHook("defaultLifecycleHook", {
        scalingGroupId: defaultScalingGroup.id,
        lifecycleTransition: "SCALE_OUT",
        heartbeatTimeout: 400,
        notificationMetadata: "example",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default_random_integer = random.RandomInteger("defaultRandomInteger",
        min=10000,
        max=99999)
    my_name = default_random_integer.result.apply(lambda result: f"{name}-{result}")
    default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
        available_resource_creation="VSwitch")
    default_network = alicloud.vpc.Network("defaultNetwork",
        vpc_name=my_name,
        cidr_block="172.16.0.0/16")
    default_switch = alicloud.vpc.Switch("defaultSwitch",
        vpc_id=default_network.id,
        cidr_block="172.16.0.0/24",
        zone_id=default_zones.zones[0].id,
        vswitch_name=my_name)
    default2 = alicloud.vpc.Switch("default2",
        vpc_id=default_network.id,
        cidr_block="172.16.1.0/24",
        zone_id=default_zones.zones[0].id,
        vswitch_name=f"{name}-bar")
    default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
    default_scaling_group = alicloud.ess.ScalingGroup("defaultScalingGroup",
        min_size=1,
        max_size=1,
        scaling_group_name=my_name,
        default_cooldown=200,
        removal_policies=[
            "OldestInstance",
            "NewestInstance",
        ],
        vswitch_ids=[
            default_switch.id,
            default2.id,
        ])
    default_lifecycle_hook = alicloud.ess.LifecycleHook("defaultLifecycleHook",
        scaling_group_id=default_scaling_group.id,
        lifecycle_transition="SCALE_OUT",
        heartbeat_timeout=400,
        notification_metadata="example")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ess"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultRandomInteger, err := random.NewRandomInteger(ctx, "defaultRandomInteger", &random.RandomIntegerArgs{
    			Min: pulumi.Int(10000),
    			Max: pulumi.Int(99999),
    		})
    		if err != nil {
    			return err
    		}
    		myName := defaultRandomInteger.Result.ApplyT(func(result int) (string, error) {
    			return fmt.Sprintf("%v-%v", name, result), nil
    		}).(pulumi.StringOutput)
    		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableDiskCategory:     pulumi.StringRef("cloud_efficiency"),
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(myName),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("172.16.0.0/24"),
    			ZoneId:      pulumi.String(defaultZones.Zones[0].Id),
    			VswitchName: pulumi.String(myName),
    		})
    		if err != nil {
    			return err
    		}
    		default2, err := vpc.NewSwitch(ctx, "default2", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("172.16.1.0/24"),
    			ZoneId:      pulumi.String(defaultZones.Zones[0].Id),
    			VswitchName: pulumi.String(fmt.Sprintf("%v-bar", name)),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ecs.NewSecurityGroup(ctx, "defaultSecurityGroup", &ecs.SecurityGroupArgs{
    			VpcId: defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultScalingGroup, err := ess.NewScalingGroup(ctx, "defaultScalingGroup", &ess.ScalingGroupArgs{
    			MinSize:          pulumi.Int(1),
    			MaxSize:          pulumi.Int(1),
    			ScalingGroupName: pulumi.String(myName),
    			DefaultCooldown:  pulumi.Int(200),
    			RemovalPolicies: pulumi.StringArray{
    				pulumi.String("OldestInstance"),
    				pulumi.String("NewestInstance"),
    			},
    			VswitchIds: pulumi.StringArray{
    				defaultSwitch.ID(),
    				default2.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ess.NewLifecycleHook(ctx, "defaultLifecycleHook", &ess.LifecycleHookArgs{
    			ScalingGroupId:       defaultScalingGroup.ID(),
    			LifecycleTransition:  pulumi.String("SCALE_OUT"),
    			HeartbeatTimeout:     pulumi.Int(400),
    			NotificationMetadata: pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var defaultRandomInteger = new Random.RandomInteger("defaultRandomInteger", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var myName = defaultRandomInteger.Result.Apply(result => $"{name}-{result}");
    
        var defaultZones = AliCloud.GetZones.Invoke(new()
        {
            AvailableDiskCategory = "cloud_efficiency",
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
        {
            VpcName = myName,
            CidrBlock = "172.16.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.0.0/24",
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            VswitchName = myName,
        });
    
        var default2 = new AliCloud.Vpc.Switch("default2", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.1.0/24",
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            VswitchName = $"{name}-bar",
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
        {
            VpcId = defaultNetwork.Id,
        });
    
        var defaultScalingGroup = new AliCloud.Ess.ScalingGroup("defaultScalingGroup", new()
        {
            MinSize = 1,
            MaxSize = 1,
            ScalingGroupName = myName,
            DefaultCooldown = 200,
            RemovalPolicies = new[]
            {
                "OldestInstance",
                "NewestInstance",
            },
            VswitchIds = new[]
            {
                defaultSwitch.Id,
                default2.Id,
            },
        });
    
        var defaultLifecycleHook = new AliCloud.Ess.LifecycleHook("defaultLifecycleHook", new()
        {
            ScalingGroupId = defaultScalingGroup.Id,
            LifecycleTransition = "SCALE_OUT",
            HeartbeatTimeout = 400,
            NotificationMetadata = "example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.RandomInteger;
    import com.pulumi.random.RandomIntegerArgs;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.ecs.SecurityGroup;
    import com.pulumi.alicloud.ecs.SecurityGroupArgs;
    import com.pulumi.alicloud.ess.ScalingGroup;
    import com.pulumi.alicloud.ess.ScalingGroupArgs;
    import com.pulumi.alicloud.ess.LifecycleHook;
    import com.pulumi.alicloud.ess.LifecycleHookArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var defaultRandomInteger = new RandomInteger("defaultRandomInteger", RandomIntegerArgs.builder()        
                .min(10000)
                .max(99999)
                .build());
    
            final var myName = defaultRandomInteger.result().applyValue(result -> String.format("%s-%s", name,result));
    
            final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableDiskCategory("cloud_efficiency")
                .availableResourceCreation("VSwitch")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
                .vpcName(myName)
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()        
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.0.0/24")
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .vswitchName(myName)
                .build());
    
            var default2 = new Switch("default2", SwitchArgs.builder()        
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.1.0/24")
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .vswitchName(String.format("%s-bar", name))
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()        
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultScalingGroup = new ScalingGroup("defaultScalingGroup", ScalingGroupArgs.builder()        
                .minSize("1")
                .maxSize("1")
                .scalingGroupName(myName)
                .defaultCooldown(200)
                .removalPolicies(            
                    "OldestInstance",
                    "NewestInstance")
                .vswitchIds(            
                    defaultSwitch.id(),
                    default2.id())
                .build());
    
            var defaultLifecycleHook = new LifecycleHook("defaultLifecycleHook", LifecycleHookArgs.builder()        
                .scalingGroupId(defaultScalingGroup.id())
                .lifecycleTransition("SCALE_OUT")
                .heartbeatTimeout(400)
                .notificationMetadata("example")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultRandomInteger:
        type: random:RandomInteger
        properties:
          min: 10000
          max: 99999
      defaultNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${myName}
          cidrBlock: 172.16.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.0.0/24
          zoneId: ${defaultZones.zones[0].id}
          vswitchName: ${myName}
      default2:
        type: alicloud:vpc:Switch
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.1.0/24
          zoneId: ${defaultZones.zones[0].id}
          vswitchName: ${name}-bar
      defaultSecurityGroup:
        type: alicloud:ecs:SecurityGroup
        properties:
          vpcId: ${defaultNetwork.id}
      defaultScalingGroup:
        type: alicloud:ess:ScalingGroup
        properties:
          minSize: '1'
          maxSize: '1'
          scalingGroupName: ${myName}
          defaultCooldown: 200
          removalPolicies:
            - OldestInstance
            - NewestInstance
          vswitchIds:
            - ${defaultSwitch.id}
            - ${default2.id}
      defaultLifecycleHook:
        type: alicloud:ess:LifecycleHook
        properties:
          scalingGroupId: ${defaultScalingGroup.id}
          lifecycleTransition: SCALE_OUT
          heartbeatTimeout: 400
          notificationMetadata: example
    variables:
      myName: ${name}-${defaultRandomInteger.result}
      defaultZones:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableDiskCategory: cloud_efficiency
            availableResourceCreation: VSwitch
    

    Module Support

    You can use to the existing autoscaling module to create a lifecycle hook, scaling group and configuration one-click.

    Create LifecycleHook Resource

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

    Constructor syntax

    new LifecycleHook(name: string, args: LifecycleHookArgs, opts?: CustomResourceOptions);
    @overload
    def LifecycleHook(resource_name: str,
                      args: LifecycleHookArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def LifecycleHook(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      lifecycle_transition: Optional[str] = None,
                      scaling_group_id: Optional[str] = None,
                      default_result: Optional[str] = None,
                      heartbeat_timeout: Optional[int] = None,
                      name: Optional[str] = None,
                      notification_arn: Optional[str] = None,
                      notification_metadata: Optional[str] = None)
    func NewLifecycleHook(ctx *Context, name string, args LifecycleHookArgs, opts ...ResourceOption) (*LifecycleHook, error)
    public LifecycleHook(string name, LifecycleHookArgs args, CustomResourceOptions? opts = null)
    public LifecycleHook(String name, LifecycleHookArgs args)
    public LifecycleHook(String name, LifecycleHookArgs args, CustomResourceOptions options)
    
    type: alicloud:ess:LifecycleHook
    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 LifecycleHookArgs
    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 LifecycleHookArgs
    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 LifecycleHookArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LifecycleHookArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LifecycleHookArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var lifecycleHookResource = new AliCloud.Ess.LifecycleHook("lifecycleHookResource", new()
    {
        LifecycleTransition = "string",
        ScalingGroupId = "string",
        DefaultResult = "string",
        HeartbeatTimeout = 0,
        Name = "string",
        NotificationArn = "string",
        NotificationMetadata = "string",
    });
    
    example, err := ess.NewLifecycleHook(ctx, "lifecycleHookResource", &ess.LifecycleHookArgs{
    	LifecycleTransition:  pulumi.String("string"),
    	ScalingGroupId:       pulumi.String("string"),
    	DefaultResult:        pulumi.String("string"),
    	HeartbeatTimeout:     pulumi.Int(0),
    	Name:                 pulumi.String("string"),
    	NotificationArn:      pulumi.String("string"),
    	NotificationMetadata: pulumi.String("string"),
    })
    
    var lifecycleHookResource = new LifecycleHook("lifecycleHookResource", LifecycleHookArgs.builder()        
        .lifecycleTransition("string")
        .scalingGroupId("string")
        .defaultResult("string")
        .heartbeatTimeout(0)
        .name("string")
        .notificationArn("string")
        .notificationMetadata("string")
        .build());
    
    lifecycle_hook_resource = alicloud.ess.LifecycleHook("lifecycleHookResource",
        lifecycle_transition="string",
        scaling_group_id="string",
        default_result="string",
        heartbeat_timeout=0,
        name="string",
        notification_arn="string",
        notification_metadata="string")
    
    const lifecycleHookResource = new alicloud.ess.LifecycleHook("lifecycleHookResource", {
        lifecycleTransition: "string",
        scalingGroupId: "string",
        defaultResult: "string",
        heartbeatTimeout: 0,
        name: "string",
        notificationArn: "string",
        notificationMetadata: "string",
    });
    
    type: alicloud:ess:LifecycleHook
    properties:
        defaultResult: string
        heartbeatTimeout: 0
        lifecycleTransition: string
        name: string
        notificationArn: string
        notificationMetadata: string
        scalingGroupId: string
    

    LifecycleHook Resource Properties

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

    Inputs

    The LifecycleHook resource accepts the following input properties:

    LifecycleTransition string
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    ScalingGroupId string
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    DefaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    HeartbeatTimeout int
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    Name string
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    NotificationArn string
    The Arn of notification target.
    NotificationMetadata string
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    LifecycleTransition string
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    ScalingGroupId string
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    DefaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    HeartbeatTimeout int
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    Name string
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    NotificationArn string
    The Arn of notification target.
    NotificationMetadata string
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    lifecycleTransition String
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    scalingGroupId String
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    defaultResult String
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    heartbeatTimeout Integer
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    name String
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    notificationArn String
    The Arn of notification target.
    notificationMetadata String
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    lifecycleTransition string
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    scalingGroupId string
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    defaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    heartbeatTimeout number
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    name string
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    notificationArn string
    The Arn of notification target.
    notificationMetadata string
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    lifecycle_transition str
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    scaling_group_id str
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    default_result str
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    heartbeat_timeout int
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    name str
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    notification_arn str
    The Arn of notification target.
    notification_metadata str
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    lifecycleTransition String
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    scalingGroupId String
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    defaultResult String
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    heartbeatTimeout Number
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    name String
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    notificationArn String
    The Arn of notification target.
    notificationMetadata String
    Additional information that you want to include when Auto Scaling sends a message to the notification target.

    Outputs

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

    Get an existing LifecycleHook 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?: LifecycleHookState, opts?: CustomResourceOptions): LifecycleHook
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            default_result: Optional[str] = None,
            heartbeat_timeout: Optional[int] = None,
            lifecycle_transition: Optional[str] = None,
            name: Optional[str] = None,
            notification_arn: Optional[str] = None,
            notification_metadata: Optional[str] = None,
            scaling_group_id: Optional[str] = None) -> LifecycleHook
    func GetLifecycleHook(ctx *Context, name string, id IDInput, state *LifecycleHookState, opts ...ResourceOption) (*LifecycleHook, error)
    public static LifecycleHook Get(string name, Input<string> id, LifecycleHookState? state, CustomResourceOptions? opts = null)
    public static LifecycleHook get(String name, Output<String> id, LifecycleHookState 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:
    DefaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    HeartbeatTimeout int
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    LifecycleTransition string
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    Name string
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    NotificationArn string
    The Arn of notification target.
    NotificationMetadata string
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    ScalingGroupId string
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    DefaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    HeartbeatTimeout int
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    LifecycleTransition string
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    Name string
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    NotificationArn string
    The Arn of notification target.
    NotificationMetadata string
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    ScalingGroupId string
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    defaultResult String
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    heartbeatTimeout Integer
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    lifecycleTransition String
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    name String
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    notificationArn String
    The Arn of notification target.
    notificationMetadata String
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    scalingGroupId String
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    defaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    heartbeatTimeout number
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    lifecycleTransition string
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    name string
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    notificationArn string
    The Arn of notification target.
    notificationMetadata string
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    scalingGroupId string
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    default_result str
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    heartbeat_timeout int
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    lifecycle_transition str
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    name str
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    notification_arn str
    The Arn of notification target.
    notification_metadata str
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    scaling_group_id str
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.
    defaultResult String
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses. Applicable value: CONTINUE, ABANDON, ROLLBACK, default value: CONTINUE.
    heartbeatTimeout Number
    Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter. Default value: 600.
    lifecycleTransition String
    Type of Scaling activity attached to lifecycle hook. Supported value: SCALE_OUT, SCALE_IN.
    name String
    The name of the lifecycle hook, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is lifecycle hook id.
    notificationArn String
    The Arn of notification target.
    notificationMetadata String
    Additional information that you want to include when Auto Scaling sends a message to the notification target.
    scalingGroupId String
    The ID of the Auto Scaling group to which you want to assign the lifecycle hook.

    Import

    Ess lifecycle hook can be imported using the id, e.g.

    $ pulumi import alicloud:ess/lifecycleHook:LifecycleHook example ash-l12345
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi