A construct that creates an AWS Lambda function to publish ENI usage metrics to CloudWatch.
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. |
- Type: constructs.Construct
The parent construct.
- Type: multi-convention-namer.Namer
The ID of the construct.
The properties of the construct.
| Name | Description |
|---|---|
toString |
Returns a string representation of this construct. |
with |
Applies one or more mixins to this construct. |
public toString(): stringReturns a string representation of this construct.
public with(mixins: ...IMixin[]): IConstructApplies 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.
- Type: ...constructs.IMixin[]
The mixins to apply.
| Name | Description |
|---|---|
isConstruct |
Checks if x is a construct. |
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.
- Type: any
Any object.
| 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. |
public readonly node: Node;- Type: constructs.Node
The tree node.
public readonly cwNamespace: string;- Type: string
public readonly handler: NodejsFunction;- Type: aws-cdk-lib.aws_lambda_nodejs.NodejsFunction
public readonly publishFrequency: number;- Type: number
public readonly regions: string[];- Type: string[]
public readonly rule: Rule;- Type: aws-cdk-lib.aws_events.Rule
import { LambdaEniUsageMetricPublisherProps } from '@time-loop/cdk-lambda-eni-usage-metric-publisher'
const lambdaEniUsageMetricPublisherProps: LambdaEniUsageMetricPublisherProps = { ... }| 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. |
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.
public readonly cwNamespace: string;- Type: string
- Default: 'LambdaHyperplaneEniUsage'
The CloudWatch namespace to publish metrics to.
public readonly publishFrequency: number;- Type: number
- Default: 1
Time intervals that Lambda will be triggered to publish metric in CloudWatch.
public readonly regions: string[];- Type: string[]
- Default: ['us-east-1']
List of AWS regions to publish ENI usage metrics for.