@jaypie/constructs 1.2.31 → 1.2.32

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.
@@ -10,6 +10,7 @@ export interface JaypieEnvSecretProps {
10
10
  export?: string;
11
11
  generateSecretString?: secretsmanager.SecretStringGenerator;
12
12
  provider?: boolean;
13
+ removalPolicy?: boolean | RemovalPolicy;
13
14
  roleTag?: string;
14
15
  vendorTag?: string;
15
16
  value?: string;
@@ -945,7 +945,7 @@ class JaypieEnvSecret extends constructs.Construct {
945
945
  process.env[idOrEnvKey] !== "";
946
946
  const id = treatAsEnvKey ? `EnvSecret_${idOrEnvKey}` : idOrEnvKey;
947
947
  super(scope, id);
948
- const { consumer = checkEnvIsConsumer$1(), envKey: envKeyProp, export: exportParam, generateSecretString, provider = checkEnvIsProvider$1(), roleTag, vendorTag, value, } = props || {};
948
+ const { consumer = checkEnvIsConsumer$1(), envKey: envKeyProp, export: exportParam, generateSecretString, provider = checkEnvIsProvider$1(), removalPolicy, roleTag, vendorTag, value, } = props || {};
949
949
  const envKey = treatAsEnvKey ? idOrEnvKey : envKeyProp;
950
950
  this._envKey = envKey;
951
951
  let exportName;
@@ -972,6 +972,14 @@ class JaypieEnvSecret extends constructs.Construct {
972
972
  : undefined,
973
973
  };
974
974
  this._secret = new secretsmanager__namespace.Secret(this, id, secretProps);
975
+ if (removalPolicy !== undefined) {
976
+ const policy = typeof removalPolicy === "boolean"
977
+ ? removalPolicy
978
+ ? cdk.RemovalPolicy.RETAIN
979
+ : cdk.RemovalPolicy.DESTROY
980
+ : removalPolicy;
981
+ this._secret.applyRemovalPolicy(policy);
982
+ }
975
983
  if (roleTag) {
976
984
  cdk.Tags.of(this._secret).add(CDK$2.TAG.ROLE, roleTag);
977
985
  }