@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.
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as cdk from 'aws-cdk-lib';
|
|
2
|
-
import { Tags, Stack, Fn, CfnOutput, SecretValue,
|
|
2
|
+
import { Tags, Stack, Fn, CfnOutput, SecretValue, RemovalPolicy, Duration, CfnStack } from 'aws-cdk-lib';
|
|
3
3
|
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
4
4
|
import { Bucket, StorageClass, BucketAccessControl, EventType } from 'aws-cdk-lib/aws-s3';
|
|
5
5
|
import { Construct } from 'constructs';
|
|
@@ -911,7 +911,7 @@ class JaypieEnvSecret extends Construct {
|
|
|
911
911
|
process.env[idOrEnvKey] !== "";
|
|
912
912
|
const id = treatAsEnvKey ? `EnvSecret_${idOrEnvKey}` : idOrEnvKey;
|
|
913
913
|
super(scope, id);
|
|
914
|
-
const { consumer = checkEnvIsConsumer$1(), envKey: envKeyProp, export: exportParam, generateSecretString, provider = checkEnvIsProvider$1(), roleTag, vendorTag, value, } = props || {};
|
|
914
|
+
const { consumer = checkEnvIsConsumer$1(), envKey: envKeyProp, export: exportParam, generateSecretString, provider = checkEnvIsProvider$1(), removalPolicy, roleTag, vendorTag, value, } = props || {};
|
|
915
915
|
const envKey = treatAsEnvKey ? idOrEnvKey : envKeyProp;
|
|
916
916
|
this._envKey = envKey;
|
|
917
917
|
let exportName;
|
|
@@ -938,6 +938,14 @@ class JaypieEnvSecret extends Construct {
|
|
|
938
938
|
: undefined,
|
|
939
939
|
};
|
|
940
940
|
this._secret = new secretsmanager.Secret(this, id, secretProps);
|
|
941
|
+
if (removalPolicy !== undefined) {
|
|
942
|
+
const policy = typeof removalPolicy === "boolean"
|
|
943
|
+
? removalPolicy
|
|
944
|
+
? RemovalPolicy.RETAIN
|
|
945
|
+
: RemovalPolicy.DESTROY
|
|
946
|
+
: removalPolicy;
|
|
947
|
+
this._secret.applyRemovalPolicy(policy);
|
|
948
|
+
}
|
|
941
949
|
if (roleTag) {
|
|
942
950
|
Tags.of(this._secret).add(CDK$2.TAG.ROLE, roleTag);
|
|
943
951
|
}
|