@jaypie/constructs 1.2.64 → 1.2.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -293,7 +293,7 @@ function addDatadogLayers(lambdaFunction, options = {}) {
293
293
  extensionLayerVersion: CDK$2.DATADOG.LAYER.EXTENSION,
294
294
  env: process.env.PROJECT_ENV,
295
295
  service: resolvedService,
296
- version: process.env.PROJECT_VERSION,
296
+ version: process.env.DD_VERSION || process.env.PROJECT_VERSION,
297
297
  });
298
298
  datadogLambda.addLambdaFunctions([lambdaFunction]);
299
299
  return true;
@@ -740,6 +740,7 @@ function jaypieLambdaEnv(options = {}) {
740
740
  // Default environment variables from process.env if present
741
741
  const defaultEnvVars = [
742
742
  "DATADOG_API_KEY_ARN",
743
+ "DD_VERSION",
743
744
  "LOG_LEVEL",
744
745
  "MODULE_LOGGER",
745
746
  "MODULE_LOG_LEVEL",
@@ -1122,16 +1123,18 @@ class JaypieEnvSecret extends JaypieSecret {
1122
1123
  super(scope, idOrEnvKey, props);
1123
1124
  }
1124
1125
  buildSecret(context) {
1125
- const { envKey, id, treatAsEnvKey } = context;
1126
+ const { envKey, id } = context;
1126
1127
  const props = context.props;
1127
1128
  const { consumer = checkEnvIsConsumer$1(), export: exportParam, generateSecretString, provider = checkEnvIsProvider$1(), removalPolicy, roleTag, vendorTag, value, } = props;
1128
1129
  let exportName;
1129
1130
  if (!exportParam) {
1130
- // When shorthand detection is active, use the full construct id (which
1131
- // includes the "EnvSecret_" prefix) so the export name matches what was
1132
- // produced by earlier versions of this construct. Using the raw envKey
1133
- // here produces a shorter name that breaks existing cross-stack imports.
1134
- const exportSource = treatAsEnvKey ? id : envKey || id;
1131
+ // Always derive the export name from the construct id so the name is
1132
+ // stable across both call forms. For shorthand detection the id carries
1133
+ // the "EnvSecret_" prefix; for the explicit (id, { envKey }) form the id
1134
+ // is the caller's construct id. Deriving from envKey instead would change
1135
+ // the export name for an unchanged explicit-form call site across a
1136
+ // version bump and break existing cross-stack imports (issues #347, #365).
1137
+ const exportSource = id;
1135
1138
  exportName = exportEnvName$1(exportSource, process.env, consumer);
1136
1139
  }
1137
1140
  else {