awslogsdestinations

package
v2.231.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

README

AWS CloudWatch Logs Subscription Destination Library

This library contains destinations for AWS CloudWatch Logs SubscriptionFilters. You can send log data to Kinesis Streams or Lambda Functions.

See the documentation of the logs module for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFirehoseDestination_Override added in v2.188.0

func NewFirehoseDestination_Override(f FirehoseDestination, stream awskinesisfirehose.IDeliveryStream, props *FirehoseDestinationProps)

func NewKinesisDestination_Override

func NewKinesisDestination_Override(k KinesisDestination, stream awskinesis.IStream, props *KinesisDestinationProps)

func NewLambdaDestination_Override

func NewLambdaDestination_Override(l LambdaDestination, fn awslambda.IFunction, options *LambdaDestinationOptions)

LambdaDestinationOptions.

Types

type FirehoseDestination added in v2.188.0

type FirehoseDestination interface {
	awslogs.ILogSubscriptionDestination
	// Return the properties required to send subscription events to this destination.
	//
	// If necessary, the destination can use the properties of the SubscriptionFilter
	// object itself to configure its permissions to allow the subscription to write
	// to it.
	//
	// The destination may reconfigure its own permissions in response to this
	// function call.
	Bind(scope constructs.Construct, sourceLogGroup awslogs.ILogGroup) *awslogs.LogSubscriptionDestinationConfig
}

Use a Data Firehose delivery stream as the destination for a log subscription.

Example:

import destinations "github.com/aws/aws-cdk-go/awscdk"
import firehose "github.com/aws/aws-cdk-go/awscdk"

var deliveryStream IDeliveryStream
var logGroup LogGroup

logs.NewSubscriptionFilter(this, jsii.String("Subscription"), &SubscriptionFilterProps{
	LogGroup: LogGroup,
	Destination: destinations.NewFirehoseDestination(deliveryStream),
	FilterPattern: logs.FilterPattern_AllEvents(),
})

func NewFirehoseDestination added in v2.188.0

type FirehoseDestinationProps added in v2.188.0

type FirehoseDestinationProps struct {
	// The role to assume to write log events to the destination.
	// Default: - A new Role is created.
	//
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
}

Customize the Amazon Data Firehose Logs Destination.

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 role Role

firehoseDestinationProps := &FirehoseDestinationProps{
	Role: role,
}

type KinesisDestination

type KinesisDestination interface {
	awslogs.ILogSubscriptionDestination
	// Return the properties required to send subscription events to this destination.
	//
	// If necessary, the destination can use the properties of the SubscriptionFilter
	// object itself to configure its permissions to allow the subscription to write
	// to it.
	//
	// The destination may reconfigure its own permissions in response to this
	// function call.
	Bind(scope constructs.Construct, sourceLogGroup awslogs.ILogGroup) *awslogs.LogSubscriptionDestinationConfig
}

Use a Kinesis stream as the destination for a log subscription.

Example:

import destinations "github.com/aws/aws-cdk-go/awscdk"
import kinesis "github.com/aws/aws-cdk-go/awscdk"

var stream Stream
var logGroup LogGroup

logs.NewSubscriptionFilter(this, jsii.String("Subscription"), &SubscriptionFilterProps{
	LogGroup: LogGroup,
	Destination: destinations.NewKinesisDestination(stream),
	FilterPattern: logs.FilterPattern_AllTerms(jsii.String("ERROR"), jsii.String("MainThread")),
	FilterName: jsii.String("ErrorInMainThread"),
	Distribution: logs.Distribution_RANDOM,
})

func NewKinesisDestination

func NewKinesisDestination(stream awskinesis.IStream, props *KinesisDestinationProps) KinesisDestination

type KinesisDestinationProps added in v2.13.0

type KinesisDestinationProps struct {
	// The role to assume to write log events to the destination.
	// Default: - A new Role is created.
	//
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
}

Customize the Kinesis Logs Destination.

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 role Role

kinesisDestinationProps := &KinesisDestinationProps{
	Role: role,
}

type LambdaDestination

type LambdaDestination interface {
	awslogs.ILogSubscriptionDestination
	// Return the properties required to send subscription events to this destination.
	//
	// If necessary, the destination can use the properties of the SubscriptionFilter
	// object itself to configure its permissions to allow the subscription to write
	// to it.
	//
	// The destination may reconfigure its own permissions in response to this
	// function call.
	Bind(scope constructs.Construct, sourceLogGroup awslogs.ILogGroup) *awslogs.LogSubscriptionDestinationConfig
}

Use a Lambda Function as the destination for a log subscription.

Example:

import destinations "github.com/aws/aws-cdk-go/awscdk"

var fn Function
var logGroup LogGroup

logs.NewSubscriptionFilter(this, jsii.String("Subscription"), &SubscriptionFilterProps{
	LogGroup: LogGroup,
	Destination: destinations.NewLambdaDestination(fn),
	FilterPattern: logs.FilterPattern_AllTerms(jsii.String("ERROR"), jsii.String("MainThread")),
	FilterName: jsii.String("ErrorInMainThread"),
})

func NewLambdaDestination

func NewLambdaDestination(fn awslambda.IFunction, options *LambdaDestinationOptions) LambdaDestination

LambdaDestinationOptions.

type LambdaDestinationOptions

type LambdaDestinationOptions struct {
	// Whether or not to add Lambda Permissions.
	// Default: true.
	//
	AddPermissions *bool `field:"optional" json:"addPermissions" yaml:"addPermissions"`
}

Options that may be provided to LambdaDestination.

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"

lambdaDestinationOptions := &LambdaDestinationOptions{
	AddPermissions: jsii.Boolean(false),
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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