cdk-real-drift 0.2.18 → 0.2.20

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 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";
@@ -3572,7 +3573,11 @@ const IDENTITY_KEYED_SUBSET_ARRAYS = {
3572
3573
  Volumes: { idField: "Device" }
3573
3574
  },
3574
3575
  "AWS::Cognito::UserPoolUser": { UserAttributes: { idField: "Name" } },
3575
- "AWS::Route53Resolver::ResolverEndpoint": { IpAddresses: { idField: "SubnetId" } }
3576
+ "AWS::Route53Resolver::ResolverEndpoint": { IpAddresses: { idField: "SubnetId" } },
3577
+ "AWS::EC2::VPNConnection": { VpnTunnelOptionsSpecifications: {
3578
+ idField: "TunnelInsideCidr",
3579
+ foldHuskExtras: true
3580
+ } }
3576
3581
  };
3577
3582
  const NESTED_ARRAY_IDENTITY = {
3578
3583
  "AWS::ApiGateway::Method": {
@@ -4099,7 +4104,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4099
4104
  for (const lEl of live[k]) {
4100
4105
  const id = idOf(lEl);
4101
4106
  if (id !== void 0 && !declaredIds.has(id)) {
4102
- const atDefault = defaultEls && id in defaultEls && deepEqual(lEl, defaultEls[id]);
4107
+ const atDefault = subsetSpec.foldHuskExtras === true && isNestedObject(lEl) && Object.entries(lEl).every(([ek, ev]) => ek === idField || isTrivialEmpty(ev)) || defaultEls && id in defaultEls && deepEqual(lEl, defaultEls[id]);
4103
4108
  findings.push({
4104
4109
  tier: atDefault ? "atDefault" : "undeclared",
4105
4110
  logicalId,
@@ -10207,6 +10212,46 @@ const writeElasticBeanstalkEnvironment = async (ctx, ops) => {
10207
10212
  if (!any) return;
10208
10213
  await new ElasticBeanstalkClient({ region: ctx.region }).send(new UpdateEnvironmentCommand(input));
10209
10214
  };
10215
+ const KVS_STREAM_RETENTION_DEFAULT = 0;
10216
+ const KVS_CHANNEL_MESSAGE_TTL_DEFAULT = 60;
10217
+ const kvsStreamRef = (id) => id.startsWith("arn:") ? { StreamARN: id } : { StreamName: id };
10218
+ const kvsChannelDescribeRef = (id) => id.startsWith("arn:") ? { ChannelARN: id } : { ChannelName: id };
10219
+ const writeKinesisVideoStreamRetention = async (ctx, ops) => {
10220
+ const id = str(ctx.physicalId) ?? str(ctx.declared["Name"]);
10221
+ if (!id) throw new Error("cannot resolve Kinesis Video stream for revert");
10222
+ const op = ops.find((o) => o.path.replace(/^\//, "") === "DataRetentionInHours");
10223
+ if (!op) return;
10224
+ const target = op.op === "add" && typeof op.value === "number" ? op.value : KVS_STREAM_RETENTION_DEFAULT;
10225
+ const kv = new KinesisVideoClient({ region: ctx.region });
10226
+ const desc = await kv.send(new DescribeStreamCommand(kvsStreamRef(id)));
10227
+ const current = desc.StreamInfo?.DataRetentionInHours ?? 0;
10228
+ const version = desc.StreamInfo?.Version;
10229
+ if (version === void 0) throw new Error(`cannot resolve stream version for ${id}`);
10230
+ if (target === current) return;
10231
+ await kv.send(new UpdateDataRetentionCommand({
10232
+ ...kvsStreamRef(id),
10233
+ CurrentVersion: version,
10234
+ Operation: target > current ? "INCREASE_DATA_RETENTION" : "DECREASE_DATA_RETENTION",
10235
+ DataRetentionChangeInHours: Math.abs(target - current)
10236
+ }));
10237
+ };
10238
+ const writeKinesisVideoSignalingChannel = async (ctx, ops) => {
10239
+ const id = str(ctx.physicalId) ?? str(ctx.declared["Name"]);
10240
+ if (!id) throw new Error("cannot resolve Kinesis Video signaling channel for revert");
10241
+ const op = ops.find((o) => o.path.replace(/^\//, "") === "MessageTtlSeconds");
10242
+ if (!op) return;
10243
+ const target = op.op === "add" && typeof op.value === "number" ? op.value : KVS_CHANNEL_MESSAGE_TTL_DEFAULT;
10244
+ const kv = new KinesisVideoClient({ region: ctx.region });
10245
+ const desc = await kv.send(new DescribeSignalingChannelCommand(kvsChannelDescribeRef(id)));
10246
+ const arn = desc.ChannelInfo?.ChannelARN;
10247
+ const version = desc.ChannelInfo?.Version;
10248
+ if (arn === void 0 || version === void 0) throw new Error(`cannot resolve signaling channel ARN/version for ${id}`);
10249
+ await kv.send(new UpdateSignalingChannelCommand({
10250
+ ChannelARN: arn,
10251
+ CurrentVersion: version,
10252
+ SingleMasterConfiguration: { MessageTtlSeconds: target }
10253
+ }));
10254
+ };
10210
10255
  const SDK_WRITERS = {
10211
10256
  "AWS::ElasticBeanstalk::Application": writeElasticBeanstalkApplication,
10212
10257
  "AWS::ElasticBeanstalk::Environment": writeElasticBeanstalkEnvironment,
@@ -10242,6 +10287,8 @@ const SDK_WRITERS = {
10242
10287
  const SDK_PROP_WRITERS = {
10243
10288
  "AWS::Cognito::IdentityPool": { CognitoEvents: writeCognitoIdentityPoolEvents },
10244
10289
  "AWS::Config::ConfigRule": { InputParameters: writeConfigRuleInputParameters },
10290
+ "AWS::KinesisVideo::Stream": { DataRetentionInHours: writeKinesisVideoStreamRetention },
10291
+ "AWS::KinesisVideo::SignalingChannel": { MessageTtlSeconds: writeKinesisVideoSignalingChannel },
10245
10292
  "AWS::MSK::Configuration": { ServerProperties: writeMskConfiguration },
10246
10293
  "AWS::IAM::Role": { Policies: writeIamRoleInlinePolicies },
10247
10294
  "AWS::Logs::LogGroup": { BearerTokenAuthenticationEnabled: writeLogGroupBearerTokenAuth },
@@ -10367,7 +10414,9 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
10367
10414
  "AWS::Cognito::UserPool\0DeletionProtection",
10368
10415
  "AWS::Cognito::UserPool\0MfaConfiguration",
10369
10416
  "AWS::Cognito::UserPool\0UserPoolTier",
10370
- "AWS::SNS::Subscription\0FilterPolicyScope"
10417
+ "AWS::SNS::Subscription\0FilterPolicyScope",
10418
+ "AWS::InternetMonitor::Monitor\0Status",
10419
+ "AWS::RolesAnywhere::Profile\0DurationSeconds"
10371
10420
  ]);
10372
10421
  /**
10373
10422
  * A nested undeclared value (a live sub-key inside a declared object, R96/R98) — a dotted