Skip to content

One Observability Workshop v3.0.0


One Observability Workshop / constructs/ecs / WorkshopEcs

Class: WorkshopEcs

Defined in: constructs/ecs.ts:59

A CDK construct that creates an Amazon ECS cluster with EC2 capacity.

This construct sets up: - ECS cluster with enhanced container insights - Auto Scaling Group with ECS-optimized AMI - Security group for cluster resources - Capacity provider for efficient resource management - CloudFormation exports for cross-stack references

The cluster is configured with best practices for security, monitoring, and cost optimization.

Extends

  • Construct

Constructors

Constructor

new WorkshopEcs(scope, id, properties): WorkshopEcs

Defined in: constructs/ecs.ts:76

Creates a new WorkshopEcs construct.

Parameters

scope

Construct

The parent construct

id

string

The construct identifier

properties

EcsProperties

Configuration properties for the ECS cluster

Returns

WorkshopEcs

Overrides

Construct.constructor

Properties

cluster

readonly cluster: Cluster

Defined in: constructs/ecs.ts:61

The ECS cluster instance


autoScalingGroup

readonly autoScalingGroup: AutoScalingGroup

Defined in: constructs/ecs.ts:63

Auto Scaling Group managing the EC2 capacity


securityGroup

readonly securityGroup: SecurityGroup

Defined in: constructs/ecs.ts:65

Security group for ECS cluster resources


openSearchPipeline?

readonly optional openSearchPipeline: OpenSearchPipeline

Defined in: constructs/ecs.ts:67

OpenSearch ingestion pipeline for log routing (optional)

Methods

importFromExports()

static importFromExports(scope, id, vpc): object

Defined in: constructs/ecs.ts:181

Imports an ECS cluster from CloudFormation exports.

This static method allows other stacks to reference an ECS cluster that was created by this construct and exported via CloudFormation.

Parameters

scope

Construct

The construct scope where the cluster will be imported

id

string

The construct identifier for the imported resources

vpc

IVpc

The VPC where the cluster is deployed

Returns

object

Object containing the imported cluster, security group, and optional pipeline

cluster

cluster: ICluster

securityGroup

securityGroup: ISecurityGroup

openSearchPipeline?

optional openSearchPipeline: object

openSearchPipeline.pipelineEndpoint

pipelineEndpoint: string

openSearchPipeline.pipelineArn

pipelineArn: string

openSearchPipeline.pipelineRoleArn

pipelineRoleArn: string