-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdk.ts
28 lines (25 loc) · 770 Bytes
/
cdk.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
import * as cdk from 'aws-cdk-lib';
import { EcsAlbMicroservicesStack } from './infra/alb-ecs-microservices';
const AWS_ACCOUNT_ID = process.env.AWS_ACCOUNT_ID!;
const AWS_REGION = process.env.AWS_REGION!;
const AWS_SSL_CERTIFICATE_ARN = process.env.AWS_SSL_CERTIFICATE_ARN!;
const app = new cdk.App();
new EcsAlbMicroservicesStack(app, 'MicroservicesStack', {
env: { account: AWS_ACCOUNT_ID, region: AWS_REGION },
certificateArn: AWS_SSL_CERTIFICATE_ARN,
microservices: [
{
folder: 'users',
cpu: 512,
memoryLimitMiB: 1024,
pathPattern: '/api/users*',
containerPort: 80,
priority: 10,
autoScaling: {
minCapacity: 1,
maxCapacity: 10,
targetCpuUtilizationPercent: 50,
},
},
],
});