Skip to content

(aws-autoscaling): notificationTarget shouldn't be compulsory in LifecycleHook #14641

@abeer91

Description

@abeer91

The notificationTarget property can be unset and by default it will be able to use CWE to deliver Autoscaling Group notifications.

ASG API - https://docs.aws.amazon.com/cli/latest/reference/autoscaling/put-lifecycle-hook.html , keeps [--notification-target-arn <value>] as an optional param.

I was able to use L1 construct - CfnLifecycleHook as such without providing the notificationTarget

        const lcHook = new autoscaling.CfnLifecycleHook(this, "LCHook", {
            autoScalingGroupName: nodegroup.autoScalingGroupName,
            lifecycleTransition: LifecycleTransition.INSTANCE_TERMINATING,
            defaultResult: DefaultResult.CONTINUE,
            lifecycleHookName: "TerminateLifecycleHook",
            heartbeatTimeout: 300
        })

Reproduction Steps

Documentation shows property is mandatory - https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-autoscaling.LifecycleHook.html

What did you expect to happen?

notificationTarget should be optional or should have a way to use the default CWE integration.

What actually happened?

Could not use CWE integration which is how aws-node-termination-handler needs to be configured

Environment

  • CDK CLI Version : 1.97.0
  • Framework Version:
  • Node.js Version: v15.9.0
  • OS : Mac
  • Language (Version): TypeScript

Other


This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-autoscalingRelated to Amazon EC2 Auto ScalingbugThis issue is a bug.effort/smallSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdp2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions