Skip to content

Latest commit

 

History

History
2108 lines (1303 loc) · 72.5 KB

API.md

File metadata and controls

2108 lines (1303 loc) · 72.5 KB

API Reference

Constructs

AutoScaler

Initializers

import { AutoScaler } from '@smallcase/aws-cdk-microservice'

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

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced. The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

Static Functions

Name Description
isConstruct Checks if x is a construct.
isResource Check whether the given construct is a Resource.

isConstruct
import { AutoScaler } from '@smallcase/aws-cdk-microservice'

AutoScaler.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


isResource
import { AutoScaler } from '@smallcase/aws-cdk-microservice'

AutoScaler.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
loadBalancerProperties LoadBalancerProps[] No description.

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

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


loadBalancerPropertiesOptional
public readonly loadBalancerProperties: LoadBalancerProps[];

BalancerEntry

Initializers

import { BalancerEntry } from '@smallcase/aws-cdk-microservice'

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

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced. The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

Static Functions

Name Description
isConstruct Checks if x is a construct.
isResource Check whether the given construct is a Resource.

isConstruct
import { BalancerEntry } from '@smallcase/aws-cdk-microservice'

BalancerEntry.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


isResource
import { BalancerEntry } from '@smallcase/aws-cdk-microservice'

BalancerEntry.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.

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

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


Deployment

Initializers

import { Deployment } from '@smallcase/aws-cdk-microservice'

new Deployment(scope: Construct, id: string, props: DeploymentProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props DeploymentProps 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 { Deployment } from '@smallcase/aws-cdk-microservice'

Deployment.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.


MicroService

Initializers

import { MicroService } from '@smallcase/aws-cdk-microservice'

new MicroService(scope: Construct, id: string, props: MicroServiceProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props MicroServiceProps 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 { MicroService } from '@smallcase/aws-cdk-microservice'

MicroService.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
appName string No description.
role InternalRole No description.
sshKey string No description.
subnets string[] No description.
targetGroupProps TargetGroupProps[] No description.
vpc string No description.
applicationType string No description.
asgMaxSize string No description.
asgMinSize string No description.
createCodedeployApplication boolean No description.
deploymentPolicies string[] No description.
diskSize number No description.
diskType string No description.
env string No description.
instanceLabels aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup.TagPropertyProperty[] No description.
instanceType string No description.
networkProps NetworkProps[] No description.
securityGroupProps InternalSG No description.
tcpRules IngressRule[] No description.

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

The tree node.


appNameRequired
public readonly appName: string;
  • Type: string

roleRequired
public readonly role: InternalRole;

sshKeyRequired
public readonly sshKey: string;
  • Type: string

subnetsRequired
public readonly subnets: string[];
  • Type: string[]

targetGroupPropsRequired
public readonly targetGroupProps: TargetGroupProps[];

vpcRequired
public readonly vpc: string;
  • Type: string

applicationTypeOptional
public readonly applicationType: string;
  • Type: string

asgMaxSizeOptional
public readonly asgMaxSize: string;
  • Type: string

asgMinSizeOptional
public readonly asgMinSize: string;
  • Type: string

createCodedeployApplicationOptional
public readonly createCodedeployApplication: boolean;
  • Type: boolean

deploymentPoliciesOptional
public readonly deploymentPolicies: string[];
  • Type: string[]

diskSizeOptional
public readonly diskSize: number;
  • Type: number

diskTypeOptional
public readonly diskType: string;
  • Type: string

envOptional
public readonly env: string;
  • Type: string

instanceLabelsOptional
public readonly instanceLabels: TagPropertyProperty[];
  • Type: aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup.TagPropertyProperty[]

instanceTypeOptional
public readonly instanceType: string;
  • Type: string

networkPropsOptional
public readonly networkProps: NetworkProps[];

securityGroupPropsOptional
public readonly securityGroupProps: InternalSG;

tcpRulesOptional
public readonly tcpRules: IngressRule[];

Structs

ApplicationProps

Initializer

import { ApplicationProps } from '@smallcase/aws-cdk-microservice'

const applicationProps: ApplicationProps = { ... }

Properties

Name Type Description
applicationName string No description.
resourceType string No description.
type string No description.

applicationNameRequired
public readonly applicationName: string;
  • Type: string

resourceTypeRequired
public readonly resourceType: string;
  • Type: string

typeRequired
public readonly type: string;
  • Type: string

AutoScalerProps

Initializer

import { AutoScalerProps } from '@smallcase/aws-cdk-microservice'

const autoScalerProps: AutoScalerProps = { ... }

Properties

Name Type Description
appName string No description.
asgName string No description.
availabilityZones string[] No description.
maxSize string No description.
minSize string No description.
networkProps NetworkProps[] No description.
subnets string[] No description.
templateProps InternalLaunchTemplateProps No description.
tags aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup.TagPropertyProperty[] No description.
tgProps TargetGroupProps No description.

appNameRequired
public readonly appName: string;
  • Type: string

asgNameRequired
public readonly asgName: string;
  • Type: string

availabilityZonesRequired
public readonly availabilityZones: string[];
  • Type: string[]

maxSizeRequired
public readonly maxSize: string;
  • Type: string

minSizeRequired
public readonly minSize: string;
  • Type: string

networkPropsRequired
public readonly networkProps: NetworkProps[];

subnetsRequired
public readonly subnets: string[];
  • Type: string[]

templatePropsRequired
public readonly templateProps: InternalLaunchTemplateProps;

tagsOptional
public readonly tags: TagPropertyProperty[];
  • Type: aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup.TagPropertyProperty[]

tgPropsOptional
public readonly tgProps: TargetGroupProps;

DeploymentProps

Initializer

import { DeploymentProps } from '@smallcase/aws-cdk-microservice'

const deploymentProps: DeploymentProps = { ... }

Properties

Name Type Description
applicationProps ApplicationProps No description.
asgNames string[] No description.
deploymentConfigName string No description.
deploymentGroupName string No description.
roleArn string No description.
tgName string No description.

applicationPropsRequired
public readonly applicationProps: ApplicationProps;

asgNamesRequired
public readonly asgNames: string[];
  • Type: string[]

deploymentConfigNameRequired
public readonly deploymentConfigName: string;
  • Type: string

deploymentGroupNameRequired
public readonly deploymentGroupName: string;
  • Type: string

roleArnRequired
public readonly roleArn: string;
  • Type: string

tgNameRequired
public readonly tgName: string;
  • Type: string

IngressRule

Initializer

import { IngressRule } from '@smallcase/aws-cdk-microservice'

const ingressRule: IngressRule = { ... }

Properties

Name Type Description
port number No description.
sourceSG string No description.
description string No description.

portRequired
public readonly port: number;
  • Type: number

sourceSGRequired
public readonly sourceSG: string;
  • Type: string

descriptionOptional
public readonly description: string;
  • Type: string

InstanceStackProps

Initializer

import { InstanceStackProps } from '@smallcase/aws-cdk-microservice'

const instanceStackProps: InstanceStackProps = { ... }

Properties

Name Type Description
asgName string No description.
instanceProps aws-cdk-lib.aws_ec2.InstanceProps No description.
instanceVolumeSize aws-cdk-lib.aws_autoscaling.BlockDevice No description.
role InternalRole No description.
securityGroup InternalSG No description.
tags {[ key: string ]: string} No description.
targetGroupProps aws-cdk-lib.aws_elasticloadbalancingv2.NetworkTargetGroupProps No description.
vpc InternalVPC No description.

asgNameRequired
public readonly asgName: string;
  • Type: string

instancePropsRequired
public readonly instanceProps: InstanceProps;
  • Type: aws-cdk-lib.aws_ec2.InstanceProps

instanceVolumeSizeOptional
public readonly instanceVolumeSize: BlockDevice;
  • Type: aws-cdk-lib.aws_autoscaling.BlockDevice

roleOptional
public readonly role: InternalRole;

securityGroupOptional
public readonly securityGroup: InternalSG;

tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

targetGroupPropsOptional
public readonly targetGroupProps: NetworkTargetGroupProps;
  • Type: aws-cdk-lib.aws_elasticloadbalancingv2.NetworkTargetGroupProps

vpcOptional
public readonly vpc: InternalVPC;

InternalBD

Initializer

import { InternalBD } from '@smallcase/aws-cdk-microservice'

const internalBD: InternalBD = { ... }

Properties

Name Type Description
name string No description.
size number No description.
type aws-cdk-lib.aws_autoscaling.EbsDeviceVolumeType No description.

nameRequired
public readonly name: string;
  • Type: string

sizeRequired
public readonly size: number;
  • Type: number

typeRequired
public readonly type: EbsDeviceVolumeType;
  • Type: aws-cdk-lib.aws_autoscaling.EbsDeviceVolumeType

InternalLaunchTemplateProps

Initializer

import { InternalLaunchTemplateProps } from '@smallcase/aws-cdk-microservice'

const internalLaunchTemplateProps: InternalLaunchTemplateProps = { ... }

Properties

Name Type Description
amiImageId string No description.
blockDevice InternalBD No description.
detailedMonitoring boolean No description.
instanceType string No description.
role InternalRole No description.
securityGroup InternalSG No description.
sshKey string No description.
templateName string No description.
type string No description.
vpc InternalVPC No description.
existingAttributes aws-cdk-lib.aws_ec2.LaunchTemplateAttributes No description.
instanceVolumeSize aws-cdk-lib.aws_autoscaling.BlockDevice No description.

amiImageIdRequired
public readonly amiImageId: string;
  • Type: string

blockDeviceRequired
public readonly blockDevice: InternalBD;

detailedMonitoringRequired
public readonly detailedMonitoring: boolean;
  • Type: boolean

instanceTypeRequired
public readonly instanceType: string;
  • Type: string

roleRequired
public readonly role: InternalRole;

securityGroupRequired
public readonly securityGroup: InternalSG;

sshKeyRequired
public readonly sshKey: string;
  • Type: string

templateNameRequired
public readonly templateName: string;
  • Type: string

typeRequired
public readonly type: string;
  • Type: string

vpcRequired
public readonly vpc: InternalVPC;

existingAttributesOptional
public readonly existingAttributes: LaunchTemplateAttributes;
  • Type: aws-cdk-lib.aws_ec2.LaunchTemplateAttributes

instanceVolumeSizeOptional
public readonly instanceVolumeSize: BlockDevice;
  • Type: aws-cdk-lib.aws_autoscaling.BlockDevice

InternalRole

Initializer

import { InternalRole } from '@smallcase/aws-cdk-microservice'

const internalRole: InternalRole = { ... }

Properties

Name Type Description
type string No description.
additionalPolicies any[] No description.
roleArn string No description.
roleName string No description.

typeRequired
public readonly type: string;
  • Type: string

additionalPoliciesOptional
public readonly additionalPolicies: any[];
  • Type: any[]

roleArnOptional
public readonly roleArn: string;
  • Type: string

roleNameOptional
public readonly roleName: string;
  • Type: string

InternalSG

Initializer

import { InternalSG } from '@smallcase/aws-cdk-microservice'

const internalSG: InternalSG = { ... }

Properties

Name Type Description
type string No description.
allowAllOutbound boolean No description.
description string No description.
disableInlineRules boolean No description.
ingressRules IngressRule[] No description.
securityGroupName string No description.
sgGroupId string No description.

typeRequired
public readonly type: string;
  • Type: string

allowAllOutboundOptional
public readonly allowAllOutbound: boolean;
  • Type: boolean

descriptionOptional
public readonly description: string;
  • Type: string

disableInlineRulesOptional
public readonly disableInlineRules: boolean;
  • Type: boolean

ingressRulesOptional
public readonly ingressRules: IngressRule[];

securityGroupNameOptional
public readonly securityGroupName: string;
  • Type: string

sgGroupIdOptional
public readonly sgGroupId: string;
  • Type: string

InternalVPC

Initializer

import { InternalVPC } from '@smallcase/aws-cdk-microservice'

const internalVPC: InternalVPC = { ... }

Properties

Name Type Description
type string No description.
vpcName string No description.
vpcProps aws-cdk-lib.aws_ec2.VpcProps No description.

typeRequired
public readonly type: string;
  • Type: string

vpcNameRequired
public readonly vpcName: string;
  • Type: string

vpcPropsOptional
public readonly vpcProps: VpcProps;
  • Type: aws-cdk-lib.aws_ec2.VpcProps

LoadBalancerProps

Initializer

import { LoadBalancerProps } from '@smallcase/aws-cdk-microservice'

const loadBalancerProps: LoadBalancerProps = { ... }

Properties

Name Type Description
appName string No description.
hostHeader string No description.
lbArn string No description.
sslEnabled boolean No description.
targetGroupArn string No description.
zoneId string No description.
zoneName string No description.

appNameRequired
public readonly appName: string;
  • Type: string

hostHeaderRequired
public readonly hostHeader: string;
  • Type: string

lbArnRequired
public readonly lbArn: string;
  • Type: string

sslEnabledRequired
public readonly sslEnabled: boolean;
  • Type: boolean

targetGroupArnRequired
public readonly targetGroupArn: string;
  • Type: string

zoneIdRequired
public readonly zoneId: string;
  • Type: string

zoneNameRequired
public readonly zoneName: string;
  • Type: string

MicroServiceProps

Initializer

import { MicroServiceProps } from '@smallcase/aws-cdk-microservice'

const microServiceProps: MicroServiceProps = { ... }

Properties

Name Type Description
ami string No description.
appName string No description.
availabilityZones string[] No description.
env string No description.
role InternalRole No description.
sshKey string No description.
subnets string[] No description.
vpc string No description.
applicationType string No description.
asgMaxSize string No description.
asgMinSize string No description.
createCodedeployApplication boolean No description.
deploymentPolicies string[] No description.
diskSize number No description.
diskType string No description.
instanceLabels aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup.TagPropertyProperty[] No description.
instanceType string No description.
networkProps NetworkProps[] No description.
securityGroupProps InternalSG No description.
tcpRules IngressRule[] No description.

amiRequired
public readonly ami: string;
  • Type: string

appNameRequired
public readonly appName: string;
  • Type: string

availabilityZonesRequired
public readonly availabilityZones: string[];
  • Type: string[]

envRequired
public readonly env: string;
  • Type: string

roleRequired
public readonly role: InternalRole;

sshKeyRequired
public readonly sshKey: string;
  • Type: string

subnetsRequired
public readonly subnets: string[];
  • Type: string[]

vpcRequired
public readonly vpc: string;
  • Type: string

applicationTypeOptional
public readonly applicationType: string;
  • Type: string

asgMaxSizeOptional
public readonly asgMaxSize: string;
  • Type: string

asgMinSizeOptional
public readonly asgMinSize: string;
  • Type: string

createCodedeployApplicationOptional
public readonly createCodedeployApplication: boolean;
  • Type: boolean

deploymentPoliciesOptional
public readonly deploymentPolicies: string[];
  • Type: string[]

diskSizeOptional
public readonly diskSize: number;
  • Type: number

diskTypeOptional
public readonly diskType: string;
  • Type: string

instanceLabelsOptional
public readonly instanceLabels: TagPropertyProperty[];
  • Type: aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup.TagPropertyProperty[]

instanceTypeOptional
public readonly instanceType: string;
  • Type: string

networkPropsOptional
public readonly networkProps: NetworkProps[];

securityGroupPropsOptional
public readonly securityGroupProps: InternalSG;

tcpRulesOptional
public readonly tcpRules: IngressRule[];

NetworkProps

Initializer

import { NetworkProps } from '@smallcase/aws-cdk-microservice'

const networkProps: NetworkProps = { ... }

Properties

Name Type Description
healthCheckPath string No description.
host string No description.
lbArn string No description.
port number No description.
protocol string No description.
sslEnabled boolean No description.
zoneId string No description.
zoneName string No description.

healthCheckPathRequired
public readonly healthCheckPath: string;
  • Type: string

hostRequired
public readonly host: string;
  • Type: string

lbArnRequired
public readonly lbArn: string;
  • Type: string

portRequired
public readonly port: number;
  • Type: number

protocolRequired
public readonly protocol: string;
  • Type: string

sslEnabledRequired
public readonly sslEnabled: boolean;
  • Type: boolean

zoneIdRequired
public readonly zoneId: string;
  • Type: string

zoneNameRequired
public readonly zoneName: string;
  • Type: string

TargetGroupProps

Initializer

import { TargetGroupProps } from '@smallcase/aws-cdk-microservice'

const targetGroupProps: TargetGroupProps = { ... }

Properties

Name Type Description
type string No description.
healthPath string No description.
name string No description.
port number No description.
protocol string No description.
tgArn string No description.
thresholdCount number No description.
timeout number No description.

typeRequired
public readonly type: string;
  • Type: string

healthPathOptional
public readonly healthPath: string;
  • Type: string

nameOptional
public readonly name: string;
  • Type: string

portOptional
public readonly port: number;
  • Type: number

protocolOptional
public readonly protocol: string;
  • Type: string

tgArnOptional
public readonly tgArn: string;
  • Type: string

thresholdCountOptional
public readonly thresholdCount: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number