1. Packages
  2. AWS Classic
  3. API Docs
  4. autoscaling
  5. LifecycleHook

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.autoscaling.LifecycleHook

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides an AutoScaling Lifecycle Hook resource.

    NOTE: This provider has two types of ways you can add lifecycle hooks - via the initial_lifecycle_hook attribute from the aws.autoscaling.Group resource, or via this one. Hooks added via this resource will not be added until the autoscaling group has been created, and depending on your capacity settings, after the initial instances have been launched, creating unintended behavior. If you need hooks to run on all instances, add them with initial_lifecycle_hook in aws.autoscaling.Group, but take care to not duplicate those hooks with this resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const foobar = new aws.autoscaling.Group("foobar", {
        availabilityZones: ["us-west-2a"],
        name: "test-foobar5",
        healthCheckType: "EC2",
        terminationPolicies: ["OldestInstance"],
        tags: [{
            key: "Foo",
            value: "foo-bar",
            propagateAtLaunch: true,
        }],
    });
    const foobarLifecycleHook = new aws.autoscaling.LifecycleHook("foobar", {
        name: "foobar",
        autoscalingGroupName: foobar.name,
        defaultResult: "CONTINUE",
        heartbeatTimeout: 2000,
        lifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING",
        notificationMetadata: JSON.stringify({
            foo: "bar",
        }),
        notificationTargetArn: "arn:aws:sqs:us-east-1:444455556666:queue1*",
        roleArn: "arn:aws:iam::123456789012:role/S3Access",
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    
    foobar = aws.autoscaling.Group("foobar",
        availability_zones=["us-west-2a"],
        name="test-foobar5",
        health_check_type="EC2",
        termination_policies=["OldestInstance"],
        tags=[{
            "key": "Foo",
            "value": "foo-bar",
            "propagateAtLaunch": True,
        }])
    foobar_lifecycle_hook = aws.autoscaling.LifecycleHook("foobar",
        name="foobar",
        autoscaling_group_name=foobar.name,
        default_result="CONTINUE",
        heartbeat_timeout=2000,
        lifecycle_transition="autoscaling:EC2_INSTANCE_LAUNCHING",
        notification_metadata=json.dumps({
            "foo": "bar",
        }),
        notification_target_arn="arn:aws:sqs:us-east-1:444455556666:queue1*",
        role_arn="arn:aws:iam::123456789012:role/S3Access")
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/autoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foobar, err := autoscaling.NewGroup(ctx, "foobar", &autoscaling.GroupArgs{
    			AvailabilityZones: pulumi.StringArray{
    				pulumi.String("us-west-2a"),
    			},
    			Name:            pulumi.String("test-foobar5"),
    			HealthCheckType: pulumi.String("EC2"),
    			TerminationPolicies: pulumi.StringArray{
    				pulumi.String("OldestInstance"),
    			},
    			Tags: autoscaling.GroupTagArray{
    				&autoscaling.GroupTagArgs{
    					Key:               pulumi.String("Foo"),
    					Value:             pulumi.String("foo-bar"),
    					PropagateAtLaunch: pulumi.Bool(true),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"foo": "bar",
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = autoscaling.NewLifecycleHook(ctx, "foobar", &autoscaling.LifecycleHookArgs{
    			Name:                  pulumi.String("foobar"),
    			AutoscalingGroupName:  foobar.Name,
    			DefaultResult:         pulumi.String("CONTINUE"),
    			HeartbeatTimeout:      pulumi.Int(2000),
    			LifecycleTransition:   pulumi.String("autoscaling:EC2_INSTANCE_LAUNCHING"),
    			NotificationMetadata:  pulumi.String(json0),
    			NotificationTargetArn: pulumi.String("arn:aws:sqs:us-east-1:444455556666:queue1*"),
    			RoleArn:               pulumi.String("arn:aws:iam::123456789012:role/S3Access"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var foobar = new Aws.AutoScaling.Group("foobar", new()
        {
            AvailabilityZones = new[]
            {
                "us-west-2a",
            },
            Name = "test-foobar5",
            HealthCheckType = "EC2",
            TerminationPolicies = new[]
            {
                "OldestInstance",
            },
            Tags = new[]
            {
                new Aws.AutoScaling.Inputs.GroupTagArgs
                {
                    Key = "Foo",
                    Value = "foo-bar",
                    PropagateAtLaunch = true,
                },
            },
        });
    
        var foobarLifecycleHook = new Aws.AutoScaling.LifecycleHook("foobar", new()
        {
            Name = "foobar",
            AutoscalingGroupName = foobar.Name,
            DefaultResult = "CONTINUE",
            HeartbeatTimeout = 2000,
            LifecycleTransition = "autoscaling:EC2_INSTANCE_LAUNCHING",
            NotificationMetadata = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["foo"] = "bar",
            }),
            NotificationTargetArn = "arn:aws:sqs:us-east-1:444455556666:queue1*",
            RoleArn = "arn:aws:iam::123456789012:role/S3Access",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.autoscaling.Group;
    import com.pulumi.aws.autoscaling.GroupArgs;
    import com.pulumi.aws.autoscaling.inputs.GroupTagArgs;
    import com.pulumi.aws.autoscaling.LifecycleHook;
    import com.pulumi.aws.autoscaling.LifecycleHookArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 foobar = new Group("foobar", GroupArgs.builder()
                .availabilityZones("us-west-2a")
                .name("test-foobar5")
                .healthCheckType("EC2")
                .terminationPolicies("OldestInstance")
                .tags(GroupTagArgs.builder()
                    .key("Foo")
                    .value("foo-bar")
                    .propagateAtLaunch(true)
                    .build())
                .build());
    
            var foobarLifecycleHook = new LifecycleHook("foobarLifecycleHook", LifecycleHookArgs.builder()
                .name("foobar")
                .autoscalingGroupName(foobar.name())
                .defaultResult("CONTINUE")
                .heartbeatTimeout(2000)
                .lifecycleTransition("autoscaling:EC2_INSTANCE_LAUNCHING")
                .notificationMetadata(serializeJson(
                    jsonObject(
                        jsonProperty("foo", "bar")
                    )))
                .notificationTargetArn("arn:aws:sqs:us-east-1:444455556666:queue1*")
                .roleArn("arn:aws:iam::123456789012:role/S3Access")
                .build());
    
        }
    }
    
    resources:
      foobar:
        type: aws:autoscaling:Group
        properties:
          availabilityZones:
            - us-west-2a
          name: test-foobar5
          healthCheckType: EC2
          terminationPolicies:
            - OldestInstance
          tags:
            - key: Foo
              value: foo-bar
              propagateAtLaunch: true
      foobarLifecycleHook:
        type: aws:autoscaling:LifecycleHook
        name: foobar
        properties:
          name: foobar
          autoscalingGroupName: ${foobar.name}
          defaultResult: CONTINUE
          heartbeatTimeout: 2000
          lifecycleTransition: autoscaling:EC2_INSTANCE_LAUNCHING
          notificationMetadata:
            fn::toJSON:
              foo: bar
          notificationTargetArn: arn:aws:sqs:us-east-1:444455556666:queue1*
          roleArn: arn:aws:iam::123456789012:role/S3Access
    

    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,
                      autoscaling_group_name: Optional[str] = None,
                      lifecycle_transition: Optional[str] = None,
                      default_result: Optional[str] = None,
                      heartbeat_timeout: Optional[int] = None,
                      name: Optional[str] = None,
                      notification_metadata: Optional[str] = None,
                      notification_target_arn: Optional[str] = None,
                      role_arn: 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: aws:autoscaling: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.

    Constructor example

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

    var lifecycleHookResource = new Aws.AutoScaling.LifecycleHook("lifecycleHookResource", new()
    {
        AutoscalingGroupName = "string",
        LifecycleTransition = "string",
        DefaultResult = "string",
        HeartbeatTimeout = 0,
        Name = "string",
        NotificationMetadata = "string",
        NotificationTargetArn = "string",
        RoleArn = "string",
    });
    
    example, err := autoscaling.NewLifecycleHook(ctx, "lifecycleHookResource", &autoscaling.LifecycleHookArgs{
    	AutoscalingGroupName:  pulumi.String("string"),
    	LifecycleTransition:   pulumi.String("string"),
    	DefaultResult:         pulumi.String("string"),
    	HeartbeatTimeout:      pulumi.Int(0),
    	Name:                  pulumi.String("string"),
    	NotificationMetadata:  pulumi.String("string"),
    	NotificationTargetArn: pulumi.String("string"),
    	RoleArn:               pulumi.String("string"),
    })
    
    var lifecycleHookResource = new LifecycleHook("lifecycleHookResource", LifecycleHookArgs.builder()
        .autoscalingGroupName("string")
        .lifecycleTransition("string")
        .defaultResult("string")
        .heartbeatTimeout(0)
        .name("string")
        .notificationMetadata("string")
        .notificationTargetArn("string")
        .roleArn("string")
        .build());
    
    lifecycle_hook_resource = aws.autoscaling.LifecycleHook("lifecycleHookResource",
        autoscaling_group_name="string",
        lifecycle_transition="string",
        default_result="string",
        heartbeat_timeout=0,
        name="string",
        notification_metadata="string",
        notification_target_arn="string",
        role_arn="string")
    
    const lifecycleHookResource = new aws.autoscaling.LifecycleHook("lifecycleHookResource", {
        autoscalingGroupName: "string",
        lifecycleTransition: "string",
        defaultResult: "string",
        heartbeatTimeout: 0,
        name: "string",
        notificationMetadata: "string",
        notificationTargetArn: "string",
        roleArn: "string",
    });
    
    type: aws:autoscaling:LifecycleHook
    properties:
        autoscalingGroupName: string
        defaultResult: string
        heartbeatTimeout: 0
        lifecycleTransition: string
        name: string
        notificationMetadata: string
        notificationTargetArn: string
        roleArn: 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:

    AutoscalingGroupName string
    Name of the Auto Scaling group to which you want to assign the lifecycle hook
    LifecycleTransition string
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    DefaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    Name string
    Name of the lifecycle hook.
    NotificationMetadata string
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    NotificationTargetArn string
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    RoleArn string
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    AutoscalingGroupName string
    Name of the Auto Scaling group to which you want to assign the lifecycle hook
    LifecycleTransition string
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    DefaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    Name string
    Name of the lifecycle hook.
    NotificationMetadata string
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    NotificationTargetArn string
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    RoleArn string
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    autoscalingGroupName String
    Name of the Auto Scaling group to which you want to assign the lifecycle hook
    lifecycleTransition String
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    defaultResult String
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    name String
    Name of the lifecycle hook.
    notificationMetadata String
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    notificationTargetArn String
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    roleArn String
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    autoscalingGroupName string
    Name of the Auto Scaling group to which you want to assign the lifecycle hook
    lifecycleTransition string
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    defaultResult string
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    name string
    Name of the lifecycle hook.
    notificationMetadata string
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    notificationTargetArn string
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    roleArn string
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    autoscaling_group_name str
    Name of the Auto Scaling group to which you want to assign the lifecycle hook
    lifecycle_transition str
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    default_result str
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    name str
    Name of the lifecycle hook.
    notification_metadata str
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    notification_target_arn str
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    role_arn str
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    autoscalingGroupName String
    Name of the Auto Scaling group to which you want to assign the lifecycle hook
    lifecycleTransition String
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    defaultResult String
    Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    name String
    Name of the lifecycle hook.
    notificationMetadata String
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    notificationTargetArn String
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    roleArn String
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified 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,
            autoscaling_group_name: Optional[str] = None,
            default_result: Optional[str] = None,
            heartbeat_timeout: Optional[int] = None,
            lifecycle_transition: Optional[str] = None,
            name: Optional[str] = None,
            notification_metadata: Optional[str] = None,
            notification_target_arn: Optional[str] = None,
            role_arn: 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:
    AutoscalingGroupName string
    Name 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 or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    LifecycleTransition string
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    Name string
    Name of the lifecycle hook.
    NotificationMetadata string
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    NotificationTargetArn string
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    RoleArn string
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    AutoscalingGroupName string
    Name 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 or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    LifecycleTransition string
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    Name string
    Name of the lifecycle hook.
    NotificationMetadata string
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    NotificationTargetArn string
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    RoleArn string
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    autoscalingGroupName String
    Name 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 or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    lifecycleTransition String
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    name String
    Name of the lifecycle hook.
    notificationMetadata String
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    notificationTargetArn String
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    roleArn String
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    autoscalingGroupName string
    Name 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 or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    lifecycleTransition string
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    name string
    Name of the lifecycle hook.
    notificationMetadata string
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    notificationTargetArn string
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    roleArn string
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    autoscaling_group_name str
    Name 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 or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    lifecycle_transition str
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    name str
    Name of the lifecycle hook.
    notification_metadata str
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    notification_target_arn str
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    role_arn str
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
    autoscalingGroupName String
    Name 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 or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.
    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 DefaultResult parameter
    lifecycleTransition String
    Instance state to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see describe-lifecycle-hook-types
    name String
    Name of the lifecycle hook.
    notificationMetadata String
    Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
    notificationTargetArn String
    ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.
    roleArn String
    ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.

    Import

    Using pulumi import, import AutoScaling Lifecycle Hooks using the role autoscaling_group_name and name separated by /. For example:

    $ pulumi import aws:autoscaling/lifecycleHook:LifecycleHook test-lifecycle-hook asg-name/lifecycle-hook-name
    

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

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi