Skip to content

Latest commit

 

History

History
1157 lines (688 loc) · 37.1 KB

File metadata and controls

1157 lines (688 loc) · 37.1 KB

API Reference

Constructs

NightyNight

This class is deprecated, please use NightyNightForEc2.

Initializers

import { NightyNight } from '@matthewbonig/nightynight'

new NightyNight(scope: Construct, id: string, props: NightyNightProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props NightyNightProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { NightyNight } from '@matthewbonig/nightynight'

NightyNight.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
  • Deprecated: in favor of NightyNightForEc2
public readonly node: Node;
  • Type: constructs.Node

The tree node.


NightyNightForAsg

A construct that will build a Lambda and a CloudWatch Rule (cron schedule) that will set the given ASG's desired capacity.

Typically used when you've got and ASG that you can scale during set hours.

Initializers

import { NightyNightForAsg } from '@matthewbonig/nightynight'

new NightyNightForAsg(scope: Construct, id: string, props: NightyNightForAsgProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props NightyNightForAsgProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { NightyNightForAsg } from '@matthewbonig/nightynight'

NightyNightForAsg.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

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

The tree node.


NightyNightForEc2

A construct that will build a Lambda and a CloudWatch Rule (cron schedule) that will stop the given ec2 instance at the specified time.

Typically used when you've got ec2 instances that you only need during business hours and want to reduce the costs of.

Initializers

import { NightyNightForEc2 } from '@matthewbonig/nightynight'

new NightyNightForEc2(scope: Construct, id: string, props: NightyNightForEc2Props)
Name Type Description
scope constructs.Construct No description.
id string No description.
props NightyNightForEc2Props No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { NightyNightForEc2 } from '@matthewbonig/nightynight'

NightyNightForEc2.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

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

The tree node.


NightyNightForEcs

A construct that will build a Lambda and a CloudWatch Rule (cron schedule) that will set the given ECS Service's desired capacity.

Typically, used when you've got an ECS Service that you can scale during set hours.

Initializers

import { NightyNightForEcs } from '@matthewbonig/nightynight'

new NightyNightForEcs(scope: Construct, id: string, props: NightyNightForEcsProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props NightyNightForEcsProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { NightyNightForEcs } from '@matthewbonig/nightynight'

NightyNightForEcs.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

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

The tree node.


NightyNightForRds

A construct that will build a Lambda and a CloudWatch Rule (cron schedule) that will stop the given rds instance at the specified time.

Typically used when you've got rds instances that you only need during business hours and want to reduce the costs of.

Initializers

import { NightyNightForRds } from '@matthewbonig/nightynight'

new NightyNightForRds(scope: Construct, id: string, props: NightyNightForRdsProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props NightyNightForRdsProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { NightyNightForRds } from '@matthewbonig/nightynight'

NightyNightForRds.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

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

The tree node.


WakeyWakeyForEc2

A construct that will build a Lambda and a CloudWatch Rule (cron schedule) that will start the given ec2 instance at the specified time.

Typically used when you've got ec2 instances that you only need during business hours and want to reduce the costs of. Use in conjunction with the Nightynight construct at

Initializers

import { WakeyWakeyForEc2 } from '@matthewbonig/nightynight'

new WakeyWakeyForEc2(scope: Construct, id: string, props: WakeyWakeyForEc2Props)
Name Type Description
scope constructs.Construct No description.
id string No description.
props WakeyWakeyForEc2Props No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { WakeyWakeyForEc2 } from '@matthewbonig/nightynight'

WakeyWakeyForEc2.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

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

The tree node.


WakeyWakeyForRds

A construct that will build a Lambda and a CloudWatch Rule (cron schedule) that will start the given rds instance at the specified time.

Typically used when you've got rds instances that you only need during business hours and want to reduce the costs of.

Initializers

import { WakeyWakeyForRds } from '@matthewbonig/nightynight'

new WakeyWakeyForRds(scope: Construct, id: string, props: WakeyWakeyForRdsProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props WakeyWakeyForRdsProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { WakeyWakeyForRds } from '@matthewbonig/nightynight'

WakeyWakeyForRds.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

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

The tree node.


Structs

NightyNightForAsgProps

Props for the NightNight construct.

Initializer

import { NightyNightForAsgProps } from '@matthewbonig/nightynight'

const nightyNightForAsgProps: NightyNightForAsgProps = { ... }

Properties

Name Type Description
autoScalingGroup aws-cdk-lib.aws_autoscaling.IAutoScalingGroup the AutoScalingGroup you'd like to change the instance count on.
desiredCapacity number Desired capacity.
schedule aws-cdk-lib.aws_events.CronOptions An option CronOptions to specify the time of day to scale.

autoScalingGroupRequired
public readonly autoScalingGroup: IAutoScalingGroup;
  • Type: aws-cdk-lib.aws_autoscaling.IAutoScalingGroup

the AutoScalingGroup you'd like to change the instance count on.


desiredCapacityRequired
public readonly desiredCapacity: number;
  • Type: number

Desired capacity.


scheduleOptional
public readonly schedule: CronOptions;
  • Type: aws-cdk-lib.aws_events.CronOptions
  • Default: { day: '*', hour: '4', minute: '0' }

An option CronOptions to specify the time of day to scale.


NightyNightForEc2Props

Props for the NightNight construct.

Initializer

import { NightyNightForEc2Props } from '@matthewbonig/nightynight'

const nightyNightForEc2Props: NightyNightForEc2Props = { ... }

Properties

Name Type Description
filters any[] Filters to match to find an EC2 instance.
instanceId string the instanceId of the EC2 instance you'd like stopped.
schedule aws-cdk-lib.aws_events.CronOptions An option CronOptions to specify the time of day to stop the instance.

filtersOptional
public readonly filters: any[];
  • Type: any[]

Filters to match to find an EC2 instance.

Must provide this if instanceId is not provided. If instanceId is provided this is ignored.


instanceIdOptional
public readonly instanceId: string;
  • Type: string

the instanceId of the EC2 instance you'd like stopped.

Must provide this if tags is not provided.


scheduleOptional
public readonly schedule: CronOptions;
  • Type: aws-cdk-lib.aws_events.CronOptions
  • Default: { day: '*', hour: '4', minute: '0' }

An option CronOptions to specify the time of day to stop the instance.


NightyNightForEcsProps

Props for the NightNight construct.

Initializer

import { NightyNightForEcsProps } from '@matthewbonig/nightynight'

const nightyNightForEcsProps: NightyNightForEcsProps = { ... }

Properties

Name Type Description
desiredCapacity number Desired capacity.
serviceName string The service name to update.
cluster aws-cdk-lib.aws_ecs.ICluster The ECS Cluster where the service resides.
schedule aws-cdk-lib.aws_events.CronOptions An option CronOptions to specify the time of day to scale.

desiredCapacityRequired
public readonly desiredCapacity: number;
  • Type: number

Desired capacity.


serviceNameRequired
public readonly serviceName: string;
  • Type: string

The service name to update.


clusterOptional
public readonly cluster: ICluster;
  • Type: aws-cdk-lib.aws_ecs.ICluster
  • Default: 'default'

The ECS Cluster where the service resides.


scheduleOptional
public readonly schedule: CronOptions;
  • Type: aws-cdk-lib.aws_events.CronOptions
  • Default: { day: '*', hour: '4', minute: '0' }

An option CronOptions to specify the time of day to scale.


NightyNightForRdsProps

Props for the NightNight construct.

Initializer

import { NightyNightForRdsProps } from '@matthewbonig/nightynight'

const nightyNightForRdsProps: NightyNightForRdsProps = { ... }

Properties

Name Type Description
dbInstanceIdentifier string the DBInstanceIdentifier of the RDS instance you'd like stopped.
schedule aws-cdk-lib.aws_events.CronOptions An option CronOptions to specify the time of day to stop the instance.

dbInstanceIdentifierRequired
public readonly dbInstanceIdentifier: string;
  • Type: string

the DBInstanceIdentifier of the RDS instance you'd like stopped.


scheduleOptional
public readonly schedule: CronOptions;
  • Type: aws-cdk-lib.aws_events.CronOptions
  • Default: { day: '*', hour: '4', minute: '0' }

An option CronOptions to specify the time of day to stop the instance.


NightyNightProps

Initializer

import { NightyNightProps } from '@matthewbonig/nightynight'

const nightyNightProps: NightyNightProps = { ... }

Properties

Name Type Description
filters any[] Filters to match to find an EC2 instance.
instanceId string the instanceId of the EC2 instance you'd like stopped.
schedule aws-cdk-lib.aws_events.CronOptions An option CronOptions to specify the time of day to stop the instance.

filtersOptional
public readonly filters: any[];
  • Type: any[]

Filters to match to find an EC2 instance.

Must provide this if instanceId is not provided. If instanceId is provided this is ignored.


instanceIdOptional
public readonly instanceId: string;
  • Type: string

the instanceId of the EC2 instance you'd like stopped.

Must provide this if tags is not provided.


scheduleOptional
public readonly schedule: CronOptions;
  • Type: aws-cdk-lib.aws_events.CronOptions
  • Default: { day: '*', hour: '4', minute: '0' }

An option CronOptions to specify the time of day to stop the instance.


WakeyWakeyForEc2Props

Initializer

import { WakeyWakeyForEc2Props } from '@matthewbonig/nightynight'

const wakeyWakeyForEc2Props: WakeyWakeyForEc2Props = { ... }

Properties

Name Type Description
filters any[] Filters to match to find an EC2 instance.
instanceId string the instanceId of the EC2 instance you'd like started.
schedule aws-cdk-lib.aws_events.CronOptions An option CronOptions to specify the time of day to start the instance.

filtersOptional
public readonly filters: any[];
  • Type: any[]

Filters to match to find an EC2 instance.

Must provide this if instanceId is not provided. If instanceId is provided this is ignored.


Example

[{
Name: 'STRING_VALUE',
Values: [
'STRING_VALUE',
]
}]
instanceIdOptional
public readonly instanceId: string;
  • Type: string

the instanceId of the EC2 instance you'd like started.

If instanceId is provided the filters is ignored.


scheduleOptional
public readonly schedule: CronOptions;
  • Type: aws-cdk-lib.aws_events.CronOptions
  • Default: { day: '*', hour: '12', minute: '0' }

An option CronOptions to specify the time of day to start the instance.


WakeyWakeyForRdsProps

Props for the WakeyWakeyForRds construct.

Initializer

import { WakeyWakeyForRdsProps } from '@matthewbonig/nightynight'

const wakeyWakeyForRdsProps: WakeyWakeyForRdsProps = { ... }

Properties

Name Type Description
dbInstanceIdentifier string the DBInstanceIdentifier of the RDS instance you'd like started.
schedule aws-cdk-lib.aws_events.CronOptions An option CronOptions to specify the time of day to start the instance.

dbInstanceIdentifierRequired
public readonly dbInstanceIdentifier: string;
  • Type: string

the DBInstanceIdentifier of the RDS instance you'd like started.


scheduleOptional
public readonly schedule: CronOptions;
  • Type: aws-cdk-lib.aws_events.CronOptions
  • Default: { day: '*', hour: '4', minute: '0' }

An option CronOptions to specify the time of day to start the instance.