Skip to content

Commit 15fe722

Browse files
committed
Merge branch 'main' into 'main'
Security: Use secrets manager to store k8s secrets Closes #10 See merge request observability-bd-projects/one-observability-demo!136
2 parents b3a4405 + 186615f commit 15fe722

File tree

3 files changed

+812
-247
lines changed

3 files changed

+812
-247
lines changed

PetAdoptions/cdk/pet_stack/lib/services.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as s3 from 'aws-cdk-lib/aws-s3'
99
import * as s3seeder from 'aws-cdk-lib/aws-s3-deployment'
1010
import * as rds from 'aws-cdk-lib/aws-rds';
1111
import * as ssm from 'aws-cdk-lib/aws-ssm';
12+
import * as kms from 'aws-cdk-lib/aws-kms';
1213
import * as eks from 'aws-cdk-lib/aws-eks';
1314
import * as yaml from 'js-yaml';
1415
import * as path from 'path';
@@ -330,12 +331,14 @@ export class Services extends Stack {
330331
parameterName: '/eks/petsite/EKSMasterRoleArn'
331332
})
332333

334+
const secretsKey = new kms.Key(this, 'SecretsKey');
333335
const cluster = new eks.Cluster(this, 'petsite', {
334336
clusterName: 'PetSite',
335337
mastersRole: clusterAdmin,
336338
vpc: theVPC,
337339
defaultCapacity: 2,
338340
defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
341+
secretsEncryptionKey: secretsKey,
339342
version: KubernetesVersion.of('1.27'),
340343
kubectlLayer: new KubectlLayer(this, 'kubectl')
341344
});

0 commit comments

Comments
 (0)