-
Notifications
You must be signed in to change notification settings - Fork 1
/
cluster.ts
41 lines (35 loc) · 1010 Bytes
/
cluster.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Construct } from "constructs"
import {
EcsCluster,
} from "../../../imports/providers/aws"
/**
* Represents the properties of the cluster construct.
* @property resourceNamesPrefix An unique custom prefix used to avoid name colision with existing resources.
*/
export interface IClusterProps {
resourceNamesPrefix: string;
}
/**
* Represents a Fargate cluster.
* @class
* @extends Construct
*/
export class ClusterConstruct extends Construct {
/**
* The Fargate cluster.
*/
readonly self: EcsCluster
/**
* Creates a cluster construct.
* @param scope The scope to attach the cluster construct to.
* @param id An unique id used to distinguish constructs.
* @param props The cluster construct properties.
*/
constructor(scope: Construct, id: string, props: IClusterProps) {
super(scope, id)
this.self = new EcsCluster(this, "fargate_cluster", {
name: `${props.resourceNamesPrefix}_fargate_cluster`,
})
}
}
export default ClusterConstruct