@@ -15,10 +15,7 @@ import * as yaml from 'js-yaml';
15
15
import * as path from 'path' ;
16
16
import * as lambda from 'aws-cdk-lib/aws-lambda' ;
17
17
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2' ;
18
- import * as cloud9 from 'aws-cdk-lib/aws-cloud9' ;
19
18
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch' ;
20
- import * as ecr from 'aws-cdk-lib/aws-ecr' ;
21
- import * as ecrassets from 'aws-cdk-lib/aws-ecr-assets' ;
22
19
import * as applicationinsights from 'aws-cdk-lib/aws-applicationinsights' ;
23
20
import * as resourcegroups from 'aws-cdk-lib/aws-resourcegroups' ;
24
21
@@ -34,8 +31,7 @@ import { CfnJson, RemovalPolicy, Fn, Duration, Stack, StackProps, CfnOutput } fr
34
31
import { readFileSync } from 'fs' ;
35
32
import 'ts-replace-all'
36
33
import { TreatMissingData , ComparisonOperator } from 'aws-cdk-lib/aws-cloudwatch' ;
37
- import { KubectlLayer } from 'aws-cdk-lib/lambda-layer-kubectl' ;
38
- import { Cloud9Environment } from './modules/core/cloud9' ;
34
+ import { KubectlV31Layer } from '@aws-cdk/lambda-layer-kubectl-v31' ;
39
35
40
36
export class Services extends Stack {
41
37
constructor ( scope : Construct , id : string , props ?: StackProps ) {
@@ -133,19 +129,21 @@ export class Services extends Stack {
133
129
rdsUsername = "petadmin"
134
130
}
135
131
136
- const auroraCluster = new rds . ServerlessCluster ( this , 'Database' , {
137
-
138
- engine : rds . DatabaseClusterEngine . auroraPostgres ( { version : rds . AuroraPostgresEngineVersion . VER_13_9 } ) ,
139
-
132
+ const auroraCluster = new rds . DatabaseCluster ( this , 'Database' , {
133
+ engine : rds . DatabaseClusterEngine . auroraPostgres ( { version : rds . AuroraPostgresEngineVersion . VER_13_15 } ) ,
140
134
parameterGroup : rds . ParameterGroup . fromParameterGroupName ( this , 'ParameterGroup' , 'default.aurora-postgresql13' ) ,
141
135
vpc : theVPC ,
142
136
securityGroups : [ rdssecuritygroup ] ,
143
137
defaultDatabaseName : 'adoptions' ,
144
- scaling : {
145
- autoPause : Duration . minutes ( 60 ) ,
146
- minCapacity : rds . AuroraCapacityUnit . ACU_2 ,
147
- maxCapacity : rds . AuroraCapacityUnit . ACU_8 ,
148
- }
138
+ databaseInsightsMode : rds . DatabaseInsightsMode . ADVANCED ,
139
+ performanceInsightRetention : rds . PerformanceInsightRetention . MONTHS_15 ,
140
+ writer : rds . ClusterInstance . serverlessV2 ( 'writer' , {
141
+ autoMinorVersionUpgrade : true
142
+ } ) ,
143
+ readers : [
144
+ ] ,
145
+ serverlessV2MaxCapacity : 1 ,
146
+ serverlessV2MinCapacity : 0.5 ,
149
147
} ) ;
150
148
151
149
@@ -185,7 +183,7 @@ export class Services extends Stack {
185
183
186
184
const ecsPayForAdoptionCluster = new ecs . Cluster ( this , "PayForAdoption" , {
187
185
vpc : theVPC ,
188
- containerInsights : true
186
+ containerInsightsV2 : ecs . ContainerInsights . ENHANCED
189
187
} ) ;
190
188
// PayForAdoption service definitions-----------------------------------------------------------------------
191
189
const payForAdoptionService = new PayForAdoptionService ( this , 'pay-for-adoption-service' , {
@@ -206,7 +204,7 @@ export class Services extends Stack {
206
204
207
205
const ecsPetListAdoptionCluster = new ecs . Cluster ( this , "PetListAdoptions" , {
208
206
vpc : theVPC ,
209
- containerInsights : true
207
+ containerInsightsV2 : ecs . ContainerInsights . ENHANCED
210
208
} ) ;
211
209
// PetListAdoptions service definitions-----------------------------------------------------------------------
212
210
const listAdoptionsService = new ListAdoptionsService ( this , 'list-adoptions-service' , {
@@ -225,7 +223,7 @@ export class Services extends Stack {
225
223
226
224
const ecsPetSearchCluster = new ecs . Cluster ( this , "PetSearch" , {
227
225
vpc : theVPC ,
228
- containerInsights : true
226
+ containerInsightsV2 : ecs . ContainerInsights . ENHANCED
229
227
} ) ;
230
228
// PetSearch service definitions-----------------------------------------------------------------------
231
229
const searchService = new SearchService ( this , 'search-service' , {
@@ -338,8 +336,8 @@ export class Services extends Stack {
338
336
defaultCapacity : 2 ,
339
337
defaultCapacityInstance : ec2 . InstanceType . of ( ec2 . InstanceClass . T3 , ec2 . InstanceSize . MEDIUM ) ,
340
338
secretsEncryptionKey : secretsKey ,
341
- version : KubernetesVersion . of ( '1.31' ) ,
342
- kubectlLayer : new KubectlLayer ( this , 'kubectl' ) ,
339
+ version : eks . KubernetesVersion . V1_31 ,
340
+ kubectlLayer : new KubectlV31Layer ( this , 'kubectl' ) ,
343
341
authenticationMode : eks . AuthenticationMode . API_AND_CONFIG_MAP ,
344
342
} ) ;
345
343
@@ -507,7 +505,7 @@ export class Services extends Stack {
507
505
// NOTE: Amazon CloudWatch Observability Addon for CloudWatch Agent and Fluentbit
508
506
const otelAddon = new eks . CfnAddon ( this , 'otelObservabilityAddon' , {
509
507
addonName : 'amazon-cloudwatch-observability' ,
510
- addonVersion : 'v2.6 .0-eksbuild.1' ,
508
+ addonVersion : 'v3.3 .0-eksbuild.1' ,
511
509
clusterName : cluster . clusterName ,
512
510
// the properties below are optional
513
511
resolveConflicts : 'OVERWRITE' ,
0 commit comments