import { BaseFargateService } from 'cdk-fargate-patterns'
new BaseFargateService(scope: Construct, id: string, props: BaseFargateServiceProps)- Type:
@aws-cdk/core.Construct
- Type:
string
public readonly service: FargateService[];- Type:
@aws-cdk/aws-ecs.FargateService[]
The service(s) created from the task(s).
public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
The VPC.
Represents the database instance or database cluster.
import { Database } from 'cdk-fargate-patterns'
new Database(scope: Construct, id: string, props: DatabaseProps)- Type:
@aws-cdk/core.Construct
- Type:
string
public readonly clusterEndpointHostname: string;- Type:
string
public readonly clusterIdentifier: string;- Type:
string
public readonly connections: Connections;public readonly secret: ISecret;public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
import { DualAlbFargateService } from 'cdk-fargate-patterns'
new DualAlbFargateService(scope: Construct, id: string, props: DualAlbFargateServiceProps)- Type:
@aws-cdk/core.Construct
- Type:
string
public readonly externalAlb: ApplicationLoadBalancer;The external ALB.
public readonly internalAlb: ApplicationLoadBalancer;The internal ALB.
import { DualNlbFargateService } from 'cdk-fargate-patterns'
new DualNlbFargateService(scope: Construct, id: string, props: DualNlbFargateServiceProps)- Type:
@aws-cdk/core.Construct
- Type:
string
public readonly externalNlb: NetworkLoadBalancer;The external Nlb.
public readonly internalNlb: NetworkLoadBalancer;The internal Nlb.
Represents the Laravel service.
import { Laravel } from 'cdk-fargate-patterns'
new Laravel(scope: Construct, id: string, props: LaravelProps)- Type:
@aws-cdk/core.Construct
- Type:
string
public readonly svc: DualAlbFargateService;public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
public readonly db: Database;import { WordPress } from 'cdk-fargate-patterns'
new WordPress(scope: Construct, id: string, props?: WordPressProps)- Type:
@aws-cdk/core.Construct
- Type:
string
public readonly svc: DualAlbFargateService;public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
public readonly db: Database;import { BaseFargateServiceProps } from 'cdk-fargate-patterns'
const baseFargateServiceProps: BaseFargateServiceProps = { ... }public readonly tasks: FargateTaskProps[];public readonly circuitBreaker: boolean;- Type:
boolean - Default: true
Enable the ECS service circuit breaker.
public readonly cluster: ICluster;- Type:
@aws-cdk/aws-ecs.ICluster - Default: create a new ECS Cluster.
Use existing ECS Cluster.
public readonly clusterProps: ClusterProps;- Type:
@aws-cdk/aws-ecs.ClusterProps - Default: Create vpc and enable Fargate Capacity Providers.
The properties used to define an ECS cluster.
public readonly enableExecuteCommand: boolean;- Type:
boolean - Default: false
Whether to enable ECS Exec support.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html
public readonly route53Ops: Route53Options;public readonly spot: boolean;- Type:
boolean - Default: false
create a FARGATE_SPOT only cluster.
public readonly spotTerminationHandler: boolean;- Type:
boolean - Default: true
Enable the fargate spot termination handler.
public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
public readonly vpcSubnets: SubnetSelection;- Type:
@aws-cdk/aws-ec2.SubnetSelection - Default: { subnetType: ec2.SubnetType.PRIVATE, }
The subnets to associate with the service.
Database configuration.
import { DatabaseCofig } from 'cdk-fargate-patterns'
const databaseCofig: DatabaseCofig = { ... }public readonly connections: Connections;The database connnections.
public readonly endpoint: string;- Type:
string
The endpoint address for the database.
public readonly identifier: string;- Type:
string
The databasae identifier.
public readonly secret: ISecret;The database secret.
import { DatabaseProps } from 'cdk-fargate-patterns'
const databaseProps: DatabaseProps = { ... }public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
The VPC for the database.
public readonly allowFrom: IConnectable;- Type:
@aws-cdk/aws-ec2.IConnectable - Default: the whole VPC CIDR
Allow database connection.
public readonly auroraServerless: boolean;- Type:
boolean - Default: false
enable aurora serverless.
public readonly backupRetention: Duration;- Type:
@aws-cdk/core.Duration - Default: 7 days
database backup retension.
public readonly clusterEngine: IClusterEngine;- Type:
@aws-cdk/aws-rds.IClusterEngine - Default: rds.AuroraMysqlEngineVersion.VER_2_09_1
The database cluster engine.
public readonly databaseSubnets: SubnetSelection;VPC subnets for database.
public readonly defaultDatabaseName: string;- Type:
string - Default: do not create any default database
Default database name to create.
public readonly instanceEngine: IInstanceEngine;- Type:
@aws-cdk/aws-rds.IInstanceEngine - Default: MySQL 8.0.21
The database instance engine.
public readonly instanceType: InstanceType;- Type:
@aws-cdk/aws-ec2.InstanceType - Default: r5.large
The database instance type.
public readonly singleDbInstance: boolean;- Type:
boolean - Default: false
Whether to use single RDS instance rather than RDS cluster.
Not recommended for production.
import { DualAlbFargateServiceProps } from 'cdk-fargate-patterns'
const dualAlbFargateServiceProps: DualAlbFargateServiceProps = { ... }public readonly tasks: FargateTaskProps[];public readonly circuitBreaker: boolean;- Type:
boolean - Default: true
Enable the ECS service circuit breaker.
public readonly cluster: ICluster;- Type:
@aws-cdk/aws-ecs.ICluster - Default: create a new ECS Cluster.
Use existing ECS Cluster.
public readonly clusterProps: ClusterProps;- Type:
@aws-cdk/aws-ecs.ClusterProps - Default: Create vpc and enable Fargate Capacity Providers.
The properties used to define an ECS cluster.
public readonly enableExecuteCommand: boolean;- Type:
boolean - Default: false
Whether to enable ECS Exec support.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html
public readonly route53Ops: Route53Options;public readonly spot: boolean;- Type:
boolean - Default: false
create a FARGATE_SPOT only cluster.
public readonly spotTerminationHandler: boolean;- Type:
boolean - Default: true
Enable the fargate spot termination handler.
public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
public readonly vpcSubnets: SubnetSelection;- Type:
@aws-cdk/aws-ec2.SubnetSelection - Default: { subnetType: ec2.SubnetType.PRIVATE, }
The subnets to associate with the service.
public readonly externalAlbIdleTimeout: Duration;- Type:
@aws-cdk/core.Duration - Default: 60.
The external load balancer idle timeout, in seconds.
public readonly internalAlbIdleTimeout: Duration;- Type:
@aws-cdk/core.Duration - Default: 60.
The internal load balancer idle timeout, in seconds.
import { DualNlbFargateServiceProps } from 'cdk-fargate-patterns'
const dualNlbFargateServiceProps: DualNlbFargateServiceProps = { ... }public readonly tasks: FargateTaskProps[];public readonly circuitBreaker: boolean;- Type:
boolean - Default: true
Enable the ECS service circuit breaker.
public readonly cluster: ICluster;- Type:
@aws-cdk/aws-ecs.ICluster - Default: create a new ECS Cluster.
Use existing ECS Cluster.
public readonly clusterProps: ClusterProps;- Type:
@aws-cdk/aws-ecs.ClusterProps - Default: Create vpc and enable Fargate Capacity Providers.
The properties used to define an ECS cluster.
public readonly enableExecuteCommand: boolean;- Type:
boolean - Default: false
Whether to enable ECS Exec support.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html
public readonly route53Ops: Route53Options;public readonly spot: boolean;- Type:
boolean - Default: false
create a FARGATE_SPOT only cluster.
public readonly spotTerminationHandler: boolean;- Type:
boolean - Default: true
Enable the fargate spot termination handler.
public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
public readonly vpcSubnets: SubnetSelection;- Type:
@aws-cdk/aws-ec2.SubnetSelection - Default: { subnetType: ec2.SubnetType.PRIVATE, }
The subnets to associate with the service.
Task properties for the Fargate.
import { FargateTaskProps } from 'cdk-fargate-patterns'
const fargateTaskProps: FargateTaskProps = { ... }public readonly task: FargateTaskDefinition;public readonly capacityProviderStrategy: CapacityProviderStrategy[];Customized capacity provider strategy.
public readonly desiredCount: number;- Type:
number - Default: 1
desired number of tasks for the service.
public readonly external: LoadBalancerAccessibility;- Type:
cdk-fargate-patterns.LoadBalancerAccessibility - Default: no external listener
The external ELB listener.
public readonly healthCheck: HealthCheck;health check from elbv2 target group.
public readonly healthCheckGracePeriod: Duration;- Type:
@aws-cdk/core.Duration - Default: cdk.Duration.seconds(60),
The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
public readonly internal: LoadBalancerAccessibility;- Type:
cdk-fargate-patterns.LoadBalancerAccessibility - Default: no internal listener
The internal ELB listener.
public readonly maxHealthyPercent: number;- Type:
number - Default: 200
The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
public readonly minHealthyPercent: number;- Type:
number - Default: 50
The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.
public readonly protocol: Protocol;- Type:
@aws-cdk/aws-elasticloadbalancingv2.Protocol - Default: TCP
The target group protocol for NLB.
For ALB, this option will be ignored and always set to HTTP.
public readonly protocolVersion: ApplicationProtocolVersion;The protocol version to use.
public readonly scalingPolicy: ServiceScalingPolicy;- Type:
cdk-fargate-patterns.ServiceScalingPolicy - Default: { maxCapacity: 10, targetCpuUtilization: 50, requestsPerTarget: 1000 }
service autoscaling policy.
public readonly serviceName: string;- Type:
string - Default: auto-generated
The serviceName.
import { LaravelProps } from 'cdk-fargate-patterns'
const laravelProps: LaravelProps = { ... }public readonly code: string;- Type:
string
The local path to the Laravel code base.
public readonly loadbalancer: LoadBalancerAccessibility;The loadbalancer accessibility for the service.
public readonly auroraServerless: boolean;- Type:
boolean - Default: false
Whether to use aurora serverless.
When enabled, the databaseInstanceType and
engine will be ignored. The rds.DatabaseClusterEngine.AURORA_MYSQL will be used as
the default cluster engine instead.
public readonly backupRetention: Duration;- Type:
@aws-cdk/core.Duration - Default: 7 days
database backup retension.
public readonly clusterEngine: IClusterEngine;- Type:
@aws-cdk/aws-rds.IClusterEngine - Default: rds.AuroraMysqlEngineVersion.VER_2_09_1
The database cluster engine.
public readonly containerPort: number;- Type:
number - Default: 80
The Laravel container port.
public readonly databaseInstanceType: InstanceType;- Type:
@aws-cdk/aws-ec2.InstanceType - Default: r5.large
Database instance type.
public readonly databaseSubnets: SubnetSelection;- Type:
@aws-cdk/aws-ec2.SubnetSelection - Default: VPC isolated subnets
VPC subnets for database.
public readonly defaultDatabaseName: string;- Type:
string
The default database name to create.
public readonly efsFileSystem: FileSystemProps;Options to create the EFS FileSystem.
public readonly enableExecuteCommand: boolean;- Type:
boolean
enable ECS Exec.
public readonly instanceEngine: IInstanceEngine;- Type:
@aws-cdk/aws-rds.IInstanceEngine - Default: MySQL 8.0.21
The database instance engine.
public readonly serviceProps: FargateTaskProps;task options for the Laravel fargate service.
public readonly singleDbInstance: boolean;- Type:
boolean - Default: false
Whether to use single RDS instance rather than RDS cluster.
Not recommended for production.
public readonly spot: boolean;- Type:
boolean
enable fargate spot.
public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc
The load balancer accessibility.
import { LoadBalancerAccessibility } from 'cdk-fargate-patterns'
const loadBalancerAccessibility: LoadBalancerAccessibility = { ... }public readonly port: number;- Type:
number
The port of the listener.
public readonly certificate: ICertificate[];- Type:
@aws-cdk/aws-certificatemanager.ICertificate[] - Default: no certificate(HTTP only)
The ACM certificate for the HTTPS listener.
public readonly forwardConditions: ListenerCondition[];- Type:
@aws-cdk/aws-elasticloadbalancingv2.ListenerCondition[] - Default: no forward conditions.
Listener forward conditions.
import { Route53Options } from 'cdk-fargate-patterns'
const route53Options: Route53Options = { ... }public readonly enableLoadBalancerAlias: boolean;- Type:
boolean - Default: true
Whether to configure the ALIAS for the LB.
public readonly externalElbRecordName: string;- Type:
string - Default: external
the external ELB record name.
public readonly internalElbRecordName: string;- Type:
string - Default: internal
the internal ELB record name.
public readonly zoneName: string;- Type:
string - Default: svc.local
private zone name.
import { ServiceScalingPolicy } from 'cdk-fargate-patterns'
const serviceScalingPolicy: ServiceScalingPolicy = { ... }public readonly maxCapacity: number;- Type:
number - Default: 10
max capacity for the service autoscaling.
public readonly requestPerTarget: number;- Type:
number - Default: 1000
request per target.
public readonly targetCpuUtilization: number;- Type:
number - Default: 50
target cpu utilization.
import { WordPressProps } from 'cdk-fargate-patterns'
const wordPressProps: WordPressProps = { ... }public readonly auroraServerless: boolean;- Type:
boolean - Default: false
Whether to use aurora serverless.
When enabled, the databaseInstanceType and
engine will be ignored. The rds.DatabaseClusterEngine.AURORA_MYSQL will be used as
the default cluster engine instead.
public readonly backupRetention: Duration;- Type:
@aws-cdk/core.Duration - Default: 7 days
database backup retension.
public readonly clusterEngine: IClusterEngine;- Type:
@aws-cdk/aws-rds.IClusterEngine - Default: rds.AuroraMysqlEngineVersion.VER_2_09_1
The database cluster engine.
public readonly databaseInstanceType: InstanceType;- Type:
@aws-cdk/aws-ec2.InstanceType - Default: r5.large
Database instance type.
public readonly databaseSubnets: SubnetSelection;- Type:
@aws-cdk/aws-ec2.SubnetSelection - Default: VPC isolated subnets
VPC subnets for database.
public readonly enableExecuteCommand: boolean;- Type:
boolean
enable ECS Exec.
public readonly instanceEngine: IInstanceEngine;- Type:
@aws-cdk/aws-rds.IInstanceEngine - Default: MySQL 8.0.21
The database instance engine.
public readonly serviceProps: FargateTaskProps;task options for the WordPress fargate service.
public readonly singleDbInstance: boolean;- Type:
boolean - Default: false
Whether to use single RDS instance rather than RDS cluster.
Not recommended for production.
public readonly spot: boolean;- Type:
boolean
enable fargate spot.
public readonly vpc: IVpc;- Type:
@aws-cdk/aws-ec2.IVpc