Skip to content

Latest commit

 

History

History
279 lines (172 loc) · 11.1 KB

File metadata and controls

279 lines (172 loc) · 11.1 KB

API Reference

Constructs

LambdaEniUsageMetricPublisher

A construct that creates an AWS Lambda function to publish ENI usage metrics to CloudWatch.

Initializers

import { LambdaEniUsageMetricPublisher } from '@time-loop/cdk-lambda-eni-usage-metric-publisher'

new LambdaEniUsageMetricPublisher(scope: Construct, id: Namer, props: LambdaEniUsageMetricPublisherProps)
Name Type Description
scope constructs.Construct The parent construct.
id multi-convention-namer.Namer The ID of the construct.
props LambdaEniUsageMetricPublisherProps The properties of the construct.

scopeRequired
  • Type: constructs.Construct

The parent construct.


idRequired
  • Type: multi-convention-namer.Namer

The ID of the construct.


propsRequired

The properties of the construct.


Methods

Name Description
toString Returns a string representation of this construct.
with Applies one or more mixins to this construct.

toString
public toString(): string

Returns a string representation of this construct.

with
public with(mixins: ...IMixin[]): IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

mixinsRequired
  • Type: ...constructs.IMixin[]

The mixins to apply.


Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { LambdaEniUsageMetricPublisher } from '@time-loop/cdk-lambda-eni-usage-metric-publisher'

LambdaEniUsageMetricPublisher.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
cwNamespace string No description.
handler aws-cdk-lib.aws_lambda_nodejs.NodejsFunction No description.
publishFrequency number No description.
regions string[] No description.
rule aws-cdk-lib.aws_events.Rule No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


cwNamespaceRequired
public readonly cwNamespace: string;
  • Type: string

handlerRequired
public readonly handler: NodejsFunction;
  • Type: aws-cdk-lib.aws_lambda_nodejs.NodejsFunction

publishFrequencyRequired
public readonly publishFrequency: number;
  • Type: number

regionsRequired
public readonly regions: string[];
  • Type: string[]

ruleRequired
public readonly rule: Rule;
  • Type: aws-cdk-lib.aws_events.Rule

Structs

LambdaEniUsageMetricPublisherProps

Initializer

import { LambdaEniUsageMetricPublisherProps } from '@time-loop/cdk-lambda-eni-usage-metric-publisher'

const lambdaEniUsageMetricPublisherProps: LambdaEniUsageMetricPublisherProps = { ... }

Properties

Name Type Description
cloudwatchLogsRetention aws-cdk-lib.aws_logs.RetentionDays How long to retain logs published to CloudWatch logs.
cwNamespace string The CloudWatch namespace to publish metrics to.
publishFrequency number Time intervals that Lambda will be triggered to publish metric in CloudWatch.
regions string[] List of AWS regions to publish ENI usage metrics for.

cloudwatchLogsRetentionOptional
public readonly cloudwatchLogsRetention: RetentionDays;
  • Type: aws-cdk-lib.aws_logs.RetentionDays
  • Default: aws_logs.RetentionDays.THREE_MONTHS

How long to retain logs published to CloudWatch logs.


cwNamespaceOptional
public readonly cwNamespace: string;
  • Type: string
  • Default: 'LambdaHyperplaneEniUsage'

The CloudWatch namespace to publish metrics to.


publishFrequencyOptional
public readonly publishFrequency: number;
  • Type: number
  • Default: 1

Time intervals that Lambda will be triggered to publish metric in CloudWatch.


regionsOptional
public readonly regions: string[];
  • Type: string[]
  • Default: ['us-east-1']

List of AWS regions to publish ENI usage metrics for.