awsautoscalinghooktargets

package
v2.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

Lifecycle Hook for the CDK AWS AutoScaling Library

This library contains integration classes for AutoScaling lifecycle hooks. Instances of these classes should be passed to the autoScalingGroup.addLifecycleHook() method.

Lifecycle hooks can be activated in one of the following ways:

  • Invoke a Lambda function
  • Publish to an SNS topic
  • Send to an SQS queue

For more information on using this library, see the README of the @aws-cdk/aws-autoscaling library.

For more information about lifecycle hooks, see Amazon EC2 AutoScaling Lifecycle hooks in the Amazon EC2 User Guide.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFunctionHook_Override

func NewFunctionHook_Override(f FunctionHook, fn awslambda.IFunction, encryptionKey awskms.IKey)

func NewQueueHook_Override

func NewQueueHook_Override(q QueueHook, queue awssqs.IQueue)

func NewTopicHook_Override

func NewTopicHook_Override(t TopicHook, topic awssns.ITopic)

Types

type FunctionHook

type FunctionHook interface {
	awsautoscaling.ILifecycleHookTarget
	// If the `IRole` does not exist in `options`, will create an `IRole` and an SNS Topic and attach both to the lifecycle hook.
	//
	// If the `IRole` does exist in `options`, will only create an SNS Topic and attach it to the lifecycle hook.
	Bind(_scope constructs.Construct, options *awsautoscaling.BindHookTargetOptions) *awsautoscaling.LifecycleHookTargetConfig
}

Use a Lambda Function as a hook target.

Internally creates a Topic to make the connection.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var function_ function
var key key

functionHook := awscdk.Aws_autoscaling_hooktargets.NewFunctionHook(function_, key)

func NewFunctionHook

func NewFunctionHook(fn awslambda.IFunction, encryptionKey awskms.IKey) FunctionHook

type QueueHook

type QueueHook interface {
	awsautoscaling.ILifecycleHookTarget
	// If an `IRole` is found in `options`, grant it access to send messages.
	//
	// Otherwise, create a new `IRole` and grant it access to send messages.
	//
	// Returns: the `IRole` with access to send messages and the ARN of the queue it has access to send messages to.
	Bind(_scope constructs.Construct, options *awsautoscaling.BindHookTargetOptions) *awsautoscaling.LifecycleHookTargetConfig
}

Use an SQS queue as a hook target.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var queue queue

queueHook := awscdk.Aws_autoscaling_hooktargets.NewQueueHook(queue)

func NewQueueHook

func NewQueueHook(queue awssqs.IQueue) QueueHook

type TopicHook

type TopicHook interface {
	awsautoscaling.ILifecycleHookTarget
	// If an `IRole` is found in `options`, grant it topic publishing permissions.
	//
	// Otherwise, create a new `IRole` and grant it topic publishing permissions.
	//
	// Returns: the `IRole` with topic publishing permissions and the ARN of the topic it has publishing permission to.
	Bind(_scope constructs.Construct, options *awsautoscaling.BindHookTargetOptions) *awsautoscaling.LifecycleHookTargetConfig
}

Use an SNS topic as a hook target.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var topic topic

topicHook := awscdk.Aws_autoscaling_hooktargets.NewTopicHook(topic)

func NewTopicHook

func NewTopicHook(topic awssns.ITopic) TopicHook

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL