cdk-real-drift 0.12.6 → 0.12.8

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
@@ -2837,6 +2837,7 @@ const CONTEXT_ARN_DEFAULTS = {
2837
2837
  "AWS::CodeBuild::Project": { EncryptionKey: "arn:{partition}:kms:{region}:{accountId}:alias/aws/s3" },
2838
2838
  "AWS::SSM::MaintenanceWindowTask": { ServiceRoleArn: "arn:{partition}:iam::{accountId}:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM" },
2839
2839
  "AWS::LakeFormation::Tag": { CatalogId: "{accountId}" },
2840
+ "AWS::LakeFormation::PrincipalPermissions": { Catalog: "{accountId}" },
2840
2841
  "AWS::S3::AccessPoint": { BucketAccountId: "{accountId}" },
2841
2842
  "AWS::EC2::VPCPeeringConnection": { PeerOwnerId: "{accountId}" },
2842
2843
  "AWS::Chatbot::SlackChannelConfiguration": { GuardrailPolicies: ["arn:{partition}:iam::aws:policy/AdministratorAccess"] }
@@ -3231,7 +3232,12 @@ function stripAsymmetricIdentityFields(declared, live) {
3231
3232
  }
3232
3233
  const ORDER_SIGNIFICANT_ARRAY_KEYS = {
3233
3234
  "AWS::CodePipeline::Pipeline": new Set(["Stages", "Actions"]),
3234
- "AWS::Logs::Transformer": new Set(["TransformerConfig"])
3235
+ "AWS::Logs::Transformer": new Set(["TransformerConfig"]),
3236
+ "AWS::SSMContacts::Plan": new Set(["Stages"])
3237
+ };
3238
+ const ORDER_SIGNIFICANT_PATHS = {
3239
+ "AWS::Scheduler::Schedule": new Set(["Target.EcsParameters.PlacementStrategy"]),
3240
+ "AWS::AppSync::Resolver": new Set(["PipelineConfig.Functions"])
3235
3241
  };
3236
3242
  function canonicalizeTagListsDeep(v, orderSig) {
3237
3243
  return canonicalizeTagLists(v, orderSig, void 0);
@@ -5548,8 +5554,12 @@ function sortUnorderedSetProps(model, resourceType, schemaObjectArrayKeys = [],
5548
5554
  const objKeys = new Set([...UNORDERED_OBJECT_ARRAY_PROPS[resourceType] ?? [], ...schemaObjectArrayKeys]);
5549
5555
  const orderSig = ORDER_SIGNIFICANT_ARRAY_KEYS[resourceType];
5550
5556
  for (const k of objKeys) if (!orderSig?.has(k) && Array.isArray(model[k])) model[k] = sortUnorderedObjectArray(model[k]);
5551
- for (const path of [...UNORDERED_ARRAY_PROPS[resourceType] ?? [], ...schemaScalarPaths]) if (path.includes(".")) sortScalarSetAtNestedPath(model, path.split("."));
5552
- else if (path in model) model[path] = sortScalarSet(model[path]);
5557
+ const orderSigPaths = ORDER_SIGNIFICANT_PATHS[resourceType];
5558
+ for (const path of [...UNORDERED_ARRAY_PROPS[resourceType] ?? [], ...schemaScalarPaths]) {
5559
+ if (orderSigPaths?.has(path)) continue;
5560
+ if (path.includes(".")) sortScalarSetAtNestedPath(model, path.split("."));
5561
+ else if (path in model) model[path] = sortScalarSet(model[path]);
5562
+ }
5553
5563
  }
5554
5564
  function normalizeLiveModel(liveRaw, schema, opts = {}) {
5555
5565
  const oaiMap = opts.oaiCanonicalIds ?? {};
@@ -6161,7 +6171,8 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6161
6171
  const subsetSpec = IDENTITY_KEYED_SUBSET_ARRAYS[resourceType]?.[k];
6162
6172
  const unorderedObjArray = !(ORDER_SIGNIFICANT_ARRAY_KEYS[resourceType]?.has(k) ?? false) && (UNORDERED_OBJECT_ARRAY_PROPS[resourceType]?.has(k) || (schema.unorderedObjectArrayPaths?.includes(k) ?? false));
6163
6173
  const nestedUnordered = UNORDERED_NESTED_OBJECT_ARRAY_PATHS[resourceType];
6164
- const nestedSubPaths = [...new Set([...nestedUnordered ?? [], ...schema.unorderedObjectArrayPaths ?? []].filter((p) => p.startsWith(`${k}.`)).map((p) => p.slice(k.length + 1)))];
6174
+ const orderSigPathsForType = ORDER_SIGNIFICANT_PATHS[resourceType];
6175
+ const nestedSubPaths = [...new Set([...nestedUnordered ?? [], ...schema.unorderedObjectArrayPaths ?? []].filter((p) => p.startsWith(`${k}.`) && !orderSigPathsForType?.has(p)).map((p) => p.slice(k.length + 1)))];
6165
6176
  let declaredVal = v;
6166
6177
  let liveVal = live[k];
6167
6178
  let declaredRemapSource;
@@ -6304,7 +6315,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6304
6315
  if (VERSION_PREFIX_PATHS[resourceType]?.has(d.path) && isVersionPrefixMatch(d.stateValue, d.awsValue)) continue;
6305
6316
  if (LATEST_SENTINEL_PATHS[resourceType]?.has(d.path) && isLatestSentinelMatch(d.stateValue, d.awsValue)) continue;
6306
6317
  if (INTELLIGENT_TIERING_PATHS[resourceType]?.has(d.path) && isIntelligentTieringMatch(d.stateValue, d.awsValue)) continue;
6307
- if ((UNORDERED_ARRAY_PROPS[resourceType]?.has(d.path) || UNORDERED_ARRAY_PROPS[resourceType]?.has(d.path.replace(/\.\d+(?=\.|$)/g, ".*")) || schema.unorderedScalarPaths?.includes(d.path)) && isEqualUnorderedScalarSet(d.stateValue, d.awsValue)) continue;
6318
+ if ((UNORDERED_ARRAY_PROPS[resourceType]?.has(d.path) || UNORDERED_ARRAY_PROPS[resourceType]?.has(d.path.replace(/\.\d+(?=\.|$)/g, ".*")) || schema.unorderedScalarPaths?.includes(d.path)) && !ORDER_SIGNIFICANT_PATHS[resourceType]?.has(d.path) && isEqualUnorderedScalarSet(d.stateValue, d.awsValue)) continue;
6308
6319
  if (isTrivialEmpty(d.stateValue) && d.path in knownDef && deepEqual(d.awsValue, knownDef[d.path]) && !(MEANINGFUL_WHEN_OFF[resourceType]?.[d.path]?.({
6309
6320
  declared,
6310
6321
  live
@@ -8495,12 +8506,16 @@ async function enumerateEfsFileSystemChildren(ctx) {
8495
8506
  }))
8496
8507
  });
8497
8508
  }
8509
+ function isImplicitClusterMemberName(clusterId, instanceId) {
8510
+ const escaped = clusterId.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
8511
+ return new RegExp(`^${escaped}-instance-\\d+$`).test(instanceId);
8512
+ }
8498
8513
  function diffRdsClusterChildren(input) {
8499
8514
  const declared = new Set(input.declaredInstanceIds);
8500
8515
  const clusterMembers = new Set(input.clusterMemberIds);
8501
8516
  const added = [];
8502
8517
  for (const i of input.liveInstances) {
8503
- if (declared.has(i.id) || clusterMembers.has(i.id)) continue;
8518
+ if (declared.has(i.id) || clusterMembers.has(i.id) && isImplicitClusterMemberName(input.clusterId, i.id)) continue;
8504
8519
  added.push({
8505
8520
  resourceType: "AWS::RDS::DBInstance",
8506
8521
  identifier: i.id,
@@ -8545,6 +8560,7 @@ async function enumerateRdsClusterChildren(ctx) {
8545
8560
  });
8546
8561
  const [instances, clusterMemberIds] = await Promise.all([pageDbInstances(client, clusterId), describeClusterMemberIds(client, clusterId)]);
8547
8562
  return diffRdsClusterChildren({
8563
+ clusterId,
8548
8564
  declaredInstanceIds,
8549
8565
  liveInstances: instances.filter((i) => typeof i.DBInstanceIdentifier === "string" && !isAasManagedReader(i.DBInstanceIdentifier)).map((i) => ({
8550
8566
  id: i.DBInstanceIdentifier,