@go-to-k/cdkd 0.45.0 → 0.46.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/dist/cli.js CHANGED
@@ -8510,6 +8510,31 @@ function matchesCdkPath(tags, cdkPath) {
8510
8510
  }
8511
8511
  return false;
8512
8512
  }
8513
+ function normalizeAwsTagsToCfn(tags) {
8514
+ if (!tags)
8515
+ return [];
8516
+ const out = [];
8517
+ if (Array.isArray(tags)) {
8518
+ for (const t of tags) {
8519
+ const obj = t;
8520
+ const k = (typeof obj["Key"] === "string" ? obj["Key"] : void 0) ?? (typeof obj["TagKey"] === "string" ? obj["TagKey"] : void 0) ?? (typeof obj["key"] === "string" ? obj["key"] : void 0);
8521
+ const v = (typeof obj["Value"] === "string" ? obj["Value"] : void 0) ?? (typeof obj["TagValue"] === "string" ? obj["TagValue"] : void 0) ?? (typeof obj["value"] === "string" ? obj["value"] : void 0);
8522
+ if (typeof k !== "string" || k.length === 0)
8523
+ continue;
8524
+ if (k.startsWith("aws:"))
8525
+ continue;
8526
+ out.push({ Key: k, Value: typeof v === "string" ? v : "" });
8527
+ }
8528
+ } else {
8529
+ for (const [k, v] of Object.entries(tags)) {
8530
+ if (!k || k.startsWith("aws:"))
8531
+ continue;
8532
+ out.push({ Key: k, Value: typeof v === "string" ? v : "" });
8533
+ }
8534
+ }
8535
+ out.sort((a, b) => a.Key < b.Key ? -1 : a.Key > b.Key ? 1 : 0);
8536
+ return out;
8537
+ }
8513
8538
 
8514
8539
  // src/provisioning/providers/iam-role-provider.ts
8515
8540
  var IAMRoleProvider = class {
@@ -9069,9 +9094,10 @@ var IAMRoleProvider = class {
9069
9094
  * costs one extra `GetRolePolicy` per inline policy. Out of scope for
9070
9095
  * v1 — drift detection on inline IAM policy bodies can ship in a
9071
9096
  * follow-up.
9072
- * - `Tags` is omitted for the same reason as Lambda's tags handling
9073
- * (CDK auto-injects `aws:cdk:path` and the shape decision belongs in a
9074
- * dedicated tags PR).
9097
+ * - `Tags` is surfaced via `ListRoleTags` (paginated). CDK's `aws:*`
9098
+ * auto-tags are filtered out by `normalizeAwsTagsToCfn` so they don't
9099
+ * fire false-positive drift; the result key is omitted entirely when
9100
+ * AWS reports no user tags (matches `create()`'s behavior).
9075
9101
  *
9076
9102
  * Returns `undefined` when the role is gone (`NoSuchEntityException`).
9077
9103
  */
@@ -9121,6 +9147,32 @@ var IAMRoleProvider = class {
9121
9147
  if (!(err instanceof NoSuchEntityException))
9122
9148
  throw err;
9123
9149
  }
9150
+ try {
9151
+ const collected = [];
9152
+ let marker;
9153
+ while (true) {
9154
+ const tagsResp = await this.iamClient.send(
9155
+ new ListRoleTagsCommand({
9156
+ RoleName: physicalId,
9157
+ ...marker ? { Marker: marker } : {}
9158
+ })
9159
+ );
9160
+ if (tagsResp.Tags) {
9161
+ for (const t of tagsResp.Tags) {
9162
+ collected.push({ Key: t.Key, Value: t.Value });
9163
+ }
9164
+ }
9165
+ if (!tagsResp.IsTruncated)
9166
+ break;
9167
+ marker = tagsResp.Marker;
9168
+ }
9169
+ const tags = normalizeAwsTagsToCfn(collected);
9170
+ if (tags.length > 0)
9171
+ result["Tags"] = tags;
9172
+ } catch (err) {
9173
+ if (!(err instanceof NoSuchEntityException))
9174
+ throw err;
9175
+ }
9124
9176
  return result;
9125
9177
  }
9126
9178
  /**
@@ -12126,14 +12178,9 @@ var S3BucketProvider = class {
12126
12178
  }
12127
12179
  try {
12128
12180
  const resp = await this.s3Client.send(new GetBucketTaggingCommand({ Bucket: physicalId }));
12129
- if (resp.TagSet && resp.TagSet.length > 0) {
12130
- const tags = resp.TagSet.filter((t) => t.Key && !t.Key.startsWith("aws:")).map((t) => ({
12131
- Key: t.Key,
12132
- Value: t.Value
12133
- }));
12134
- if (tags.length > 0)
12135
- result["Tags"] = tags;
12136
- }
12181
+ const tags = normalizeAwsTagsToCfn(resp.TagSet);
12182
+ if (tags.length > 0)
12183
+ result["Tags"] = tags;
12137
12184
  } catch (err) {
12138
12185
  const e = err;
12139
12186
  if (e.name !== "NoSuchTagSet") {
@@ -12742,9 +12789,11 @@ var SQSQueueProvider = class {
12742
12789
  * `QueueName` is derived from the URL tail (the `physicalId` is the
12743
12790
  * queue URL), not surfaced by `GetQueueAttributes`.
12744
12791
  *
12745
- * `Tags` is omitted: `ListQueueTags` is a separate call and tag drift is
12746
- * generally less interesting than configuration drift; the `aws:cdk:path`
12747
- * shape question is also out of scope here.
12792
+ * `Tags` is surfaced via `ListQueueTags` (returns a tag-name value map).
12793
+ * CDK's `aws:*` auto-tags are filtered out by `normalizeAwsTagsToCfn`; the
12794
+ * result key is omitted entirely when AWS reports no user tags (matches
12795
+ * `create()`'s behavior of only sending Tags when the template carries
12796
+ * them).
12748
12797
  *
12749
12798
  * Returns `undefined` when the queue is gone (`QueueDoesNotExist`).
12750
12799
  */
@@ -12812,6 +12861,18 @@ var SQSQueueProvider = class {
12812
12861
  result["RedrivePolicy"] = attributes["RedrivePolicy"];
12813
12862
  }
12814
12863
  }
12864
+ try {
12865
+ const tagsResp = await this.sqsClient.send(
12866
+ new ListQueueTagsCommand({ QueueUrl: physicalId })
12867
+ );
12868
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
12869
+ if (tags.length > 0)
12870
+ result["Tags"] = tags;
12871
+ } catch (err) {
12872
+ if (err instanceof QueueDoesNotExist)
12873
+ return void 0;
12874
+ throw err;
12875
+ }
12815
12876
  return result;
12816
12877
  }
12817
12878
  /**
@@ -13431,11 +13492,16 @@ var SNSTopicProvider = class {
13431
13492
  * `TopicName` is derived from the ARN tail (the `physicalId` is the
13432
13493
  * topic ARN).
13433
13494
  *
13434
- * `Tags` and `DeliveryStatusLogging` are intentionally omitted:
13435
- * `ListTagsForResource` is a separate call, and `DeliveryStatusLogging`
13436
- * fans out into per-protocol attributes (`{Protocol}SuccessFeedbackRoleArn`,
13437
- * etc.) whose round-trip back to the CFn array shape needs more thought
13438
- * than fits in this PR.
13495
+ * `Tags` is surfaced via a follow-up `ListTagsForResource` call. CDK's
13496
+ * `aws:*` auto-tags are filtered out by `normalizeAwsTagsToCfn`; the
13497
+ * result key is omitted entirely when AWS reports no user tags (matches
13498
+ * `create()`'s behavior of only sending Tags when the template carries
13499
+ * them).
13500
+ *
13501
+ * `DeliveryStatusLogging` is intentionally omitted: it fans out into
13502
+ * per-protocol attributes (`{Protocol}SuccessFeedbackRoleArn`, etc.) whose
13503
+ * round-trip back to the CFn array shape needs more thought than fits in
13504
+ * this PR.
13439
13505
  *
13440
13506
  * `Subscription` is omitted because CDK manages it via separate
13441
13507
  * `AWS::SNS::Subscription` resources, not as a Topic property.
@@ -13488,6 +13554,18 @@ var SNSTopicProvider = class {
13488
13554
  }
13489
13555
  }
13490
13556
  }
13557
+ try {
13558
+ const tagsResp = await this.snsClient.send(
13559
+ new ListTagsForResourceCommand({ ResourceArn: physicalId })
13560
+ );
13561
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
13562
+ if (tags.length > 0)
13563
+ result["Tags"] = tags;
13564
+ } catch (err) {
13565
+ if (err instanceof NotFoundException)
13566
+ return void 0;
13567
+ throw err;
13568
+ }
13491
13569
  return result;
13492
13570
  }
13493
13571
  /**
@@ -14691,11 +14769,13 @@ var LambdaFunctionProvider = class {
14691
14769
  * function's `CodeSha256` does live in `GetFunction` but is not what
14692
14770
  * cdkd's `Code: { S3Bucket, S3Key }` state property carries).
14693
14771
  *
14694
- * `Tags` is omitted as well: `GetFunction` returns Tags as an object map,
14695
- * while CFn / cdkd state holds them as `[{Key, Value}]`. Re-shaping
14696
- * accurately requires deciding how to handle the auto-injected
14697
- * `aws:cdk:path` tag, which is out of scope for this PR. Tag drift is
14698
- * typically less interesting than configuration drift.
14772
+ * `Tags` is surfaced from the `Tags` map on the same `GetFunction`
14773
+ * response. CDK's auto-injected `aws:cdk:*` tags (which AWS happily
14774
+ * returns) are filtered out by `normalizeAwsTagsToCfn` so they don't
14775
+ * fire false-positive drift against state. The result key is omitted
14776
+ * entirely when AWS reports no user tags, matching `create()`'s
14777
+ * behavior of only sending `Tags` when the user explicitly passes
14778
+ * them.
14699
14779
  *
14700
14780
  * Returns `undefined` when the function is gone (`ResourceNotFoundException`).
14701
14781
  */
@@ -14753,6 +14833,9 @@ var LambdaFunctionProvider = class {
14753
14833
  if (Object.keys(vpc).length > 0)
14754
14834
  result["VpcConfig"] = vpc;
14755
14835
  }
14836
+ const tags = normalizeAwsTagsToCfn(resp.Tags);
14837
+ if (tags.length > 0)
14838
+ result["Tags"] = tags;
14756
14839
  return result;
14757
14840
  } catch (err) {
14758
14841
  if (err instanceof ResourceNotFoundException)
@@ -16235,10 +16318,12 @@ var DynamoDBTableProvider = class {
16235
16318
  *
16236
16319
  * Returns `undefined` when the table is gone (`ResourceNotFoundException`).
16237
16320
  *
16238
- * Tags are intentionally omitted: `ListTagsOfResource` is a separate call
16239
- * and tag drift is generally less interesting than table-config drift;
16240
- * including it would also force a tag-shape decision on the
16241
- * `aws:cdk:path` auto-tag, which is out of scope here.
16321
+ * Tags are surfaced via a follow-up `ListTagsOfResource` call (DynamoDB
16322
+ * doesn't include tags in `DescribeTable`). CDK's `aws:*` auto-tags are
16323
+ * filtered out by `normalizeAwsTagsToCfn` so they don't fire false-positive
16324
+ * drift, and the result key is omitted entirely when AWS reports no user
16325
+ * tags (matches `create()`'s behavior of only sending Tags when the
16326
+ * template carries them).
16242
16327
  */
16243
16328
  async readCurrentState(physicalId, _logicalId, _resourceType) {
16244
16329
  try {
@@ -16295,6 +16380,20 @@ var DynamoDBTableProvider = class {
16295
16380
  if (table.TableClassSummary?.TableClass) {
16296
16381
  result["TableClass"] = table.TableClassSummary.TableClass;
16297
16382
  }
16383
+ if (table.TableArn) {
16384
+ try {
16385
+ const tagsResp = await this.dynamoDBClient.send(
16386
+ new ListTagsOfResourceCommand({ ResourceArn: table.TableArn })
16387
+ );
16388
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
16389
+ if (tags.length > 0)
16390
+ result["Tags"] = tags;
16391
+ } catch (err) {
16392
+ if (err instanceof ResourceNotFoundException6)
16393
+ return void 0;
16394
+ throw err;
16395
+ }
16396
+ }
16298
16397
  return result;
16299
16398
  } catch (err) {
16300
16399
  if (err instanceof ResourceNotFoundException6)
@@ -16616,11 +16715,16 @@ var LogsLogGroupProvider = class {
16616
16715
  * `RetentionInDays`).
16617
16716
  *
16618
16717
  * Coverage: `LogGroupName`, `KmsKeyId`, `RetentionInDays`,
16619
- * `LogGroupClass`. Other handledProperties (`DataProtectionPolicy`,
16620
- * `Tags`, `FieldIndexPolicies`, `ResourcePolicyDocument`,
16718
+ * `LogGroupClass`, `Tags`. Other handledProperties (`DataProtectionPolicy`,
16719
+ * `FieldIndexPolicies`, `ResourcePolicyDocument`,
16621
16720
  * `DeletionProtectionEnabled`, `BearerTokenAuthenticationEnabled`) need
16622
16721
  * their own per-property API call and are out of scope for v1.
16623
16722
  *
16723
+ * Tags are read via `ListTagsForResource` (using the log-group ARN from
16724
+ * the same `DescribeLogGroups` response). CDK's `aws:*` auto-tags are
16725
+ * filtered out so they don't fire false-positive drift; the result key is
16726
+ * omitted entirely when AWS reports no user tags.
16727
+ *
16624
16728
  * Returns `undefined` when the log group is gone.
16625
16729
  */
16626
16730
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -16641,6 +16745,21 @@ var LogsLogGroupProvider = class {
16641
16745
  }
16642
16746
  if (found.logGroupClass !== void 0)
16643
16747
  result["LogGroupClass"] = found.logGroupClass;
16748
+ if (found.arn) {
16749
+ const arnForTags = found.arn.replace(/:\*$/, "");
16750
+ try {
16751
+ const tagsResp = await this.logsClient.send(
16752
+ new ListTagsForResourceCommand2({ resourceArn: arnForTags })
16753
+ );
16754
+ const tags = normalizeAwsTagsToCfn(tagsResp.tags);
16755
+ if (tags.length > 0)
16756
+ result["Tags"] = tags;
16757
+ } catch (err) {
16758
+ if (err instanceof ResourceNotFoundException7)
16759
+ return void 0;
16760
+ throw err;
16761
+ }
16762
+ }
16644
16763
  return result;
16645
16764
  } catch (err) {
16646
16765
  if (err instanceof ResourceNotFoundException7)
@@ -17010,6 +17129,20 @@ var CloudWatchAlarmProvider = class {
17010
17129
  if (alarm.Metrics && alarm.Metrics.length > 0) {
17011
17130
  result["Metrics"] = alarm.Metrics.map((m) => m);
17012
17131
  }
17132
+ if (alarm.AlarmArn) {
17133
+ try {
17134
+ const tagsResp = await this.cloudWatchClient.send(
17135
+ new ListTagsForResourceCommand3({ ResourceARN: alarm.AlarmArn })
17136
+ );
17137
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
17138
+ if (tags.length > 0)
17139
+ result["Tags"] = tags;
17140
+ } catch (err) {
17141
+ this.logger.debug(
17142
+ `CloudWatch ListTagsForResource(${alarm.AlarmArn}) failed: ${err instanceof Error ? err.message : String(err)}`
17143
+ );
17144
+ }
17145
+ }
17013
17146
  return result;
17014
17147
  }
17015
17148
  async import(input) {
@@ -17348,8 +17481,10 @@ var SecretsManagerSecretProvider = class {
17348
17481
  * call to avoid surfacing plaintext through drift). Cdkd state holds
17349
17482
  * the user-supplied string verbatim; comparing against AWS would
17350
17483
  * require pulling the value, so this is deliberately deferred.
17351
- * - `Tags`: `DescribeSecret` returns Tags, but the auto-injected
17352
- * `aws:cdk:path` tag-shape question is out of scope here.
17484
+ *
17485
+ * `Tags` is surfaced from the same `DescribeSecret` response (no extra
17486
+ * round-trip). CDK's `aws:*` auto-tags are filtered out; the result key
17487
+ * is omitted entirely when AWS reports no user tags.
17353
17488
  *
17354
17489
  * Returns `undefined` when the secret is gone (`ResourceNotFoundException`).
17355
17490
  */
@@ -17374,6 +17509,9 @@ var SecretsManagerSecretProvider = class {
17374
17509
  return out;
17375
17510
  });
17376
17511
  }
17512
+ const tags = normalizeAwsTagsToCfn(resp.Tags);
17513
+ if (tags.length > 0)
17514
+ result["Tags"] = tags;
17377
17515
  return result;
17378
17516
  } catch (err) {
17379
17517
  if (err instanceof ResourceNotFoundException8)
@@ -17660,12 +17798,12 @@ var SSMParameterProvider = class {
17660
17798
  * metadata (`Description`, `AllowedPattern`, `Tier`) that `GetParameter`
17661
17799
  * does not return.
17662
17800
  *
17663
- * `Name` is set to the physical id. `Tags` and `Policies` are intentionally
17664
- * out of scope (`Tags` requires a separate `ListTagsForResource` round-trip
17665
- * and the auto-injected `aws:cdk:path` tag-shape question is unresolved;
17666
- * `Policies` is returned by `DescribeParameters.Policies` as a structured
17667
- * array but cdkd state holds the raw JSON string the user typed — comparing
17668
- * the two accurately needs more work).
17801
+ * `Name` is set to the physical id. `Tags` is surfaced via a follow-up
17802
+ * `ListTagsForResource(ResourceType=Parameter)` call, with CDK's `aws:*`
17803
+ * auto-tags filtered out. `Policies` is intentionally out of scope:
17804
+ * `DescribeParameters.Policies` returns a structured array but cdkd state
17805
+ * holds the raw JSON string the user typed — comparing the two accurately
17806
+ * needs more work.
17669
17807
  *
17670
17808
  * **Note**: For `SecureString` parameters, AWS returns the encrypted
17671
17809
  * blob in `Value` (we pass `WithDecryption: false`). cdkd state usually
@@ -17717,6 +17855,18 @@ var SSMParameterProvider = class {
17717
17855
  }
17718
17856
  } catch {
17719
17857
  }
17858
+ try {
17859
+ const tagsResp = await this.ssmClient.send(
17860
+ new ListTagsForResourceCommand4({
17861
+ ResourceType: "Parameter",
17862
+ ResourceId: physicalId
17863
+ })
17864
+ );
17865
+ const tags = normalizeAwsTagsToCfn(tagsResp.TagList);
17866
+ if (tags.length > 0)
17867
+ result["Tags"] = tags;
17868
+ } catch {
17869
+ }
17720
17870
  return result;
17721
17871
  }
17722
17872
  /**
@@ -18060,8 +18210,10 @@ var EventBridgeRuleProvider = class {
18060
18210
  * it as the user typed it, typically an object), `ScheduleExpression`,
18061
18211
  * `State`, `RoleArn`, `Targets` (CFn shape `[{Id, Arn, ...}]`).
18062
18212
  *
18063
- * `Tags` is omitted (separate `ListTagsForResource` round-trip; auto-injected
18064
- * `aws:cdk:path` tag-shape question is out of scope here).
18213
+ * `Tags` is surfaced via a follow-up `ListTagsForResource` call (using the
18214
+ * rule ARN the same `physicalId` cdkd state holds). CDK's `aws:*`
18215
+ * auto-tags are filtered out; the result key is omitted entirely when AWS
18216
+ * reports no user tags.
18065
18217
  *
18066
18218
  * Returns `undefined` when the rule is gone (`ResourceNotFoundException`).
18067
18219
  */
@@ -18119,6 +18271,18 @@ var EventBridgeRuleProvider = class {
18119
18271
  throw err;
18120
18272
  }
18121
18273
  }
18274
+ try {
18275
+ const tagsResp = await this.eventBridgeClient.send(
18276
+ new ListTagsForResourceCommand5({ ResourceARN: physicalId })
18277
+ );
18278
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
18279
+ if (tags.length > 0)
18280
+ result["Tags"] = tags;
18281
+ } catch (err) {
18282
+ if (!(err instanceof ResourceNotFoundException9)) {
18283
+ throw err;
18284
+ }
18285
+ }
18122
18286
  return result;
18123
18287
  }
18124
18288
  /**
@@ -18489,10 +18653,13 @@ var EventBridgeBusProvider = class {
18489
18653
  * the user typed it, which may be either an object or a string — the
18490
18654
  * comparator handles either side).
18491
18655
  *
18492
- * `Tags` and `EventSourceName` are intentionally omitted: tags require a
18493
- * separate `ListTagsForResource` round-trip and the auto-injected
18494
- * `aws:cdk:path` tag-shape question is out of scope; `EventSourceName`
18495
- * is set at create time only and not surfaced by `DescribeEventBus`.
18656
+ * `Tags` is surfaced via a follow-up `ListTagsForResource` call (using the
18657
+ * bus ARN from the same `DescribeEventBus` response). CDK's `aws:*`
18658
+ * auto-tags are filtered out; the result key is omitted when AWS reports
18659
+ * no user tags.
18660
+ *
18661
+ * `EventSourceName` is intentionally omitted: it is set at create time
18662
+ * only and not surfaced by `DescribeEventBus`.
18496
18663
  *
18497
18664
  * Returns `undefined` when the bus is gone (`ResourceNotFoundException`).
18498
18665
  */
@@ -18520,6 +18687,20 @@ var EventBridgeBusProvider = class {
18520
18687
  result["Policy"] = resp.Policy;
18521
18688
  }
18522
18689
  }
18690
+ if (resp.Arn) {
18691
+ try {
18692
+ const tagsResp = await this.eventBridgeClient.send(
18693
+ new ListTagsForResourceCommand6({ ResourceARN: resp.Arn })
18694
+ );
18695
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
18696
+ if (tags.length > 0)
18697
+ result["Tags"] = tags;
18698
+ } catch (err) {
18699
+ if (err instanceof ResourceNotFoundException10)
18700
+ return void 0;
18701
+ throw err;
18702
+ }
18703
+ }
18523
18704
  return result;
18524
18705
  } catch (err) {
18525
18706
  if (err instanceof ResourceNotFoundException10)
@@ -22818,6 +22999,9 @@ var ApiGatewayV2Provider = class {
22818
22999
  }
22819
23000
  if (resp.CorsConfiguration)
22820
23001
  result["CorsConfiguration"] = resp.CorsConfiguration;
23002
+ const tags = normalizeAwsTagsToCfn(resp.Tags);
23003
+ if (tags.length > 0)
23004
+ result["Tags"] = tags;
22821
23005
  return result;
22822
23006
  } catch (err) {
22823
23007
  if (err instanceof NotFoundException4)
@@ -24268,8 +24452,9 @@ var StepFunctionsProvider = class {
24268
24452
  * time and not surfaced by `DescribeStateMachine` (the response carries
24269
24453
  * the already-substituted definition).
24270
24454
  *
24271
- * `Tags` is omitted (separate `ListTagsForResource` round-trip; auto-injected
24272
- * `aws:cdk:path` tag-shape question is out of scope here).
24455
+ * `Tags` is surfaced via a follow-up `ListTagsForResource(arn)` call.
24456
+ * CDK's `aws:*` auto-tags are filtered out; the result key is omitted
24457
+ * entirely when AWS reports no user tags.
24273
24458
  *
24274
24459
  * Returns `undefined` when the state machine is gone (`StateMachineDoesNotExist`).
24275
24460
  */
@@ -24337,6 +24522,17 @@ var StepFunctionsProvider = class {
24337
24522
  if (Object.keys(ec).length > 0)
24338
24523
  result["EncryptionConfiguration"] = ec;
24339
24524
  }
24525
+ try {
24526
+ const tagsResp = await this.getClient().send(
24527
+ new ListTagsForResourceCommand8({ resourceArn: physicalId })
24528
+ );
24529
+ const tags = normalizeAwsTagsToCfn(tagsResp.tags);
24530
+ if (tags.length > 0)
24531
+ result["Tags"] = tags;
24532
+ } catch (err) {
24533
+ if (!(err instanceof StateMachineDoesNotExist))
24534
+ throw err;
24535
+ }
24340
24536
  return result;
24341
24537
  }
24342
24538
  /**
@@ -25178,8 +25374,11 @@ var ECSProvider = class {
25178
25374
  * - `AWS::ECS::TaskDefinition` → `DescribeTaskDefinition`
25179
25375
  *
25180
25376
  * Each branch surfaces only the keys cdkd's `create()` accepts, mapping
25181
- * the SDK's camelCase to CFn PascalCase. Tags are intentionally omitted
25182
- * (separate `ListTagsForResource` round-trip).
25377
+ * the SDK's camelCase to CFn PascalCase. Tags are surfaced via
25378
+ * `DescribeClusters/Services(include=[TAGS])` for cluster / service, and
25379
+ * via `DescribeTaskDefinition(include=[TAGS])` for task definitions —
25380
+ * with CDK's `aws:*` auto-tags filtered out. Tag-result keys are omitted
25381
+ * when AWS reports no user tags.
25183
25382
  */
25184
25383
  async readCurrentState(physicalId, _logicalId, resourceType) {
25185
25384
  switch (resourceType) {
@@ -25197,7 +25396,7 @@ var ECSProvider = class {
25197
25396
  let resp;
25198
25397
  try {
25199
25398
  resp = await this.getClient().send(
25200
- new DescribeClustersCommand({ clusters: [physicalId] })
25399
+ new DescribeClustersCommand({ clusters: [physicalId], include: ["TAGS"] })
25201
25400
  );
25202
25401
  } catch {
25203
25402
  return void 0;
@@ -25220,6 +25419,9 @@ var ECSProvider = class {
25220
25419
  Value: s.value
25221
25420
  }));
25222
25421
  }
25422
+ const tags = normalizeAwsTagsToCfn(c.tags);
25423
+ if (tags.length > 0)
25424
+ result["Tags"] = tags;
25223
25425
  return result;
25224
25426
  }
25225
25427
  async readCurrentStateService(physicalId) {
@@ -25231,7 +25433,11 @@ var ECSProvider = class {
25231
25433
  let resp;
25232
25434
  try {
25233
25435
  resp = await this.getClient().send(
25234
- new DescribeServicesCommand({ cluster: clusterArn, services: [serviceName] })
25436
+ new DescribeServicesCommand({
25437
+ cluster: clusterArn,
25438
+ services: [serviceName],
25439
+ include: ["TAGS"]
25440
+ })
25235
25441
  );
25236
25442
  } catch {
25237
25443
  return void 0;
@@ -25284,13 +25490,16 @@ var ECSProvider = class {
25284
25490
  if (s.serviceRegistries && s.serviceRegistries.length > 0) {
25285
25491
  result["ServiceRegistries"] = s.serviceRegistries;
25286
25492
  }
25493
+ const tags = normalizeAwsTagsToCfn(s.tags);
25494
+ if (tags.length > 0)
25495
+ result["Tags"] = tags;
25287
25496
  return result;
25288
25497
  }
25289
25498
  async readCurrentStateTaskDefinition(physicalId) {
25290
25499
  let resp;
25291
25500
  try {
25292
25501
  resp = await this.getClient().send(
25293
- new DescribeTaskDefinitionCommand({ taskDefinition: physicalId })
25502
+ new DescribeTaskDefinitionCommand({ taskDefinition: physicalId, include: ["TAGS"] })
25294
25503
  );
25295
25504
  } catch {
25296
25505
  return void 0;
@@ -25333,6 +25542,9 @@ var ECSProvider = class {
25333
25542
  if (td.containerDefinitions && td.containerDefinitions.length > 0) {
25334
25543
  result["ContainerDefinitions"] = td.containerDefinitions;
25335
25544
  }
25545
+ const tags = normalizeAwsTagsToCfn(resp.tags);
25546
+ if (tags.length > 0)
25547
+ result["Tags"] = tags;
25336
25548
  return result;
25337
25549
  }
25338
25550
  /**
@@ -25961,8 +26173,11 @@ var ELBv2Provider = class {
25961
26173
  * - `Listener` → `DescribeListeners` (LoadBalancerArn, Certificates,
25962
26174
  * DefaultActions, Port, Protocol, SslPolicy).
25963
26175
  *
25964
- * Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
25965
- * when the resource is gone (`*NotFoundException`).
26176
+ * Tags are surfaced via a follow-up `DescribeTags(ResourceArns=[arn])`
26177
+ * for all three types (the `physicalId` cdkd state holds is the ARN).
26178
+ * CDK's `aws:*` auto-tags are filtered out and the result key is omitted
26179
+ * when AWS reports no user tags. Returns `undefined` when the resource
26180
+ * is gone (`*NotFoundException`).
25966
26181
  */
25967
26182
  async readCurrentState(physicalId, _logicalId, resourceType) {
25968
26183
  switch (resourceType) {
@@ -26009,6 +26224,7 @@ var ELBv2Provider = class {
26009
26224
  result["Type"] = lb.Type;
26010
26225
  if (lb.IpAddressType !== void 0)
26011
26226
  result["IpAddressType"] = lb.IpAddressType;
26227
+ await this.attachTags(result, physicalId);
26012
26228
  return result;
26013
26229
  }
26014
26230
  async readTargetGroup(physicalId) {
@@ -26067,6 +26283,7 @@ var ELBv2Provider = class {
26067
26283
  if (Object.keys(matcher).length > 0)
26068
26284
  result["Matcher"] = matcher;
26069
26285
  }
26286
+ await this.attachTags(result, physicalId);
26070
26287
  return result;
26071
26288
  }
26072
26289
  async readListener(physicalId) {
@@ -26108,8 +26325,23 @@ var ELBv2Provider = class {
26108
26325
  (a) => a
26109
26326
  );
26110
26327
  }
26328
+ await this.attachTags(result, physicalId);
26111
26329
  return result;
26112
26330
  }
26331
+ /** Best-effort tag fetch via `DescribeTags(ResourceArns=[arn])`. */
26332
+ async attachTags(result, arn) {
26333
+ try {
26334
+ const resp = await this.getClient().send(new DescribeTagsCommand({ ResourceArns: [arn] }));
26335
+ const tagDesc = resp.TagDescriptions?.[0];
26336
+ const tags = normalizeAwsTagsToCfn(tagDesc?.Tags);
26337
+ if (tags.length > 0)
26338
+ result["Tags"] = tags;
26339
+ } catch (err) {
26340
+ this.logger.debug(
26341
+ `ELBv2 DescribeTags(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`
26342
+ );
26343
+ }
26344
+ }
26113
26345
  /**
26114
26346
  * Adopt an existing ELBv2 LoadBalancer or TargetGroup into cdkd state.
26115
26347
  *
@@ -26864,8 +27096,10 @@ var RDSProvider = class {
26864
27096
  *
26865
27097
  * Each branch surfaces only the keys cdkd's `create()` accepts. Sensitive
26866
27098
  * fields like `MasterUserPassword` are NEVER surfaced (RDS does not return
26867
- * them in the Describe responses). `Tags` are intentionally omitted
26868
- * (separate `ListTagsForResource` round-trip).
27099
+ * them in the Describe responses). `Tags` are surfaced via a follow-up
27100
+ * `ListTagsForResource(ResourceName=arn)` call (RDS uses `[{Key, Value}]`
27101
+ * shape). CDK's `aws:*` auto-tags are filtered out; the result key is
27102
+ * omitted entirely when AWS reports no user tags.
26869
27103
  *
26870
27104
  * Returns `undefined` when the resource is gone (`*NotFoundFault`).
26871
27105
  */
@@ -26909,6 +27143,8 @@ var RDSProvider = class {
26909
27143
  if (inst.PubliclyAccessible !== void 0) {
26910
27144
  result["PubliclyAccessible"] = inst.PubliclyAccessible;
26911
27145
  }
27146
+ if (inst.DBInstanceArn)
27147
+ await this.attachTags(result, inst.DBInstanceArn);
26912
27148
  return result;
26913
27149
  }
26914
27150
  async readCurrentStateDBCluster(physicalId) {
@@ -26965,6 +27201,8 @@ var RDSProvider = class {
26965
27201
  if (Object.keys(sc).length > 0)
26966
27202
  result["ServerlessV2ScalingConfiguration"] = sc;
26967
27203
  }
27204
+ if (cluster.DBClusterArn)
27205
+ await this.attachTags(result, cluster.DBClusterArn);
26968
27206
  return result;
26969
27207
  }
26970
27208
  async readCurrentStateDBSubnetGroup(physicalId) {
@@ -26992,8 +27230,31 @@ var RDSProvider = class {
26992
27230
  (id) => !!id
26993
27231
  );
26994
27232
  }
27233
+ if (sg.DBSubnetGroupArn)
27234
+ await this.attachTags(result, sg.DBSubnetGroupArn);
26995
27235
  return result;
26996
27236
  }
27237
+ /**
27238
+ * Fetch tags via `ListTagsForResource(ResourceName=arn)` and merge them
27239
+ * into the result under `Tags` (CFn shape, `aws:*` filtered out, omitted
27240
+ * when empty). Best-effort: tag-fetch failures are logged at debug and
27241
+ * the key is simply left out — drift detection on configuration is more
27242
+ * important than fail-closing on a missing tag permission.
27243
+ */
27244
+ async attachTags(result, arn) {
27245
+ try {
27246
+ const tagsResp = await this.getClient().send(
27247
+ new ListTagsForResourceCommand10({ ResourceName: arn })
27248
+ );
27249
+ const tags = normalizeAwsTagsToCfn(tagsResp.TagList);
27250
+ if (tags.length > 0)
27251
+ result["Tags"] = tags;
27252
+ } catch (err) {
27253
+ this.logger.debug(
27254
+ `RDS ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`
27255
+ );
27256
+ }
27257
+ }
26997
27258
  async importDBInstance(input) {
26998
27259
  const explicit = resolveExplicitPhysicalId(input, "DBInstanceIdentifier");
26999
27260
  if (explicit) {
@@ -27770,10 +28031,11 @@ var Route53Provider = class {
27770
28031
  *
27771
28032
  * Dispatch per resource type:
27772
28033
  * - `HostedZone` → `GetHostedZone` (Name, HostedZoneConfig{Comment,
27773
- * PrivateZone}, VPCs from `VPCs[]`). Tags are skipped (CDK auto-tag
27774
- * handling deferred); QueryLoggingConfig is skipped because it's a
27775
- * separate `ListQueryLoggingConfigs` call and the v1 surface does
27776
- * not surface it.
28034
+ * PrivateZone}, VPCs from `VPCs[]`, HostedZoneTags via
28035
+ * `ListTagsForResource(ResourceType=hostedzone, ResourceId=<idTail>)`
28036
+ * with `aws:*` filtered out and the key omitted when empty).
28037
+ * QueryLoggingConfig is skipped because it's a separate
28038
+ * `ListQueryLoggingConfigs` call and the v1 surface does not surface it.
27777
28039
  * - `RecordSet` → `ListResourceRecordSets` filtered to the exact
27778
28040
  * `(name, type)` pair from the composite physicalId
27779
28041
  * (`{zoneId}|{name}|{type}`). Surfaces TTL, ResourceRecords (with
@@ -27828,6 +28090,19 @@ var Route53Provider = class {
27828
28090
  return out;
27829
28091
  });
27830
28092
  }
28093
+ const idTail = physicalId.replace(/^\/hostedzone\//, "");
28094
+ try {
28095
+ const tagsResp = await this.getClient().send(
28096
+ new ListTagsForResourceCommand11({ ResourceType: "hostedzone", ResourceId: idTail })
28097
+ );
28098
+ const tags = normalizeAwsTagsToCfn(tagsResp.ResourceTagSet?.Tags);
28099
+ if (tags.length > 0)
28100
+ result["HostedZoneTags"] = tags;
28101
+ } catch (err) {
28102
+ this.logger.debug(
28103
+ `Route53 ListTagsForResource(${idTail}) failed: ${err instanceof Error ? err.message : String(err)}`
28104
+ );
28105
+ }
27831
28106
  return result;
27832
28107
  }
27833
28108
  async readRecordSet(physicalId) {
@@ -28207,7 +28482,9 @@ var WAFv2WebACLProvider = class {
28207
28482
  * and AssociationConfig — every key cdkd state declares as
28208
28483
  * `handledProperties`. `Scope` is recovered from the ARN parse.
28209
28484
  *
28210
- * Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
28485
+ * Tags are surfaced via a follow-up `ListTagsForResource(ResourceARN)`
28486
+ * call. CDK's `aws:*` auto-tags are filtered out and the result key is
28487
+ * omitted when AWS reports no user tags. Returns `undefined`
28211
28488
  * when the ARN can't be parsed or the WebACL is gone
28212
28489
  * (`WAFNonexistentItemException`).
28213
28490
  */
@@ -28264,6 +28541,18 @@ var WAFv2WebACLProvider = class {
28264
28541
  if (webACL.AssociationConfig) {
28265
28542
  result["AssociationConfig"] = webACL.AssociationConfig;
28266
28543
  }
28544
+ try {
28545
+ const tagsResp = await this.getClient().send(
28546
+ new ListTagsForResourceCommand12({ ResourceARN: physicalId })
28547
+ );
28548
+ const tags = normalizeAwsTagsToCfn(tagsResp.TagInfoForResource?.TagList);
28549
+ if (tags.length > 0)
28550
+ result["Tags"] = tags;
28551
+ } catch (err) {
28552
+ this.logger.debug(
28553
+ `WAFv2 ListTagsForResource(${physicalId}) failed: ${err instanceof Error ? err.message : String(err)}`
28554
+ );
28555
+ }
28267
28556
  return result;
28268
28557
  }
28269
28558
  /**
@@ -28671,9 +28960,10 @@ var CognitoUserPoolProvider = class {
28671
28960
  * `UserPoolClient`, `UserPoolGroup`, and other Cognito sub-resources go
28672
28961
  * through the CC API fallback (which has its own `readCurrentState`).
28673
28962
  *
28674
- * `UserPoolTags` is intentionally omitted (Cognito returns tags via a
28675
- * separate `ListTagsForResource` round-trip; auto-injected `aws:cdk:path`
28676
- * tag-shape question is out of scope here).
28963
+ * `UserPoolTags` is surfaced from the same `DescribeUserPool` response
28964
+ * Cognito's CFn property is a tag-name → value map (NOT an array of
28965
+ * `{Key, Value}`), so we keep the map shape and just filter out CDK's
28966
+ * `aws:*` auto-tags. The result key is omitted when no user tags remain.
28677
28967
  *
28678
28968
  * Returns `undefined` when the pool is gone (`ResourceNotFoundException`).
28679
28969
  */
@@ -28750,6 +29040,15 @@ var CognitoUserPoolProvider = class {
28750
29040
  if (pool.SmsVerificationMessage !== void 0) {
28751
29041
  result["SmsVerificationMessage"] = pool.SmsVerificationMessage;
28752
29042
  }
29043
+ if (pool.UserPoolTags) {
29044
+ const userTags = {};
29045
+ for (const [k, v] of Object.entries(pool.UserPoolTags)) {
29046
+ if (!k.startsWith("aws:"))
29047
+ userTags[k] = v;
29048
+ }
29049
+ if (Object.keys(userTags).length > 0)
29050
+ result["UserPoolTags"] = userTags;
29051
+ }
28753
29052
  return result;
28754
29053
  }
28755
29054
  /**
@@ -29254,8 +29553,11 @@ var ElastiCacheProvider = class {
29254
29553
  * surfacing `CacheSubnetGroupName`, `CacheSubnetGroupDescription`,
29255
29554
  * and `SubnetIds` derived from `Subnets[].SubnetIdentifier`.
29256
29555
  *
29257
- * Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
29258
- * when the resource is gone (`*NotFoundFault`).
29556
+ * Tags are surfaced via a follow-up `ListTagsForResource(ResourceName=arn)`
29557
+ * for both types (ARN derived from `cluster.ARN` / `group.ARN`). CDK's
29558
+ * `aws:*` auto-tags are filtered out and the result key is omitted when
29559
+ * AWS reports no user tags. Returns `undefined` when the resource is gone
29560
+ * (`*NotFoundFault`).
29259
29561
  */
29260
29562
  async readCurrentState(physicalId, _logicalId, resourceType) {
29261
29563
  switch (resourceType) {
@@ -29335,6 +29637,8 @@ var ElastiCacheProvider = class {
29335
29637
  if (ids.length > 0)
29336
29638
  result["VpcSecurityGroupIds"] = ids;
29337
29639
  }
29640
+ if (cluster.ARN)
29641
+ await this.attachTags(result, cluster.ARN);
29338
29642
  return result;
29339
29643
  }
29340
29644
  async readSubnetGroup(physicalId) {
@@ -29363,8 +29667,25 @@ var ElastiCacheProvider = class {
29363
29667
  if (ids.length > 0)
29364
29668
  result["SubnetIds"] = ids;
29365
29669
  }
29670
+ if (group.ARN)
29671
+ await this.attachTags(result, group.ARN);
29366
29672
  return result;
29367
29673
  }
29674
+ /** Best-effort tag fetch — failures omit the key without breaking the read. */
29675
+ async attachTags(result, arn) {
29676
+ try {
29677
+ const tagsResp = await this.getClient().send(
29678
+ new ListTagsForResourceCommand14({ ResourceName: arn })
29679
+ );
29680
+ const tags = normalizeAwsTagsToCfn(tagsResp.TagList);
29681
+ if (tags.length > 0)
29682
+ result["Tags"] = tags;
29683
+ } catch (err) {
29684
+ this.logger.debug(
29685
+ `ElastiCache ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`
29686
+ );
29687
+ }
29688
+ }
29368
29689
  /**
29369
29690
  * Adopt an existing ElastiCache resource into cdkd state.
29370
29691
  *
@@ -29850,8 +30171,12 @@ var ServiceDiscoveryProvider = class {
29850
30171
  * - `Service` → `GetService` (Name, NamespaceId, Description, Type,
29851
30172
  * DnsConfig, HealthCheckConfig, HealthCheckCustomConfig).
29852
30173
  *
29853
- * Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
29854
- * when the resource is gone (`NamespaceNotFound` / `ServiceNotFound`).
30174
+ * Tags are surfaced via a follow-up `ListTagsForResource(ResourceARN)`
30175
+ * call (using the resource ARN from `GetNamespace.Arn` or
30176
+ * `GetService.Arn`). CDK's `aws:*` auto-tags are filtered out and the
30177
+ * result key is omitted when AWS reports no user tags. Returns
30178
+ * `undefined` when the resource is gone (`NamespaceNotFound` /
30179
+ * `ServiceNotFound`).
29855
30180
  */
29856
30181
  async readCurrentState(physicalId, _logicalId, resourceType) {
29857
30182
  switch (resourceType) {
@@ -29881,6 +30206,8 @@ var ServiceDiscoveryProvider = class {
29881
30206
  if (ns.Description !== void 0 && ns.Description !== "") {
29882
30207
  result["Description"] = ns.Description;
29883
30208
  }
30209
+ if (ns.Arn)
30210
+ await this.attachTags(result, ns.Arn);
29884
30211
  return result;
29885
30212
  }
29886
30213
  async readService(physicalId) {
@@ -29914,8 +30241,25 @@ var ServiceDiscoveryProvider = class {
29914
30241
  if (svc.HealthCheckCustomConfig) {
29915
30242
  result["HealthCheckCustomConfig"] = svc.HealthCheckCustomConfig;
29916
30243
  }
30244
+ if (svc.Arn)
30245
+ await this.attachTags(result, svc.Arn);
29917
30246
  return result;
29918
30247
  }
30248
+ /** Best-effort tag fetch via `ListTagsForResource(ResourceARN)`. */
30249
+ async attachTags(result, arn) {
30250
+ try {
30251
+ const tagsResp = await this.getClient().send(
30252
+ new ListTagsForResourceCommand15({ ResourceARN: arn })
30253
+ );
30254
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
30255
+ if (tags.length > 0)
30256
+ result["Tags"] = tags;
30257
+ } catch (err) {
30258
+ this.logger.debug(
30259
+ `ServiceDiscovery ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`
30260
+ );
30261
+ }
30262
+ }
29919
30263
  async import(input) {
29920
30264
  switch (input.resourceType) {
29921
30265
  case "AWS::ServiceDiscovery::PrivateDnsNamespace":
@@ -30562,7 +30906,9 @@ var AppSyncProvider = class {
30562
30906
  *
30563
30907
  * Dispatches per resource type:
30564
30908
  * - `GraphQLApi` → `GetGraphqlApi` (Name, AuthenticationType, XrayEnabled,
30565
- * LogConfig). Tags are skipped (CDK auto-tag handling deferred).
30909
+ * LogConfig, Tags). Tags come from the same response (`tags` map);
30910
+ * CDK's `aws:*` auto-tags are filtered out and the result key is
30911
+ * omitted when no user tags remain.
30566
30912
  * - `DataSource` → `GetDataSource` (Name, Type, Description,
30567
30913
  * ServiceRoleArn, DynamoDBConfig, LambdaConfig, HttpConfig). The
30568
30914
  * `ApiId` cdkd holds is recovered from the `apiId|name` physicalId.
@@ -30630,6 +30976,9 @@ var AppSyncProvider = class {
30630
30976
  if (Object.keys(log).length > 0)
30631
30977
  result["LogConfig"] = log;
30632
30978
  }
30979
+ const tags = normalizeAwsTagsToCfn(api.tags);
30980
+ if (tags.length > 0)
30981
+ result["Tags"] = tags;
30633
30982
  return result;
30634
30983
  }
30635
30984
  async readDataSource(physicalId) {
@@ -31875,9 +32224,11 @@ var KMSProvider = class {
31875
32224
  * Surfaces `AliasName`, `TargetKeyId`. `ListAliases` is paginated
31876
32225
  * since there's no direct "describe one alias" API.
31877
32226
  *
31878
- * `Tags` is intentionally omitted (separate `ListResourceTags` round-trip
31879
- * for keys; auto-injected `aws:cdk:path` tag-shape question is out of
31880
- * scope here). `BypassPolicyLockoutSafetyCheck` and `PendingWindowInDays`
32227
+ * `Tags` is surfaced for `AWS::KMS::Key` via a follow-up
32228
+ * `ListResourceTags(KeyId)` call (KMS uses `[{TagKey, TagValue}]` shape).
32229
+ * CDK's `aws:*` auto-tags are filtered out; the result key is omitted
32230
+ * entirely when AWS reports no user tags. `AWS::KMS::Alias` does not
32231
+ * support tags. `BypassPolicyLockoutSafetyCheck` and `PendingWindowInDays`
31881
32232
  * are not part of the persisted AWS state visible via `DescribeKey`.
31882
32233
  *
31883
32234
  * Returns `undefined` when the resource is gone (`NotFoundException`).
@@ -31920,6 +32271,19 @@ var KMSProvider = class {
31920
32271
  result["MultiRegion"] = md.MultiRegion;
31921
32272
  if (md.Origin !== void 0)
31922
32273
  result["Origin"] = md.Origin;
32274
+ if (md.KeyId) {
32275
+ try {
32276
+ const tagsResp = await this.getClient().send(
32277
+ new ListResourceTagsCommand({ KeyId: md.KeyId })
32278
+ );
32279
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
32280
+ if (tags.length > 0)
32281
+ result["Tags"] = tags;
32282
+ } catch (err) {
32283
+ if (err instanceof NotFoundException5)
32284
+ return void 0;
32285
+ }
32286
+ }
31923
32287
  return result;
31924
32288
  }
31925
32289
  async readCurrentStateAlias(physicalId) {
@@ -32303,7 +32667,8 @@ var KinesisStreamProvider = class {
32303
32667
  *
32304
32668
  * Issues `DescribeStream` and surfaces the keys cdkd's `create()`
32305
32669
  * accepts: `Name`, `StreamModeDetails`, `ShardCount`, `RetentionPeriodHours`,
32306
- * and `StreamEncryption`. Tags are skipped (CDK auto-tag handling deferred).
32670
+ * and `StreamEncryption`. Tags are surfaced via a follow-up
32671
+ * `ListTagsForStream` with `aws:*` filtered out.
32307
32672
  *
32308
32673
  * `ShardCount` is reported as the count of `Shards[]` in the stream
32309
32674
  * description (only present for PROVISIONED-mode streams; ON_DEMAND
@@ -32352,6 +32717,20 @@ var KinesisStreamProvider = class {
32352
32717
  encryption["KeyId"] = stream.KeyId;
32353
32718
  result["StreamEncryption"] = encryption;
32354
32719
  }
32720
+ try {
32721
+ const tagsResp = await this.getClient().send(
32722
+ new ListTagsForStreamCommand({ StreamName: physicalId })
32723
+ );
32724
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
32725
+ if (tags.length > 0)
32726
+ result["Tags"] = tags;
32727
+ } catch (err) {
32728
+ if (err instanceof ResourceNotFoundException13)
32729
+ return void 0;
32730
+ this.logger.debug(
32731
+ `Kinesis ListTagsForStream(${physicalId}) failed: ${err instanceof Error ? err.message : String(err)}`
32732
+ );
32733
+ }
32355
32734
  return result;
32356
32735
  }
32357
32736
  async import(input) {
@@ -32864,7 +33243,12 @@ var EFSProvider = class {
32864
33243
  * - `MountTarget` → `DescribeMountTargets` (FileSystemId, SubnetId).
32865
33244
  * SecurityGroups requires a separate call and is omitted for v1.
32866
33245
  *
32867
- * Tags are skipped across all three (CDK auto-tag handling deferred).
33246
+ * `FileSystemTags` (the CFn property name on `AWS::EFS::FileSystem`) is
33247
+ * surfaced from the same `DescribeFileSystems` response — `aws:*`
33248
+ * auto-tags filtered, key omitted when empty. `AccessPoint` and
33249
+ * `MountTarget` are not surfaced for tags here (`AccessPointTags` would
33250
+ * mirror this approach but the test scope below covers `FileSystem`
33251
+ * only; further coverage can land in a follow-up).
32868
33252
  * Returns `undefined` when the resource is gone (`*NotFound`).
32869
33253
  */
32870
33254
  async readCurrentState(physicalId, _logicalId, resourceType) {
@@ -32941,6 +33325,9 @@ var EFSProvider = class {
32941
33325
  if (err instanceof FileSystemNotFound)
32942
33326
  return void 0;
32943
33327
  }
33328
+ const tags = normalizeAwsTagsToCfn(fs.Tags);
33329
+ if (tags.length > 0)
33330
+ result["FileSystemTags"] = tags;
32944
33331
  return result;
32945
33332
  }
32946
33333
  async readAccessPoint(physicalId) {
@@ -33492,8 +33879,10 @@ var FirehoseProvider = class {
33492
33879
  * fields. Drift on destination contents is best chased manually via
33493
33880
  * `aws firehose describe-delivery-stream` for now.
33494
33881
  *
33495
- * Tags + DeliveryStreamEncryptionConfigurationInput are skipped (they
33496
- * each need separate calls / shape decisions).
33882
+ * Tags are surfaced via a follow-up `ListTagsForDeliveryStream` call
33883
+ * with `aws:*` filtered out and the result key omitted when empty.
33884
+ * `DeliveryStreamEncryptionConfigurationInput` is still skipped (shape
33885
+ * decision deferred).
33497
33886
  *
33498
33887
  * Returns `undefined` when the stream is gone (`ResourceNotFoundException`).
33499
33888
  */
@@ -33529,6 +33918,20 @@ var FirehoseProvider = class {
33529
33918
  result["KinesisStreamSourceConfiguration"] = srcOut;
33530
33919
  }
33531
33920
  }
33921
+ try {
33922
+ const tagsResp = await this.getClient().send(
33923
+ new ListTagsForDeliveryStreamCommand({ DeliveryStreamName: physicalId })
33924
+ );
33925
+ const tags = normalizeAwsTagsToCfn(tagsResp.Tags);
33926
+ if (tags.length > 0)
33927
+ result["Tags"] = tags;
33928
+ } catch (err) {
33929
+ if (err instanceof ResourceNotFoundException14)
33930
+ return void 0;
33931
+ this.logger.debug(
33932
+ `Firehose ListTagsForDeliveryStream(${physicalId}) failed: ${err instanceof Error ? err.message : String(err)}`
33933
+ );
33934
+ }
33532
33935
  return result;
33533
33936
  }
33534
33937
  async import(input) {
@@ -33864,8 +34267,13 @@ var CloudTrailProvider = class {
33864
34267
  * derived field; the cdkd state property is `SnsTopicName` so we
33865
34268
  * surface `SnsTopicName` directly from `GetTrail.SnsTopicName`.
33866
34269
  *
33867
- * Tags + InsightSelectors are skipped for v1 (each needs its own
33868
- * separate call + shape mapping).
34270
+ * Tags are surfaced via a follow-up `ListTags(ResourceIdList=[arn])` call
34271
+ * (using the trail ARN from the same `GetTrail` response). CDK's `aws:*`
34272
+ * auto-tags are filtered out and the result key is omitted when AWS
34273
+ * reports no user tags.
34274
+ *
34275
+ * `InsightSelectors` is skipped for v1 (separate call + shape mapping
34276
+ * still TBD).
33869
34277
  *
33870
34278
  * Returns `undefined` when the trail is gone (`TrailNotFoundException`).
33871
34279
  */
@@ -33927,6 +34335,20 @@ var CloudTrailProvider = class {
33927
34335
  }
33928
34336
  } catch {
33929
34337
  }
34338
+ if (trail.TrailARN) {
34339
+ try {
34340
+ const tagsResp = await this.getClient().send(
34341
+ new ListTagsCommand3({ ResourceIdList: [trail.TrailARN] })
34342
+ );
34343
+ const tags = normalizeAwsTagsToCfn(tagsResp.ResourceTagList?.[0]?.TagsList);
34344
+ if (tags.length > 0)
34345
+ result["Tags"] = tags;
34346
+ } catch (err) {
34347
+ this.logger.debug(
34348
+ `CloudTrail ListTags(${trail.TrailARN}) failed: ${err instanceof Error ? err.message : String(err)}`
34349
+ );
34350
+ }
34351
+ }
33930
34352
  return result;
33931
34353
  }
33932
34354
  async import(input) {
@@ -34259,8 +34681,12 @@ var CodeBuildProvider = class {
34259
34681
  * is left to a follow-up — surfacing them with a partial shape would
34260
34682
  * fire false drift on every project that uses them.
34261
34683
  *
34262
- * Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
34263
- * when the project is gone (`projects` array empty / `projectsNotFound` set).
34684
+ * Tags are surfaced from the same `BatchGetProjects` response (CodeBuild
34685
+ * uses lower-case `key`/`value` shape; `normalizeAwsTagsToCfn` re-shapes
34686
+ * to CFn `[{Key, Value}]`). CDK's `aws:*` auto-tags are filtered out
34687
+ * and the result key is omitted when AWS reports no user tags. Returns
34688
+ * `undefined` when the project is gone (`projects` array empty /
34689
+ * `projectsNotFound` set).
34264
34690
  */
34265
34691
  async readCurrentState(physicalId, _logicalId, _resourceType) {
34266
34692
  let project;
@@ -34379,6 +34805,9 @@ var CodeBuildProvider = class {
34379
34805
  if (Object.keys(env).length > 0)
34380
34806
  result["Environment"] = env;
34381
34807
  }
34808
+ const tags = normalizeAwsTagsToCfn(project.tags);
34809
+ if (tags.length > 0)
34810
+ result["Tags"] = tags;
34382
34811
  return result;
34383
34812
  }
34384
34813
  async import(input) {
@@ -35907,11 +36336,14 @@ var ECRProvider = class {
35907
36336
  * round-trip; cdkd state holds the policy as either a string or an
35908
36337
  * object (depending on user input), and the comparator round-trip
35909
36338
  * is not yet handled here.
35910
- * - `Tags`: requires `ListTagsForResource`; auto-injected
35911
- * `aws:cdk:path` tag-shape question is out of scope.
35912
36339
  * - `EmptyOnDelete` / `ImageTagMutabilityExclusionFilters`: not part
35913
36340
  * of the persisted AWS state visible via standard Describe.
35914
36341
  *
36342
+ * `Tags` is surfaced via a follow-up `ListTagsForResource(arn)` call
36343
+ * (using the repository ARN that `DescribeRepositories` returns). CDK's
36344
+ * `aws:*` auto-tags are filtered out; the result key is omitted entirely
36345
+ * when AWS reports no user tags.
36346
+ *
35915
36347
  * Returns `undefined` when the repository is gone (`RepositoryNotFoundException`).
35916
36348
  */
35917
36349
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -35964,6 +36396,19 @@ var ECRProvider = class {
35964
36396
  throw err;
35965
36397
  }
35966
36398
  }
36399
+ if (r.repositoryArn) {
36400
+ try {
36401
+ const tagsResp = await this.getClient().send(
36402
+ new ListTagsForResourceCommand18({ resourceArn: r.repositoryArn })
36403
+ );
36404
+ const tags = normalizeAwsTagsToCfn(tagsResp.tags);
36405
+ if (tags.length > 0)
36406
+ result["Tags"] = tags;
36407
+ } catch (err) {
36408
+ if (!(err instanceof RepositoryNotFoundException))
36409
+ throw err;
36410
+ }
36411
+ }
35967
36412
  return result;
35968
36413
  }
35969
36414
  /**
@@ -42003,7 +42448,7 @@ function reorderArgs(argv) {
42003
42448
  }
42004
42449
  async function main() {
42005
42450
  const program = new Command14();
42006
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.45.0");
42451
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.46.0");
42007
42452
  program.addCommand(createBootstrapCommand());
42008
42453
  program.addCommand(createSynthCommand());
42009
42454
  program.addCommand(createListCommand());