@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.
@@ -329,7 +329,7 @@ function addDatadogLayers(lambdaFunction, options = {}) {
329
329
  extensionLayerVersion: CDK$2.DATADOG.LAYER.EXTENSION,
330
330
  env: process.env.PROJECT_ENV,
331
331
  service: resolvedService,
332
- version: process.env.PROJECT_VERSION,
332
+ version: process.env.DD_VERSION || process.env.PROJECT_VERSION,
333
333
  });
334
334
  datadogLambda.addLambdaFunctions([lambdaFunction]);
335
335
  return true;
@@ -776,6 +776,7 @@ function jaypieLambdaEnv(options = {}) {
776
776
  // Default environment variables from process.env if present
777
777
  const defaultEnvVars = [
778
778
  "DATADOG_API_KEY_ARN",
779
+ "DD_VERSION",
779
780
  "LOG_LEVEL",
780
781
  "MODULE_LOGGER",
781
782
  "MODULE_LOG_LEVEL",
@@ -1158,16 +1159,18 @@ class JaypieEnvSecret extends JaypieSecret {
1158
1159
  super(scope, idOrEnvKey, props);
1159
1160
  }
1160
1161
  buildSecret(context) {
1161
- const { envKey, id, treatAsEnvKey } = context;
1162
+ const { envKey, id } = context;
1162
1163
  const props = context.props;
1163
1164
  const { consumer = checkEnvIsConsumer$1(), export: exportParam, generateSecretString, provider = checkEnvIsProvider$1(), removalPolicy, roleTag, vendorTag, value, } = props;
1164
1165
  let exportName;
1165
1166
  if (!exportParam) {
1166
- // When shorthand detection is active, use the full construct id (which
1167
- // includes the "EnvSecret_" prefix) so the export name matches what was
1168
- // produced by earlier versions of this construct. Using the raw envKey
1169
- // here produces a shorter name that breaks existing cross-stack imports.
1170
- const exportSource = treatAsEnvKey ? id : envKey || id;
1167
+ // Always derive the export name from the construct id so the name is
1168
+ // stable across both call forms. For shorthand detection the id carries
1169
+ // the "EnvSecret_" prefix; for the explicit (id, { envKey }) form the id
1170
+ // is the caller's construct id. Deriving from envKey instead would change
1171
+ // the export name for an unchanged explicit-form call site across a
1172
+ // version bump and break existing cross-stack imports (issues #347, #365).
1173
+ const exportSource = id;
1171
1174
  exportName = exportEnvName$1(exportSource, process.env, consumer);
1172
1175
  }
1173
1176
  else {