zeroscaler

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

README

Zeroscaler CDK TypeScript Construct Library project

npm version PyPI version NuGet version Go project version TypeScript AWS CDK PRs Welcome

Construct (Zeroscaler) which contains and deploys a lambda that boots up your Fargate application when there is an incoming request. It also monitors

The construct defines an interface (ZeroscalerProps) to configure the target group and Fargate task ARN, and optionally the VPC and ECS cluster.

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests

Diagram of the Construct

flowchart TD
    A["Client"] L_A_B_0@-- HTTP Request --> B["Zeroscaler"]
    B -. Register Target .-> C["ELB Target Group"]
    B L_B_A_0@-- Serve HTML with refresh --> A
    C -- Health Check --> D["ECS Fargate"]
    D -- Boot --> E["Your Fargate Application"]
    A L_A_E_0@-- Refresh when booted --> E
    E L_E_A_0@-- Response --> A
    linkStyle 0 stroke:#00C853,fill:none
    linkStyle 1 stroke:#AA00FF,fill:none
    linkStyle 2 stroke:#00C853,fill:none
    linkStyle 3 stroke:#AA00FF,fill:none
    linkStyle 4 stroke:#AA00FF,fill:none
    linkStyle 5 stroke:#2962FF,fill:none
    linkStyle 6 stroke:#2962FF,fill:none
    L_A_B_0@{ animation: fast }
    L_B_A_0@{ animation: fast }
    L_A_E_0@{ animation: fast }
    L_E_A_0@{ animation: fast }

Installation

npm install @zeroscaler/zeroscaler-cdk

Usage

import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { ZeroScaler } from '@zeroscaler/zeroscaler-cdk';

new Zeroscaler(stack, 'MyZeroscaler', {
    targetGroupArn: 'arn:aws:elasticloadbalancing:...',
    fargateTaskArn: 'arn:aws:ecs:...',
    // Optionally override vpc or cluster
    });

License

MPL-2.0

Documentation

Overview

AWS CDK constructs for ZeroScaler.io

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewZeroscaler_Override

func NewZeroscaler_Override(z Zeroscaler, scope constructs.Construct, id *string, props *ZeroscalerProps)

func Zeroscaler_IsConstruct

func Zeroscaler_IsConstruct(x interface{}) *bool

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.

Returns: true if `x` is an object created from a class which extends `Construct`.

Types

type Zeroscaler

type Zeroscaler interface {
	constructs.Construct
	// The tree node.
	Node() constructs.Node
	// Returns a string representation of this construct.
	ToString() *string
}

func NewZeroscaler

func NewZeroscaler(scope constructs.Construct, id *string, props *ZeroscalerProps) Zeroscaler

type ZeroscalerProps

type ZeroscalerProps struct {
	Cluster        awsecs.ICluster `field:"required" json:"cluster" yaml:"cluster"`
	FargateTaskArn *string         `field:"required" json:"fargateTaskArn" yaml:"fargateTaskArn"`
	TargetGroupArn *string         `field:"required" json:"targetGroupArn" yaml:"targetGroupArn"`
	Vpc            awsec2.IVpc     `field:"required" json:"vpc" yaml:"vpc"`
	RefreshDelay   *string         `field:"optional" json:"refreshDelay" yaml:"refreshDelay"`
}

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

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