Skip to content

Latest commit

 

History

History
301 lines (176 loc) · 11.1 KB

API.md

File metadata and controls

301 lines (176 loc) · 11.1 KB

API Reference

Constructs

KissDockerCompose

Initializers

import { KissDockerCompose } from 'kiss-docker-compose'

new KissDockerCompose(scope: Construct, id: string, props?: IKissDockerComposeProps)
Name Type Description
scope constructs.Construct - scope in which this resource is defined.
id string - scoped id of the resource is used to prefix names to prevent naming conflicts.
props IKissDockerComposeProps - resource properties, some of which are required.

scopeRequired
  • Type: constructs.Construct

scope in which this resource is defined.


idRequired
  • Type: string

scoped id of the resource is used to prefix names to prevent naming conflicts.


propsOptional

resource properties, some of which are required.


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 { KissDockerCompose } from 'kiss-docker-compose'

KissDockerCompose.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
ec2Instance aws-cdk-lib.aws_ec2.Instance EC2 Instance which was created.
regionOfEC2Instances string regionOfEC2Instances is the region in which the EC2 instance will be deployed.
regionOfECR string regionOfECR is the region from which the ECR image will be pulled.

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

The tree node.


ec2InstanceRequired
public readonly ec2Instance: Instance;
  • Type: aws-cdk-lib.aws_ec2.Instance

EC2 Instance which was created.

You may access this to get the instance's public DNS or IP


regionOfEC2InstancesRequired
public readonly regionOfEC2Instances: string;
  • Type: string

regionOfEC2Instances is the region in which the EC2 instance will be deployed.


regionOfECRRequired
public readonly regionOfECR: string;
  • Type: string

regionOfECR is the region from which the ECR image will be pulled.


Protocols

IKissDockerComposeProps

Allows overriding all default code, or a subset of it.

To customize, first get the default values for these properties (which are exported) and then make modifications from there.

Properties

Name Type Description
dockerComposeFileAsString string Your Docker Compose file, stringified.
ec2Instance aws-cdk-lib.aws_ec2.Instance Setting this value overrides and ignores the repositoriesForDockerComposeImages, vpc, ec2InstanceRole, and instanceSecurityGroup parameters.
ec2InstanceRole aws-cdk-lib.aws_iam.Role Setting this overrides the template's Role with which the ec2Instance is deployed.
eip aws-cdk-lib.aws_ec2.CfnEIP Elastic IP address is associated with the EC2 instance.
instanceSecurityGroup aws-cdk-lib.aws_ec2.SecurityGroup Setting this overrides the template's SecurityGroup with which the ec2Instance is deployed.
machineImage aws-cdk-lib.aws_ec2.IMachineImage machineImage used to create the EC2 Instance.
repositoriesForDockerComposeImages aws-cdk-lib.aws_ecr.IRepository[] ECR repositories containing images used for your Docker Compose application.
vpc aws-cdk-lib.aws_ec2.Vpc Setting this overrides the template's VPC into which the ec2Instance is deployed.

dockerComposeFileAsStringRequired
public readonly dockerComposeFileAsString: string;
  • Type: string

Your Docker Compose file, stringified.

This is copied to the EC2 instance without modification Required.


ec2InstanceOptional
public readonly ec2Instance: Instance;
  • Type: aws-cdk-lib.aws_ec2.Instance

Setting this value overrides and ignores the repositoriesForDockerComposeImages, vpc, ec2InstanceRole, and instanceSecurityGroup parameters.

This is the EC2 Instance used by this CDK.

Default: EC2Instance(this, id, props.vpc, props.ec2InstanceRole, props.instanceSecurityGroup, props.repositoriesForDockerComposeImages, ec2.InstanceSize.MICRO, this.regionOfEC2Instances, this.regionOfECR, props.dockerComposeFileAsString)


ec2InstanceRoleOptional
public readonly ec2InstanceRole: Role;
  • Type: aws-cdk-lib.aws_iam.Role

Setting this overrides the template's Role with which the ec2Instance is deployed.

Default: Ec2InstanceRole(this, id)


eipOptional
public readonly eip: CfnEIP;
  • Type: aws-cdk-lib.aws_ec2.CfnEIP

Elastic IP address is associated with the EC2 instance.

If no value is passed then no EIP is created and an EIP is not used.

Default: Nothing happens.


instanceSecurityGroupOptional
public readonly instanceSecurityGroup: SecurityGroup;
  • Type: aws-cdk-lib.aws_ec2.SecurityGroup

Setting this overrides the template's SecurityGroup with which the ec2Instance is deployed.

Default: InstanceSecurityGroup(this, id, props.vpc)


machineImageOptional
public readonly machineImage: IMachineImage;
  • Type: aws-cdk-lib.aws_ec2.IMachineImage

machineImage used to create the EC2 Instance.

The docs sometimes refer to this as "ImageId" or "AMI". This is used if (1) your instance was stateful, and (2) you were running Kiss-Docker-Compose already, but then (3) you updated your infrastructure, and (4) it deleted your stateful information, and now (5) you want to restore your stateful data.

Default: undefined


repositoriesForDockerComposeImagesOptional
public readonly repositoriesForDockerComposeImages: IRepository[];
  • Type: aws-cdk-lib.aws_ecr.IRepository[]

ECR repositories containing images used for your Docker Compose application.

This is primarily used for pre-pulling images before starting the application to make sure the current image is up to date. If you do not have ECR images you can leave this as an empty array - [] - or null. In these cases, no images are pulled from ECR.

Default: ECRsForDockerComposeImages(this, [])


vpcOptional
public readonly vpc: Vpc;
  • Type: aws-cdk-lib.aws_ec2.Vpc

Setting this overrides the template's VPC into which the ec2Instance is deployed.

Default: VPC(this, id)