From a2287743a9a548b54e6f3ab634343d941263ad65 Mon Sep 17 00:00:00 2001 From: Gowri Sankar Date: Mon, 27 May 2024 16:20:51 +0930 Subject: [PATCH] DO-1631: update prop names and deprecate old props --- packages/graphql-mesh-server/lib/fargate.ts | 16 +++++++++------- .../lib/graphql-mesh-server.ts | 6 ++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/graphql-mesh-server/lib/fargate.ts b/packages/graphql-mesh-server/lib/fargate.ts index 98b6e0be..173b860b 100644 --- a/packages/graphql-mesh-server/lib/fargate.ts +++ b/packages/graphql-mesh-server/lib/fargate.ts @@ -59,15 +59,17 @@ export interface MeshServiceProps { }; /** * SSM values to pass through to the container as secrets + * + * @deprecated - Use secrets instead */ - secrets?: { [key: string]: ssm.IStringParameter | ssm.IStringListParameter }; + ssmSecrets?: { [key: string]: ssm.IStringParameter | ssm.IStringListParameter }; /** * ECS Secrets to pass through to the container as secrets * * The key values can be referenced from either SSM or Secrets manager */ - secretsV2?: { [key: string]: ecs.Secret }; + secrets?: { [key: string]: ecs.Secret }; /** * Name of the WAF @@ -276,10 +278,10 @@ export class MeshService extends Construct { } // Construct secrets from provided ssm values - const secrets: { [key: string]: ecs.Secret } = {}; - props.secrets = props.secrets || {}; - for (const [key, ssm] of Object.entries(props.secrets)) { - secrets[key] = ecs.Secret.fromSsmParameter(ssm); + const ssmSecrets: { [key: string]: ecs.Secret } = {}; + props.ssmSecrets = props.ssmSecrets || {}; + for (const [key, ssm] of Object.entries(props.ssmSecrets)) { + ssmSecrets[key] = ecs.Secret.fromSsmParameter(ssm); } // Configure a custom log driver and group @@ -303,7 +305,7 @@ export class MeshService extends Construct { image: ecs.ContainerImage.fromEcrRepository(this.repository), enableLogging: true, // default containerPort: 4000, // graphql mesh gateway port - secrets: props.secretsV2 ? props.secretsV2 : secrets, // Prefer v2 secrets using secrets manager + secrets: props.secrets ? props.secrets : ssmSecrets, // Prefer v2 secrets using secrets manager environment: environment, logDriver: logDriver, taskRole: new iam.Role(this, "MeshTaskRole", { diff --git a/packages/graphql-mesh-server/lib/graphql-mesh-server.ts b/packages/graphql-mesh-server/lib/graphql-mesh-server.ts index f5620f1f..4de9e787 100644 --- a/packages/graphql-mesh-server/lib/graphql-mesh-server.ts +++ b/packages/graphql-mesh-server/lib/graphql-mesh-server.ts @@ -67,15 +67,17 @@ export type MeshHostingProps = { }; /** * SSM values to pass through to the container as secrets + * + * @deprecated - Use secrets instead */ - secrets?: { [key: string]: ssm.IStringParameter | ssm.IStringListParameter }; + ssmSecrets?: { [key: string]: ssm.IStringParameter | ssm.IStringListParameter }; /** * ECS Secrets to pass through to the container as secrets * * The key values can be referenced from either SSM or Secrets manager */ - secretsV2?: { [key: string]: Secret }; + secrets?: { [key: string]: Secret }; /** * Pass custom cpu scaling steps