cdk-real-drift 0.12.37 → 0.12.38

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
@@ -11,9 +11,9 @@ import { CloudFormationClient, DescribeStackResourcesCommand, DescribeStacksComm
11
11
  import { DescribeAddressesCommand, DescribeClientVpnAuthorizationRulesCommand, DescribeClientVpnEndpointsCommand, DescribeClientVpnTargetNetworksCommand, DescribeLaunchTemplateVersionsCommand, DescribeNetworkAclsCommand, DescribeRouteTablesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVpcEndpointsCommand, EC2Client, ModifyClientVpnEndpointCommand } from "@aws-sdk/client-ec2";
12
12
  import { DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeOptionGroupOptionsCommand, RDSClient } from "@aws-sdk/client-rds";
13
13
  import { DescribeParametersCommand, GetParametersCommand, SSMClient } from "@aws-sdk/client-ssm";
14
+ import { createCredentialChain, fromEnv, fromNodeProviderChain } from "@aws-sdk/credential-providers";
14
15
  import jsonata from "jsonata";
15
16
  import { KMSClient, ListAliasesCommand } from "@aws-sdk/client-kms";
16
- import { createCredentialChain, fromEnv, fromNodeProviderChain } from "@aws-sdk/credential-providers";
17
17
  import { APIGatewayClient, GetAuthorizersCommand, GetGatewayResponsesCommand, GetModelsCommand, GetRequestValidatorsCommand, GetResourcesCommand, GetStagesCommand, UpdateIntegrationCommand, UpdateIntegrationResponseCommand, UpdateMethodResponseCommand, UpdateRestApiCommand } from "@aws-sdk/client-api-gateway";
18
18
  import { AppConfigClient, ListConfigurationProfilesCommand, ListEnvironmentsCommand } from "@aws-sdk/client-appconfig";
19
19
  import { AppSyncClient, ListApiKeysCommand, ListDataSourcesCommand, ListFunctionsCommand, ListResolversCommand, ListTypesCommand } from "@aws-sdk/client-appsync";
@@ -1762,6 +1762,31 @@ async function recordCorpusCase(dir, c) {
1762
1762
  return p;
1763
1763
  }
1764
1764
 
1765
+ //#endregion
1766
+ //#region src/read/client-config.ts
1767
+ /** Port of toolkit-lib awscli-compatible `shouldPrioritizeEnv()` (env creds win over profile). */
1768
+ function shouldPrioritizeEnv() {
1769
+ if (process.env.CDKRD_EXPLICIT_PROFILE) return false;
1770
+ const id = process.env.AWS_ACCESS_KEY_ID || process.env.AMAZON_ACCESS_KEY_ID;
1771
+ const key = process.env.AWS_SECRET_ACCESS_KEY || process.env.AMAZON_SECRET_ACCESS_KEY;
1772
+ return !!id && !!key;
1773
+ }
1774
+ const CLIENT_REQUEST_HANDLER = {
1775
+ connectionTimeout: 6e3,
1776
+ requestTimeout: 6e4,
1777
+ throwOnRequestTimeout: true
1778
+ };
1779
+ const CLIENT_CREDENTIALS = (awsIdentityProperties) => (shouldPrioritizeEnv() ? createCredentialChain(fromEnv(), fromNodeProviderChain({ clientConfig: { requestHandler: CLIENT_REQUEST_HANDLER } })) : fromNodeProviderChain({ clientConfig: { requestHandler: CLIENT_REQUEST_HANDLER } }))(awsIdentityProperties);
1780
+ const CLIENT_TIMEOUTS = {
1781
+ credentials: CLIENT_CREDENTIALS,
1782
+ requestHandler: CLIENT_REQUEST_HANDLER
1783
+ };
1784
+ const READ_RETRY = {
1785
+ maxAttempts: 10,
1786
+ retryMode: "adaptive",
1787
+ ...CLIENT_TIMEOUTS
1788
+ };
1789
+
1765
1790
  //#endregion
1766
1791
  //#region src/normalize/cc-api-strip.ts
1767
1792
  const ALWAYS_STRIPPED = new Set([
@@ -4558,8 +4583,12 @@ async function loadDesired(client, stackName, region, templateOverride, recovery
4558
4583
  const credentials = client.config?.credentials;
4559
4584
  ctx.crossRegionExports = await getCrossRegionExports(new SSMClient(credentials ? {
4560
4585
  region,
4586
+ ...READ_RETRY,
4561
4587
  credentials
4562
- } : { region }), accountId, region, crossRegionExportNames);
4588
+ } : {
4589
+ region,
4590
+ ...READ_RETRY
4591
+ }), accountId, region, crossRegionExportNames);
4563
4592
  } catch (err) {
4564
4593
  const msg = err instanceof Error ? err.message : String(err);
4565
4594
  console.error(`warning: ${stackName}: ssm:GetParameters failed — crossRegionReferences reader GetAtt references (/cdk/exports/*) will resolve UNRESOLVED (their declared properties are skipped, not compared). Grant ssm:GetParameters for full coverage. (${msg})`);
@@ -4705,31 +4734,6 @@ function isLogGroupArnWildcardMatch(desired, actual) {
4705
4734
  return stripLogGroupWildcard(desired) === stripLogGroupWildcard(actual);
4706
4735
  }
4707
4736
 
4708
- //#endregion
4709
- //#region src/read/client-config.ts
4710
- /** Port of toolkit-lib awscli-compatible `shouldPrioritizeEnv()` (env creds win over profile). */
4711
- function shouldPrioritizeEnv() {
4712
- if (process.env.CDKRD_EXPLICIT_PROFILE) return false;
4713
- const id = process.env.AWS_ACCESS_KEY_ID || process.env.AMAZON_ACCESS_KEY_ID;
4714
- const key = process.env.AWS_SECRET_ACCESS_KEY || process.env.AMAZON_SECRET_ACCESS_KEY;
4715
- return !!id && !!key;
4716
- }
4717
- const CLIENT_REQUEST_HANDLER = {
4718
- connectionTimeout: 6e3,
4719
- requestTimeout: 6e4,
4720
- throwOnRequestTimeout: true
4721
- };
4722
- const CLIENT_CREDENTIALS = (awsIdentityProperties) => (shouldPrioritizeEnv() ? createCredentialChain(fromEnv(), fromNodeProviderChain({ clientConfig: { requestHandler: CLIENT_REQUEST_HANDLER } })) : fromNodeProviderChain({ clientConfig: { requestHandler: CLIENT_REQUEST_HANDLER } }))(awsIdentityProperties);
4723
- const CLIENT_TIMEOUTS = {
4724
- credentials: CLIENT_CREDENTIALS,
4725
- requestHandler: CLIENT_REQUEST_HANDLER
4726
- };
4727
- const READ_RETRY = {
4728
- maxAttempts: 10,
4729
- retryMode: "adaptive",
4730
- ...CLIENT_TIMEOUTS
4731
- };
4732
-
4733
4737
  //#endregion
4734
4738
  //#region src/read/kms-aliases.ts
4735
4739
  const cache$1 = /* @__PURE__ */ new Map();
@@ -6744,7 +6748,13 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6744
6748
  } catch {
6745
6749
  liveDefParsed = void 0;
6746
6750
  }
6747
- if (liveDefParsed !== void 0 && deepEqual(liveDefParsed, sfnDefinitionObject)) {
6751
+ let declaredDef = sfnDefinitionObject;
6752
+ if (sfnDefinitionSubstitutions !== void 0) try {
6753
+ declaredDef = JSON.parse(applyDefinitionSubstitutions(JSON.stringify(sfnDefinitionObject), sfnDefinitionSubstitutions));
6754
+ } catch {
6755
+ declaredDef = sfnDefinitionObject;
6756
+ }
6757
+ if (liveDefParsed !== void 0 && deepEqual(liveDefParsed, declaredDef)) {
6748
6758
  findings.push({
6749
6759
  tier: "atDefault",
6750
6760
  logicalId,
@@ -6754,6 +6764,16 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6754
6764
  });
6755
6765
  continue;
6756
6766
  }
6767
+ if (liveDefParsed !== void 0 && deepEqualModuloNonAsciiMask(declaredDef, liveDefParsed)) {
6768
+ findings.push({
6769
+ tier: "readGap",
6770
+ logicalId,
6771
+ resourceType,
6772
+ path: "Definition",
6773
+ note: GETTEMPLATE_MASK_NOTE
6774
+ });
6775
+ continue;
6776
+ }
6757
6777
  }
6758
6778
  const twinSourceKey = SHAPE_ECHO_TWIN[resourceType]?.[k];
6759
6779
  const twinSource = twinSourceKey !== void 0 ? twinSources[twinSourceKey] ?? declared[twinSourceKey] : void 0;
@@ -7686,14 +7706,15 @@ function diffUserPoolGroups(input) {
7686
7706
  const added = [];
7687
7707
  for (const g of liveGroups) {
7688
7708
  if (declared.has(g.name)) continue;
7689
- if (autoGroupNames.has(g.name)) continue;
7709
+ if (autoGroupNames.has(g.name) && g.roleArn === void 0) continue;
7690
7710
  added.push({
7691
7711
  resourceType: "AWS::Cognito::UserPoolGroup",
7692
7712
  identifier: `${userPoolId}|${g.name}`,
7693
7713
  label: g.label ?? g.name,
7694
7714
  live: {
7695
7715
  GroupName: g.name,
7696
- UserPoolId: userPoolId
7716
+ UserPoolId: userPoolId,
7717
+ ...g.roleArn !== void 0 ? { RoleArn: g.roleArn } : {}
7697
7718
  }
7698
7719
  });
7699
7720
  }
@@ -7815,7 +7836,10 @@ async function enumerateUserPoolChildren(ctx) {
7815
7836
  userPoolId,
7816
7837
  declaredGroupNames,
7817
7838
  declaredProviderNames,
7818
- liveGroups: (await pageUserPoolGroups(client, userPoolId)).filter((g) => typeof g.GroupName === "string").map((g) => ({ name: g.GroupName }))
7839
+ liveGroups: (await pageUserPoolGroups(client, userPoolId)).filter((g) => typeof g.GroupName === "string").map((g) => ({
7840
+ name: g.GroupName,
7841
+ roleArn: g.RoleArn
7842
+ }))
7819
7843
  });
7820
7844
  const resourceServerAdded = diffUserPoolResourceServers({
7821
7845
  userPoolId,