cdk-real-drift 0.12.37 → 0.12.39

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([
@@ -3935,7 +3960,26 @@ const READGAP_COLLECTION_PATHS = {
3935
3960
  "AWS::DynamoDB::GlobalTable": new Set(["SSESpecification"]),
3936
3961
  "AWS::DynamoDB::Table": new Set(["SSESpecification"]),
3937
3962
  "AWS::CertificateManager::Certificate": new Set(["DomainValidationOptions"]),
3938
- "AWS::EC2::ClientVpnEndpoint": new Set(["TagSpecifications"])
3963
+ "AWS::EC2::ClientVpnEndpoint": new Set(["TagSpecifications"]),
3964
+ "AWS::DMS::Endpoint": new Set([
3965
+ "DocDbSettings",
3966
+ "DynamoDbSettings",
3967
+ "ElasticsearchSettings",
3968
+ "GcpMySQLSettings",
3969
+ "IbmDb2Settings",
3970
+ "KafkaSettings",
3971
+ "KinesisSettings",
3972
+ "MicrosoftSqlServerSettings",
3973
+ "MongoDbSettings",
3974
+ "MySqlSettings",
3975
+ "NeptuneSettings",
3976
+ "OracleSettings",
3977
+ "PostgreSqlSettings",
3978
+ "RedisSettings",
3979
+ "RedshiftSettings",
3980
+ "S3Settings",
3981
+ "SybaseSettings"
3982
+ ])
3939
3983
  };
3940
3984
  const SCALAR_RETURNED_WHEN_SET = {
3941
3985
  "AWS::NetworkFirewall::RuleGroup": new Set(["Description"]),
@@ -4558,8 +4602,12 @@ async function loadDesired(client, stackName, region, templateOverride, recovery
4558
4602
  const credentials = client.config?.credentials;
4559
4603
  ctx.crossRegionExports = await getCrossRegionExports(new SSMClient(credentials ? {
4560
4604
  region,
4605
+ ...READ_RETRY,
4561
4606
  credentials
4562
- } : { region }), accountId, region, crossRegionExportNames);
4607
+ } : {
4608
+ region,
4609
+ ...READ_RETRY
4610
+ }), accountId, region, crossRegionExportNames);
4563
4611
  } catch (err) {
4564
4612
  const msg = err instanceof Error ? err.message : String(err);
4565
4613
  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 +4753,6 @@ function isLogGroupArnWildcardMatch(desired, actual) {
4705
4753
  return stripLogGroupWildcard(desired) === stripLogGroupWildcard(actual);
4706
4754
  }
4707
4755
 
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
4756
  //#endregion
4734
4757
  //#region src/read/kms-aliases.ts
4735
4758
  const cache$1 = /* @__PURE__ */ new Map();
@@ -6744,7 +6767,13 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6744
6767
  } catch {
6745
6768
  liveDefParsed = void 0;
6746
6769
  }
6747
- if (liveDefParsed !== void 0 && deepEqual(liveDefParsed, sfnDefinitionObject)) {
6770
+ let declaredDef = sfnDefinitionObject;
6771
+ if (sfnDefinitionSubstitutions !== void 0) try {
6772
+ declaredDef = JSON.parse(applyDefinitionSubstitutions(JSON.stringify(sfnDefinitionObject), sfnDefinitionSubstitutions));
6773
+ } catch {
6774
+ declaredDef = sfnDefinitionObject;
6775
+ }
6776
+ if (liveDefParsed !== void 0 && deepEqual(liveDefParsed, declaredDef)) {
6748
6777
  findings.push({
6749
6778
  tier: "atDefault",
6750
6779
  logicalId,
@@ -6754,6 +6783,16 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6754
6783
  });
6755
6784
  continue;
6756
6785
  }
6786
+ if (liveDefParsed !== void 0 && deepEqualModuloNonAsciiMask(declaredDef, liveDefParsed)) {
6787
+ findings.push({
6788
+ tier: "readGap",
6789
+ logicalId,
6790
+ resourceType,
6791
+ path: "Definition",
6792
+ note: GETTEMPLATE_MASK_NOTE
6793
+ });
6794
+ continue;
6795
+ }
6757
6796
  }
6758
6797
  const twinSourceKey = SHAPE_ECHO_TWIN[resourceType]?.[k];
6759
6798
  const twinSource = twinSourceKey !== void 0 ? twinSources[twinSourceKey] ?? declared[twinSourceKey] : void 0;
@@ -7686,14 +7725,15 @@ function diffUserPoolGroups(input) {
7686
7725
  const added = [];
7687
7726
  for (const g of liveGroups) {
7688
7727
  if (declared.has(g.name)) continue;
7689
- if (autoGroupNames.has(g.name)) continue;
7728
+ if (autoGroupNames.has(g.name) && g.roleArn === void 0) continue;
7690
7729
  added.push({
7691
7730
  resourceType: "AWS::Cognito::UserPoolGroup",
7692
7731
  identifier: `${userPoolId}|${g.name}`,
7693
7732
  label: g.label ?? g.name,
7694
7733
  live: {
7695
7734
  GroupName: g.name,
7696
- UserPoolId: userPoolId
7735
+ UserPoolId: userPoolId,
7736
+ ...g.roleArn !== void 0 ? { RoleArn: g.roleArn } : {}
7697
7737
  }
7698
7738
  });
7699
7739
  }
@@ -7815,7 +7855,10 @@ async function enumerateUserPoolChildren(ctx) {
7815
7855
  userPoolId,
7816
7856
  declaredGroupNames,
7817
7857
  declaredProviderNames,
7818
- liveGroups: (await pageUserPoolGroups(client, userPoolId)).filter((g) => typeof g.GroupName === "string").map((g) => ({ name: g.GroupName }))
7858
+ liveGroups: (await pageUserPoolGroups(client, userPoolId)).filter((g) => typeof g.GroupName === "string").map((g) => ({
7859
+ name: g.GroupName,
7860
+ roleArn: g.RoleArn
7861
+ }))
7819
7862
  });
7820
7863
  const resourceServerAdded = diffUserPoolResourceServers({
7821
7864
  userPoolId,