cdk-real-drift 0.10.3 → 0.11.0

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/README.md CHANGED
@@ -892,7 +892,8 @@ covers them. **If you never run `revert`, cdkrd needs no write permissions at al
892
892
  `lambda:ListVersionsByFunction`
893
893
  - `AWS::Events::EventBus`: `events:ListRules`
894
894
  - `AWS::Cognito::UserPool`: `cognito-idp:ListUserPoolClients`,
895
- `cognito-idp:ListGroups`, `cognito-idp:ListResourceServers`
895
+ `cognito-idp:ListGroups`, `cognito-idp:ListResourceServers`,
896
+ `cognito-idp:ListIdentityProviders`
896
897
  - `AWS::AppSync::GraphQLApi`: `appsync:ListDataSources`, `appsync:ListResolvers`,
897
898
  `appsync:ListFunctions`, `appsync:ListTypes`
898
899
  - `AWS::Logs::LogGroup`: `logs:DescribeSubscriptionFilters` (plus
package/dist/cli.js CHANGED
@@ -9,6 +9,7 @@ import { homedir } from "node:os";
9
9
  import { BaseCredentials, CdkAppMultiContext, NonInteractiveIoHost, StackSelectionStrategy, Toolkit } from "@aws-cdk/toolkit-lib";
10
10
  import { CloudFormationClient, DescribeStackResourcesCommand, DescribeStacksCommand, DescribeTypeCommand, GetTemplateCommand, ListExportsCommand, ListStackResourcesCommand } from "@aws-sdk/client-cloudformation";
11
11
  import { DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeOptionGroupOptionsCommand, RDSClient } from "@aws-sdk/client-rds";
12
+ import { DescribeParametersCommand, GetParametersCommand, SSMClient } from "@aws-sdk/client-ssm";
12
13
  import jsonata from "jsonata";
13
14
  import { KMSClient, ListAliasesCommand } from "@aws-sdk/client-kms";
14
15
  import { createCredentialChain, fromEnv, fromNodeProviderChain } from "@aws-sdk/credential-providers";
@@ -17,7 +18,7 @@ import { AppConfigClient, ListConfigurationProfilesCommand, ListEnvironmentsComm
17
18
  import { AppSyncClient, ListApiKeysCommand, ListDataSourcesCommand, ListFunctionsCommand, ListResolversCommand, ListTypesCommand } from "@aws-sdk/client-appsync";
18
19
  import { ApiGatewayV2Client, DeleteAccessLogSettingsCommand, DeleteRouteSettingsCommand, GetAuthorizersCommand as GetAuthorizersCommand$1, GetIntegrationsCommand, GetRoutesCommand, GetStagesCommand as GetStagesCommand$1, UpdateStageCommand } from "@aws-sdk/client-apigatewayv2";
19
20
  import { CloudWatchLogsClient, DescribeMetricFiltersCommand, DescribeSubscriptionFiltersCommand, PutBearerTokenAuthenticationCommand, PutMetricFilterCommand } from "@aws-sdk/client-cloudwatch-logs";
20
- import { CognitoIdentityProviderClient, ListGroupsCommand, ListResourceServersCommand, ListUserPoolClientsCommand } from "@aws-sdk/client-cognito-identity-provider";
21
+ import { CognitoIdentityProviderClient, ListGroupsCommand, ListIdentityProvidersCommand, ListResourceServersCommand, ListUserPoolClientsCommand } from "@aws-sdk/client-cognito-identity-provider";
21
22
  import { DescribeAddressesCommand, DescribeClientVpnAuthorizationRulesCommand, DescribeClientVpnEndpointsCommand, DescribeClientVpnTargetNetworksCommand, DescribeLaunchTemplateVersionsCommand, DescribeNetworkAclsCommand, DescribeRouteTablesCommand, DescribeSubnetsCommand, DescribeVpcEndpointsCommand, EC2Client, ModifyClientVpnEndpointCommand } from "@aws-sdk/client-ec2";
22
23
  import { DescribeServicesCommand, ECSClient, ListServicesCommand, UpdateServiceCommand } from "@aws-sdk/client-ecs";
23
24
  import { DescribeMountTargetsCommand, EFSClient } from "@aws-sdk/client-efs";
@@ -32,22 +33,21 @@ import { DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApp
32
33
  import { CognitoSyncClient, GetCognitoEventsCommand, SetCognitoEventsCommand } from "@aws-sdk/client-cognito-sync";
33
34
  import { BatchGetProjectsCommand, BatchGetReportGroupsCommand, CodeBuildClient, UpdateReportGroupCommand } from "@aws-sdk/client-codebuild";
34
35
  import { DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DocDBClient, ModifyDBClusterCommand, ModifyDBInstanceCommand } from "@aws-sdk/client-docdb";
35
- import { DAXClient, DescribeClustersCommand, DescribeParameterGroupsCommand, DescribeParametersCommand, DescribeSubnetGroupsCommand, UpdateClusterCommand, UpdateParameterGroupCommand } from "@aws-sdk/client-dax";
36
+ import { DAXClient, DescribeClustersCommand, DescribeParameterGroupsCommand, DescribeParametersCommand as DescribeParametersCommand$1, DescribeSubnetGroupsCommand, UpdateClusterCommand, UpdateParameterGroupCommand } from "@aws-sdk/client-dax";
36
37
  import { GetClassifierCommand, GetConnectionCommand, GetJobCommand, GetSecurityConfigurationCommand, GetTableCommand, GetWorkflowCommand, GlueClient, UpdateClassifierCommand, UpdateConnectionCommand, UpdateJobCommand, UpdateTableCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
37
38
  import { AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreatePolicyVersionCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetGroupPolicyCommand, GetPolicyCommand as GetPolicyCommand$1, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListEntitiesForPolicyCommand, ListPolicyVersionsCommand, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPolicyCommand } from "@aws-sdk/client-iam";
38
39
  import { DeleteBucketPolicyCommand, GetBucketPolicyCommand, PutBucketPolicyCommand, S3Client } from "@aws-sdk/client-s3";
39
40
  import { DescribeCacheClustersCommand, DescribeCacheParameterGroupsCommand, DescribeCacheParametersCommand, DescribeReplicationGroupsCommand, DescribeUsersCommand, ElastiCacheClient, ModifyCacheParameterGroupCommand, ResetCacheParameterGroupCommand } from "@aws-sdk/client-elasticache";
40
- import { DescribeParameterGroupsCommand as DescribeParameterGroupsCommand$1, DescribeParametersCommand as DescribeParametersCommand$1, DescribeUsersCommand as DescribeUsersCommand$1, MemoryDBClient, ResetParameterGroupCommand, UpdateParameterGroupCommand as UpdateParameterGroupCommand$1 } from "@aws-sdk/client-memorydb";
41
+ import { DescribeParameterGroupsCommand as DescribeParameterGroupsCommand$1, DescribeParametersCommand as DescribeParametersCommand$2, DescribeUsersCommand as DescribeUsersCommand$1, MemoryDBClient, ResetParameterGroupCommand, UpdateParameterGroupCommand as UpdateParameterGroupCommand$1 } from "@aws-sdk/client-memorydb";
41
42
  import { CloudWatchClient, DescribeAnomalyDetectorsCommand, PutAnomalyDetectorCommand } from "@aws-sdk/client-cloudwatch";
42
43
  import { DLMClient, GetLifecyclePolicyCommand, UpdateLifecyclePolicyCommand } from "@aws-sdk/client-dlm";
43
- import { DatabaseMigrationServiceClient, DescribeEndpointsCommand, DescribeReplicationSubnetGroupsCommand } from "@aws-sdk/client-database-migration-service";
44
+ import { DatabaseMigrationServiceClient, DescribeEndpointsCommand, DescribeReplicationInstancesCommand, DescribeReplicationSubnetGroupsCommand, DescribeReplicationTasksCommand } from "@aws-sdk/client-database-migration-service";
44
45
  import { GetJobTemplateCommand, GetQueueCommand, MediaConvertClient } from "@aws-sdk/client-mediaconvert";
45
46
  import { DescribeConfigurationCommand, DescribeConfigurationRevisionCommand, KafkaClient, UpdateConfigurationCommand } from "@aws-sdk/client-kafka";
46
47
  import { GetWorkgroupCommand, RedshiftServerlessClient } from "@aws-sdk/client-redshift-serverless";
47
48
  import { BuildBotLocaleCommand, CreateIntentCommand, CreateSlotCommand, CreateSlotTypeCommand, DeleteIntentCommand, DeleteSlotCommand, DeleteSlotTypeCommand, DescribeBotLocaleCommand, DescribeIntentCommand, DescribeSlotCommand, DescribeSlotTypeCommand, LexModelsV2Client, ListBotLocalesCommand, ListIntentsCommand, ListSlotTypesCommand, ListSlotsCommand, UpdateBotLocaleCommand, UpdateIntentCommand, UpdateSlotCommand, UpdateSlotTypeCommand } from "@aws-sdk/client-lex-models-v2";
48
49
  import { GetScheduleCommand, SchedulerClient } from "@aws-sdk/client-scheduler";
49
50
  import { DescribeReceiptRuleCommand, DescribeReceiptRuleSetCommand, ListReceiptFiltersCommand, SESClient, UpdateReceiptRuleCommand } from "@aws-sdk/client-ses";
50
- import { DescribeParametersCommand as DescribeParametersCommand$2, SSMClient } from "@aws-sdk/client-ssm";
51
51
  import { DescribeEndpointConfigCommand, SageMakerClient } from "@aws-sdk/client-sagemaker";
52
52
  import { GetNamespaceCommand, GetServiceCommand, ServiceDiscoveryClient, UpdateHttpNamespaceCommand } from "@aws-sdk/client-servicediscovery";
53
53
  import { GetQueueAttributesCommand, SQSClient, SetQueueAttributesCommand } from "@aws-sdk/client-sqs";
@@ -1455,6 +1455,11 @@ function resolveGetAtt(v, ctx) {
1455
1455
  const logicalId = String(v[0]);
1456
1456
  const attr = String(v[1]);
1457
1457
  const type = ctx.typeOf?.[logicalId];
1458
+ if (attr.startsWith("/cdk/exports/") && (type === void 0 || type === "Custom::CrossRegionExportReader")) {
1459
+ const val = ctx.crossRegionExports?.[attr];
1460
+ if (typeof val === "string") return val;
1461
+ return UNRESOLVED;
1462
+ }
1458
1463
  const declaredKey = type ? GETATT_DECLARED_PROPERTY[type]?.[attr] : void 0;
1459
1464
  if (declaredKey !== void 0) {
1460
1465
  const rawProps = ctx.declaredRawProps?.[logicalId];
@@ -3133,6 +3138,11 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
3133
3138
  "ConfigParameters",
3134
3139
  "SecurityGroupIds",
3135
3140
  "SubnetIds"
3141
+ ]),
3142
+ "AWS::CloudFormation::Stack": new Set([
3143
+ "TemplateBody",
3144
+ "RoleARN",
3145
+ "Capabilities"
3136
3146
  ])
3137
3147
  };
3138
3148
  function isPhysicalIdSegment(value, physicalId) {
@@ -4309,6 +4319,63 @@ async function listExports(client, accountId, region) {
4309
4319
  exportsCache.set(cacheKey, exports);
4310
4320
  return exports;
4311
4321
  }
4322
+ const crossRegionExportsCache = /* @__PURE__ */ new Map();
4323
+ const CROSS_REGION_EXPORT_READER_TYPE = "Custom::CrossRegionExportReader";
4324
+ /**
4325
+ * Scan the parsed template for `Fn::GetAtt` references whose logicalId is a
4326
+ * `Custom::CrossRegionExportReader` resource and whose attribute is an SSM parameter name
4327
+ * (`/cdk/exports/<name>`). Returns the DISTINCT parameter names to prefetch. Pure + exported
4328
+ * for unit tests. Both GetAtt forms are handled: the array form `[LogicalId, AttrName]` and
4329
+ * the long-form string `"LogicalId./cdk/exports/name"` (split on the FIRST dot — the attribute
4330
+ * itself may contain dots).
4331
+ */
4332
+ function collectCrossRegionExportNames(template) {
4333
+ const resources = template.Resources ?? {};
4334
+ const readerIds = new Set(Object.entries(resources).filter(([, r]) => r?.Type === CROSS_REGION_EXPORT_READER_TYPE).map(([lid]) => lid));
4335
+ if (readerIds.size === 0) return [];
4336
+ const names = /* @__PURE__ */ new Set();
4337
+ const walk = (node) => {
4338
+ if (Array.isArray(node)) {
4339
+ for (const x of node) walk(x);
4340
+ return;
4341
+ }
4342
+ if (node && typeof node === "object") {
4343
+ const obj = node;
4344
+ const g = obj["Fn::GetAtt"];
4345
+ if (g !== void 0) {
4346
+ let logicalId;
4347
+ let attr;
4348
+ if (typeof g === "string") {
4349
+ const dot = g.indexOf(".");
4350
+ if (dot >= 0) {
4351
+ logicalId = g.slice(0, dot);
4352
+ attr = g.slice(dot + 1);
4353
+ }
4354
+ } else if (Array.isArray(g) && g.length >= 2) {
4355
+ logicalId = String(g[0]);
4356
+ attr = String(g[1]);
4357
+ }
4358
+ if (logicalId !== void 0 && readerIds.has(logicalId) && attr !== void 0 && attr.startsWith("/cdk/exports/")) names.add(attr);
4359
+ }
4360
+ for (const v of Object.values(obj)) walk(v);
4361
+ }
4362
+ };
4363
+ walk(template.Resources ?? {});
4364
+ return [...names].sort();
4365
+ }
4366
+ async function getCrossRegionExports(ssm, accountId, region, names) {
4367
+ const cacheKey = `${accountId}:${region}`;
4368
+ const cached = crossRegionExportsCache.get(cacheKey);
4369
+ if (cached) return cached;
4370
+ const out = {};
4371
+ for (let i = 0; i < names.length; i += 10) {
4372
+ const batch = names.slice(i, i + 10);
4373
+ const res = await ssm.send(new GetParametersCommand({ Names: batch }));
4374
+ for (const p of res.Parameters ?? []) if (p.Name && typeof p.Value === "string") out[p.Name] = p.Value;
4375
+ }
4376
+ crossRegionExportsCache.set(cacheKey, out);
4377
+ return out;
4378
+ }
4312
4379
  async function listStackResources(client, stackName) {
4313
4380
  const physIds = {};
4314
4381
  const typeOf = {};
@@ -4372,6 +4439,17 @@ async function loadDesired(client, stackName, region, templateOverride, recovery
4372
4439
  const msg = err instanceof Error ? err.message : String(err);
4373
4440
  console.error(`warning: ${stackName}: cloudformation:ListExports failed — Fn::ImportValue references will resolve UNRESOLVED (their declared properties are skipped, not compared). Grant cloudformation:ListExports for full coverage. (${msg})`);
4374
4441
  }
4442
+ const crossRegionExportNames = collectCrossRegionExportNames(template);
4443
+ if (crossRegionExportNames.length > 0) try {
4444
+ const credentials = client.config?.credentials;
4445
+ ctx.crossRegionExports = await getCrossRegionExports(new SSMClient(credentials ? {
4446
+ region,
4447
+ credentials
4448
+ } : { region }), accountId, region, crossRegionExportNames);
4449
+ } catch (err) {
4450
+ const msg = err instanceof Error ? err.message : String(err);
4451
+ 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})`);
4452
+ }
4375
4453
  const resources = [];
4376
4454
  const principalsWithSiblingPolicy = collectPrincipalsWithSiblingPolicies(template.Resources ?? {}, ctx);
4377
4455
  const clustersWithSiblingCapacityProviders = collectClustersWithSiblingCapacityProviders(template.Resources ?? {});
@@ -5135,6 +5213,16 @@ function subtractSiblingUserGroups(live, siblingGroups) {
5135
5213
  }
5136
5214
  if (arr.length === 0) delete live[USER_GROUPS_PROP];
5137
5215
  }
5216
+ const LIFECYCLE_HOOK_SPEC_PROP = "LifecycleHookSpecificationList";
5217
+ function subtractSiblingLifecycleHooks(live, siblingHookNames) {
5218
+ const arr = live[LIFECYCLE_HOOK_SPEC_PROP];
5219
+ if (!Array.isArray(arr) || siblingHookNames.length === 0) return;
5220
+ for (const name of siblingHookNames) {
5221
+ const i = arr.findIndex((el) => el !== null && typeof el === "object" && el.LifecycleHookName === name);
5222
+ if (i >= 0) arr.splice(i, 1);
5223
+ }
5224
+ if (arr.length === 0) delete live[LIFECYCLE_HOOK_SPEC_PROP];
5225
+ }
5138
5226
  const CC_ALT_REPRESENTATION = {
5139
5227
  "AWS::EC2::Subnet": {
5140
5228
  AvailabilityZoneId: "AvailabilityZone",
@@ -5536,6 +5624,10 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
5536
5624
  if (sibGroups) subtractSiblingUserGroups(live, sibGroups);
5537
5625
  }
5538
5626
  }
5627
+ if (resourceType === "AWS::AutoScaling::AutoScalingGroup") {
5628
+ const sibHooks = physicalId ? opts.siblingLifecycleHooks?.[physicalId] : void 0;
5629
+ if (sibHooks) subtractSiblingLifecycleHooks(live, sibHooks);
5630
+ }
5539
5631
  if (resourceType === "AWS::S3::Bucket" && physicalId && opts.bucketNotificationManaged?.has(physicalId) && !("NotificationConfiguration" in declared)) delete live.NotificationConfiguration;
5540
5632
  const echoSpec = CLUSTER_ECHO_CHILD[resourceType];
5541
5633
  const echoModel = echoSpec && physicalId ? opts.clusterEchoModel?.[physicalId] : void 0;
@@ -7307,11 +7399,14 @@ async function pageUserPoolClients(client, userPoolId) {
7307
7399
  return out;
7308
7400
  }
7309
7401
  function diffUserPoolGroups(input) {
7310
- const { userPoolId, declaredGroupNames, liveGroups } = input;
7402
+ const { userPoolId, declaredGroupNames, declaredProviderNames, liveGroups } = input;
7311
7403
  const declared = new Set(declaredGroupNames);
7404
+ const autoGroupNames = /* @__PURE__ */ new Set();
7405
+ for (const p of declaredProviderNames) if (typeof p === "string" && p.length > 0) autoGroupNames.add(`${userPoolId}_${p}`);
7312
7406
  const added = [];
7313
7407
  for (const g of liveGroups) {
7314
7408
  if (declared.has(g.name)) continue;
7409
+ if (autoGroupNames.has(g.name)) continue;
7315
7410
  added.push({
7316
7411
  resourceType: "AWS::Cognito::UserPoolGroup",
7317
7412
  identifier: `${userPoolId}|${g.name}`,
@@ -7370,6 +7465,40 @@ async function pageUserPoolResourceServers(client, userPoolId) {
7370
7465
  } while (next);
7371
7466
  return out;
7372
7467
  }
7468
+ const BUILTIN_COGNITO_PROVIDER_NAME = "Cognito";
7469
+ function diffUserPoolIdentityProviders(input) {
7470
+ const { userPoolId, declaredProviderNames, liveProviders } = input;
7471
+ const declared = new Set(declaredProviderNames);
7472
+ const added = [];
7473
+ for (const p of liveProviders) {
7474
+ if (p.providerName === BUILTIN_COGNITO_PROVIDER_NAME) continue;
7475
+ if (declared.has(p.providerName)) continue;
7476
+ added.push({
7477
+ resourceType: "AWS::Cognito::UserPoolIdentityProvider",
7478
+ identifier: `${userPoolId}|${p.providerName}`,
7479
+ label: p.label ?? p.providerName,
7480
+ live: {
7481
+ ProviderName: p.providerName,
7482
+ UserPoolId: userPoolId
7483
+ }
7484
+ });
7485
+ }
7486
+ return added;
7487
+ }
7488
+ async function pageUserPoolIdentityProviders(client, userPoolId) {
7489
+ const out = [];
7490
+ let next;
7491
+ do {
7492
+ const res = await client.send(new ListIdentityProvidersCommand({
7493
+ UserPoolId: userPoolId,
7494
+ NextToken: next,
7495
+ MaxResults: 60
7496
+ }));
7497
+ out.push(...res.Providers ?? []);
7498
+ next = res.NextToken;
7499
+ } while (next);
7500
+ return out;
7501
+ }
7373
7502
  async function enumerateUserPoolChildren(ctx) {
7374
7503
  const { parent, desired, region } = ctx;
7375
7504
  const userPoolId = parent.physicalId;
@@ -7377,6 +7506,7 @@ async function enumerateUserPoolChildren(ctx) {
7377
7506
  const declaredClientIds = [];
7378
7507
  const declaredGroupNames = [];
7379
7508
  const declaredResourceServerIdentifiers = [];
7509
+ const declaredProviderNames = [];
7380
7510
  for (const r of desired.resources) if (r.resourceType === "AWS::Cognito::UserPoolClient" && parentRefMatches(r.declared.UserPoolId, userPoolId) && r.physicalId) declaredClientIds.push(r.physicalId);
7381
7511
  else if (r.resourceType === "AWS::Cognito::UserPoolGroup" && parentRefMatches(r.declared.UserPoolId, userPoolId)) {
7382
7512
  const name = typeof r.declared.GroupName === "string" ? r.declared.GroupName : r.physicalId;
@@ -7384,6 +7514,9 @@ async function enumerateUserPoolChildren(ctx) {
7384
7514
  } else if (r.resourceType === "AWS::Cognito::UserPoolResourceServer" && parentRefMatches(r.declared.UserPoolId, userPoolId)) {
7385
7515
  const identifier = typeof r.declared.Identifier === "string" ? r.declared.Identifier : r.physicalId;
7386
7516
  if (identifier) declaredResourceServerIdentifiers.push(identifier);
7517
+ } else if (r.resourceType === "AWS::Cognito::UserPoolIdentityProvider" && parentRefMatches(r.declared.UserPoolId, userPoolId)) {
7518
+ const providerName = typeof r.declared.ProviderName === "string" ? r.declared.ProviderName : r.physicalId;
7519
+ if (providerName) declaredProviderNames.push(providerName);
7387
7520
  }
7388
7521
  const client = new CognitoIdentityProviderClient({
7389
7522
  region,
@@ -7400,6 +7533,7 @@ async function enumerateUserPoolChildren(ctx) {
7400
7533
  const groupAdded = diffUserPoolGroups({
7401
7534
  userPoolId,
7402
7535
  declaredGroupNames,
7536
+ declaredProviderNames,
7403
7537
  liveGroups: (await pageUserPoolGroups(client, userPoolId)).filter((g) => typeof g.GroupName === "string").map((g) => ({ name: g.GroupName }))
7404
7538
  });
7405
7539
  const resourceServerAdded = diffUserPoolResourceServers({
@@ -7410,10 +7544,19 @@ async function enumerateUserPoolChildren(ctx) {
7410
7544
  label: rs.Name ?? rs.Identifier
7411
7545
  }))
7412
7546
  });
7547
+ const idpAdded = diffUserPoolIdentityProviders({
7548
+ userPoolId,
7549
+ declaredProviderNames,
7550
+ liveProviders: (await pageUserPoolIdentityProviders(client, userPoolId)).filter((p) => typeof p.ProviderName === "string").map((p) => ({
7551
+ providerName: p.ProviderName,
7552
+ label: p.ProviderName
7553
+ }))
7554
+ });
7413
7555
  return [
7414
7556
  ...clientAdded,
7415
7557
  ...groupAdded,
7416
- ...resourceServerAdded
7558
+ ...resourceServerAdded,
7559
+ ...idpAdded
7417
7560
  ];
7418
7561
  }
7419
7562
  function diffGraphQLApiChildren(input) {
@@ -8779,6 +8922,72 @@ const readDmsReplicationSubnetGroup = async ({ physicalId, region }) => {
8779
8922
  if (subnetIds.length > 0) model.SubnetIds = subnetIds;
8780
8923
  return model;
8781
8924
  };
8925
+ const readDmsReplicationInstance = async ({ physicalId, region }) => {
8926
+ const id = str$1(physicalId);
8927
+ if (!id) return void 0;
8928
+ const c = new DatabaseMigrationServiceClient({
8929
+ region,
8930
+ ...READ_RETRY
8931
+ });
8932
+ const filterName = id.startsWith("arn:") ? "replication-instance-arn" : "replication-instance-id";
8933
+ const i = (await c.send(new DescribeReplicationInstancesCommand({ Filters: [{
8934
+ Name: filterName,
8935
+ Values: [id]
8936
+ }] }))).ReplicationInstances?.[0];
8937
+ if (!i) throw new ResourceGoneError(`DMS ReplicationInstance ${id} absent`);
8938
+ const model = {};
8939
+ if (str$1(i.ReplicationInstanceIdentifier)) model.ReplicationInstanceIdentifier = i.ReplicationInstanceIdentifier;
8940
+ if (str$1(i.ReplicationInstanceClass)) model.ReplicationInstanceClass = i.ReplicationInstanceClass;
8941
+ if (typeof i.AllocatedStorage === "number") model.AllocatedStorage = i.AllocatedStorage;
8942
+ if (typeof i.MultiAZ === "boolean") model.MultiAZ = i.MultiAZ;
8943
+ if (str$1(i.EngineVersion)) model.EngineVersion = i.EngineVersion;
8944
+ if (typeof i.AutoMinorVersionUpgrade === "boolean") model.AutoMinorVersionUpgrade = i.AutoMinorVersionUpgrade;
8945
+ if (typeof i.PubliclyAccessible === "boolean") model.PubliclyAccessible = i.PubliclyAccessible;
8946
+ if (str$1(i.AvailabilityZone)) model.AvailabilityZone = i.AvailabilityZone;
8947
+ if (str$1(i.PreferredMaintenanceWindow)) model.PreferredMaintenanceWindow = i.PreferredMaintenanceWindow;
8948
+ if (str$1(i.KmsKeyId)) model.KmsKeyId = i.KmsKeyId;
8949
+ if (str$1(i.ReplicationSubnetGroup?.ReplicationSubnetGroupIdentifier)) model.ReplicationSubnetGroupIdentifier = i.ReplicationSubnetGroup?.ReplicationSubnetGroupIdentifier;
8950
+ const sgIds = (i.VpcSecurityGroups ?? []).map((g) => str$1(g.VpcSecurityGroupId)).filter((v) => v !== void 0).sort();
8951
+ if (sgIds.length > 0) model.VpcSecurityGroupIds = sgIds;
8952
+ return model;
8953
+ };
8954
+ const readDmsReplicationTask = async ({ physicalId, region }) => {
8955
+ const id = str$1(physicalId);
8956
+ if (!id) return void 0;
8957
+ const c = new DatabaseMigrationServiceClient({
8958
+ region,
8959
+ ...READ_RETRY
8960
+ });
8961
+ const filterName = id.startsWith("arn:") ? "replication-task-arn" : "replication-task-id";
8962
+ const t = (await c.send(new DescribeReplicationTasksCommand({ Filters: [{
8963
+ Name: filterName,
8964
+ Values: [id]
8965
+ }] }))).ReplicationTasks?.[0];
8966
+ if (!t) throw new ResourceGoneError(`DMS ReplicationTask ${id} absent`);
8967
+ const parseJsonMaybe = (s) => {
8968
+ const v = str$1(s);
8969
+ if (v === void 0) return void 0;
8970
+ try {
8971
+ return JSON.parse(v);
8972
+ } catch {
8973
+ return v;
8974
+ }
8975
+ };
8976
+ const model = {};
8977
+ if (str$1(t.ReplicationTaskIdentifier)) model.ReplicationTaskIdentifier = t.ReplicationTaskIdentifier;
8978
+ if (str$1(t.SourceEndpointArn)) model.SourceEndpointArn = t.SourceEndpointArn;
8979
+ if (str$1(t.TargetEndpointArn)) model.TargetEndpointArn = t.TargetEndpointArn;
8980
+ if (str$1(t.ReplicationInstanceArn)) model.ReplicationInstanceArn = t.ReplicationInstanceArn;
8981
+ if (str$1(t.MigrationType)) model.MigrationType = t.MigrationType;
8982
+ const tableMappings = parseJsonMaybe(t.TableMappings);
8983
+ if (tableMappings !== void 0) model.TableMappings = tableMappings;
8984
+ const taskSettings = parseJsonMaybe(t.ReplicationTaskSettings);
8985
+ if (taskSettings !== void 0) model.ReplicationTaskSettings = taskSettings;
8986
+ if (str$1(t.CdcStartPosition)) model.CdcStartPosition = t.CdcStartPosition;
8987
+ if (str$1(t.CdcStopPosition)) model.CdcStopPosition = t.CdcStopPosition;
8988
+ if (str$1(t.TaskData)) model.TaskData = t.TaskData;
8989
+ return model;
8990
+ };
8782
8991
  const readMediaConvertQueue = async ({ physicalId, region }) => {
8783
8992
  const name = str$1(physicalId);
8784
8993
  if (!name) return void 0;
@@ -9019,7 +9228,7 @@ const readDaxParameterGroup = async ({ physicalId, region }) => {
9019
9228
  const model = {};
9020
9229
  if (str$1(g.ParameterGroupName)) model.ParameterGroupName = g.ParameterGroupName;
9021
9230
  if (str$1(g.Description)) model.Description = g.Description;
9022
- const p = await c.send(new DescribeParametersCommand({ ParameterGroupName: name }));
9231
+ const p = await c.send(new DescribeParametersCommand$1({ ParameterGroupName: name }));
9023
9232
  const values = {};
9024
9233
  for (const param of p.Parameters ?? []) {
9025
9234
  if (param.IsModifiable === "FALSE") continue;
@@ -9781,6 +9990,8 @@ const SDK_OVERRIDES = {
9781
9990
  "AWS::DLM::LifecyclePolicy": readDlmLifecyclePolicy,
9782
9991
  "AWS::DMS::Endpoint": readDmsEndpoint,
9783
9992
  "AWS::DMS::ReplicationSubnetGroup": readDmsReplicationSubnetGroup,
9993
+ "AWS::DMS::ReplicationInstance": readDmsReplicationInstance,
9994
+ "AWS::DMS::ReplicationTask": readDmsReplicationTask,
9784
9995
  "AWS::MediaConvert::Queue": readMediaConvertQueue,
9785
9996
  "AWS::MediaConvert::JobTemplate": readMediaConvertJobTemplate,
9786
9997
  "AWS::Route53::RecordSet": readRoute53RecordSet,
@@ -9799,7 +10010,7 @@ const supplementSsmParameter = async ({ physicalId, declared, region }) => {
9799
10010
  const p = (await new SSMClient({
9800
10011
  region,
9801
10012
  ...READ_RETRY
9802
- }).send(new DescribeParametersCommand$2({ ParameterFilters: [{
10013
+ }).send(new DescribeParametersCommand({ ParameterFilters: [{
9803
10014
  Key: "Name",
9804
10015
  Option: "Equals",
9805
10016
  Values: [name]
@@ -9900,7 +10111,7 @@ const readMemoryDbParamMap = async (c, groupName) => {
9900
10111
  const out = {};
9901
10112
  let token;
9902
10113
  do {
9903
- const r = await c.send(new DescribeParametersCommand$1({
10114
+ const r = await c.send(new DescribeParametersCommand$2({
9904
10115
  ParameterGroupName: groupName,
9905
10116
  NextToken: token
9906
10117
  }));
@@ -10932,6 +11143,24 @@ function buildSiblingUserGroups(desired) {
10932
11143
  }
10933
11144
  return map;
10934
11145
  }
11146
+ const LIFECYCLE_HOOK_TYPE = "AWS::AutoScaling::LifecycleHook";
11147
+ function buildSiblingLifecycleHooks(desired) {
11148
+ const byLogicalId = /* @__PURE__ */ new Map();
11149
+ for (const r of desired.resources) if (r.physicalId) byLogicalId.set(r.logicalId, r.physicalId);
11150
+ const map = {};
11151
+ for (const r of desired.resources) {
11152
+ if (r.resourceType !== LIFECYCLE_HOOK_TYPE) continue;
11153
+ const decl = r.declared;
11154
+ if (!decl || typeof decl !== "object") continue;
11155
+ const d = decl;
11156
+ const asgKey = resolvePrincipalKey(d.AutoScalingGroupName, byLogicalId);
11157
+ if (!asgKey) continue;
11158
+ const name = r.physicalId ?? (typeof d.LifecycleHookName === "string" && d.LifecycleHookName ? d.LifecycleHookName : void 0);
11159
+ if (!name) continue;
11160
+ (map[asgKey] ??= []).push(name);
11161
+ }
11162
+ return map;
11163
+ }
10935
11164
  function resolvePrincipalKey(ref, byLogicalId) {
10936
11165
  if (typeof ref === "string" && ref) return ref;
10937
11166
  if (ref && typeof ref === "object" && "Ref" in ref) {
@@ -11144,6 +11373,7 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
11144
11373
  siblingEventBusPolicies: buildSiblingEventBusPolicies(desired),
11145
11374
  siblingManagedPolicyAttachments: buildSiblingManagedPolicyAttachments(desired),
11146
11375
  siblingUserGroups: buildSiblingUserGroups(desired),
11376
+ siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
11147
11377
  bucketNotificationManaged: buildBucketNotificationManaged(desired),
11148
11378
  clusterEchoModel: buildClusterEchoModels(desired),
11149
11379
  rdsOptionSettingDefaults: await buildRdsOptionSettingDefaults(desired, region)
@@ -11206,6 +11436,7 @@ async function regatherTouched(gathered, touched, region) {
11206
11436
  siblingEventBusPolicies: buildSiblingEventBusPolicies(desired),
11207
11437
  siblingManagedPolicyAttachments: buildSiblingManagedPolicyAttachments(desired),
11208
11438
  siblingUserGroups: buildSiblingUserGroups(desired),
11439
+ siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
11209
11440
  bucketNotificationManaged: buildBucketNotificationManaged(desired),
11210
11441
  clusterEchoModel: buildClusterEchoModels(desired),
11211
11442
  rdsOptionSettingDefaults: await buildRdsOptionSettingDefaults(desired, region)