cdk-real-drift 0.2.18 → 0.2.19
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/cli.js +46 -1
- package/dist/cli.js.map +1 -1
- package/package.json +2 -1
package/dist/cli.js
CHANGED
|
@@ -50,6 +50,7 @@ import { S_BAR, S_BAR_END, S_BAR_START, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED
|
|
|
50
50
|
import pc from "picocolors";
|
|
51
51
|
import { MultiSelectPrompt, Prompt, isCancel as isCancel$1 } from "@clack/core";
|
|
52
52
|
import { CloudFrontClient, GetDistributionConfigCommand, UpdateDistributionCommand } from "@aws-sdk/client-cloudfront";
|
|
53
|
+
import { DescribeSignalingChannelCommand, DescribeStreamCommand, KinesisVideoClient, UpdateDataRetentionCommand, UpdateSignalingChannelCommand } from "@aws-sdk/client-kinesis-video";
|
|
53
54
|
import { DescribeDomainConfigCommand, OpenSearchClient, UpdateDomainConfigCommand } from "@aws-sdk/client-opensearch";
|
|
54
55
|
import { GetWebACLCommand, UpdateWebACLCommand, WAFV2Client } from "@aws-sdk/client-wafv2";
|
|
55
56
|
import { ConfigServiceClient, DescribeConfigRulesCommand, PutConfigRuleCommand } from "@aws-sdk/client-config-service";
|
|
@@ -10207,6 +10208,46 @@ const writeElasticBeanstalkEnvironment = async (ctx, ops) => {
|
|
|
10207
10208
|
if (!any) return;
|
|
10208
10209
|
await new ElasticBeanstalkClient({ region: ctx.region }).send(new UpdateEnvironmentCommand(input));
|
|
10209
10210
|
};
|
|
10211
|
+
const KVS_STREAM_RETENTION_DEFAULT = 0;
|
|
10212
|
+
const KVS_CHANNEL_MESSAGE_TTL_DEFAULT = 60;
|
|
10213
|
+
const kvsStreamRef = (id) => id.startsWith("arn:") ? { StreamARN: id } : { StreamName: id };
|
|
10214
|
+
const kvsChannelDescribeRef = (id) => id.startsWith("arn:") ? { ChannelARN: id } : { ChannelName: id };
|
|
10215
|
+
const writeKinesisVideoStreamRetention = async (ctx, ops) => {
|
|
10216
|
+
const id = str(ctx.physicalId) ?? str(ctx.declared["Name"]);
|
|
10217
|
+
if (!id) throw new Error("cannot resolve Kinesis Video stream for revert");
|
|
10218
|
+
const op = ops.find((o) => o.path.replace(/^\//, "") === "DataRetentionInHours");
|
|
10219
|
+
if (!op) return;
|
|
10220
|
+
const target = op.op === "add" && typeof op.value === "number" ? op.value : KVS_STREAM_RETENTION_DEFAULT;
|
|
10221
|
+
const kv = new KinesisVideoClient({ region: ctx.region });
|
|
10222
|
+
const desc = await kv.send(new DescribeStreamCommand(kvsStreamRef(id)));
|
|
10223
|
+
const current = desc.StreamInfo?.DataRetentionInHours ?? 0;
|
|
10224
|
+
const version = desc.StreamInfo?.Version;
|
|
10225
|
+
if (version === void 0) throw new Error(`cannot resolve stream version for ${id}`);
|
|
10226
|
+
if (target === current) return;
|
|
10227
|
+
await kv.send(new UpdateDataRetentionCommand({
|
|
10228
|
+
...kvsStreamRef(id),
|
|
10229
|
+
CurrentVersion: version,
|
|
10230
|
+
Operation: target > current ? "INCREASE_DATA_RETENTION" : "DECREASE_DATA_RETENTION",
|
|
10231
|
+
DataRetentionChangeInHours: Math.abs(target - current)
|
|
10232
|
+
}));
|
|
10233
|
+
};
|
|
10234
|
+
const writeKinesisVideoSignalingChannel = async (ctx, ops) => {
|
|
10235
|
+
const id = str(ctx.physicalId) ?? str(ctx.declared["Name"]);
|
|
10236
|
+
if (!id) throw new Error("cannot resolve Kinesis Video signaling channel for revert");
|
|
10237
|
+
const op = ops.find((o) => o.path.replace(/^\//, "") === "MessageTtlSeconds");
|
|
10238
|
+
if (!op) return;
|
|
10239
|
+
const target = op.op === "add" && typeof op.value === "number" ? op.value : KVS_CHANNEL_MESSAGE_TTL_DEFAULT;
|
|
10240
|
+
const kv = new KinesisVideoClient({ region: ctx.region });
|
|
10241
|
+
const desc = await kv.send(new DescribeSignalingChannelCommand(kvsChannelDescribeRef(id)));
|
|
10242
|
+
const arn = desc.ChannelInfo?.ChannelARN;
|
|
10243
|
+
const version = desc.ChannelInfo?.Version;
|
|
10244
|
+
if (arn === void 0 || version === void 0) throw new Error(`cannot resolve signaling channel ARN/version for ${id}`);
|
|
10245
|
+
await kv.send(new UpdateSignalingChannelCommand({
|
|
10246
|
+
ChannelARN: arn,
|
|
10247
|
+
CurrentVersion: version,
|
|
10248
|
+
SingleMasterConfiguration: { MessageTtlSeconds: target }
|
|
10249
|
+
}));
|
|
10250
|
+
};
|
|
10210
10251
|
const SDK_WRITERS = {
|
|
10211
10252
|
"AWS::ElasticBeanstalk::Application": writeElasticBeanstalkApplication,
|
|
10212
10253
|
"AWS::ElasticBeanstalk::Environment": writeElasticBeanstalkEnvironment,
|
|
@@ -10242,6 +10283,8 @@ const SDK_WRITERS = {
|
|
|
10242
10283
|
const SDK_PROP_WRITERS = {
|
|
10243
10284
|
"AWS::Cognito::IdentityPool": { CognitoEvents: writeCognitoIdentityPoolEvents },
|
|
10244
10285
|
"AWS::Config::ConfigRule": { InputParameters: writeConfigRuleInputParameters },
|
|
10286
|
+
"AWS::KinesisVideo::Stream": { DataRetentionInHours: writeKinesisVideoStreamRetention },
|
|
10287
|
+
"AWS::KinesisVideo::SignalingChannel": { MessageTtlSeconds: writeKinesisVideoSignalingChannel },
|
|
10245
10288
|
"AWS::MSK::Configuration": { ServerProperties: writeMskConfiguration },
|
|
10246
10289
|
"AWS::IAM::Role": { Policies: writeIamRoleInlinePolicies },
|
|
10247
10290
|
"AWS::Logs::LogGroup": { BearerTokenAuthenticationEnabled: writeLogGroupBearerTokenAuth },
|
|
@@ -10367,7 +10410,9 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
|
|
|
10367
10410
|
"AWS::Cognito::UserPool\0DeletionProtection",
|
|
10368
10411
|
"AWS::Cognito::UserPool\0MfaConfiguration",
|
|
10369
10412
|
"AWS::Cognito::UserPool\0UserPoolTier",
|
|
10370
|
-
"AWS::SNS::Subscription\0FilterPolicyScope"
|
|
10413
|
+
"AWS::SNS::Subscription\0FilterPolicyScope",
|
|
10414
|
+
"AWS::InternetMonitor::Monitor\0Status",
|
|
10415
|
+
"AWS::RolesAnywhere::Profile\0DurationSeconds"
|
|
10371
10416
|
]);
|
|
10372
10417
|
/**
|
|
10373
10418
|
* A nested undeclared value (a live sub-key inside a declared object, R96/R98) — a dotted
|