@go-to-k/cdkd 0.18.1 → 0.19.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 +327 -18
- package/dist/cli.js.map +3 -3
- package/dist/go-to-k-cdkd-0.19.0.tgz +0 -0
- package/package.json +1 -1
- package/dist/go-to-k-cdkd-0.18.1.tgz +0 -0
package/dist/cli.js
CHANGED
|
@@ -14229,7 +14229,8 @@ var LogsLogGroupProvider = class {
|
|
|
14229
14229
|
import {
|
|
14230
14230
|
PutMetricAlarmCommand,
|
|
14231
14231
|
DeleteAlarmsCommand,
|
|
14232
|
-
DescribeAlarmsCommand
|
|
14232
|
+
DescribeAlarmsCommand,
|
|
14233
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand3
|
|
14233
14234
|
} from "@aws-sdk/client-cloudwatch";
|
|
14234
14235
|
init_aws_clients();
|
|
14235
14236
|
var CloudWatchAlarmProvider = class {
|
|
@@ -14447,6 +14448,62 @@ var CloudWatchAlarmProvider = class {
|
|
|
14447
14448
|
}
|
|
14448
14449
|
return params;
|
|
14449
14450
|
}
|
|
14451
|
+
/**
|
|
14452
|
+
* Adopt an existing CloudWatch alarm into cdkd state.
|
|
14453
|
+
*
|
|
14454
|
+
* Lookup order:
|
|
14455
|
+
* 1. `--resource` override or `Properties.AlarmName` → verify via `DescribeAlarms`.
|
|
14456
|
+
* 2. `DescribeAlarms` paginated, then `ListTagsForResource(AlarmArn)` per
|
|
14457
|
+
* alarm to match `aws:cdk:path`.
|
|
14458
|
+
*/
|
|
14459
|
+
async import(input) {
|
|
14460
|
+
const explicit = resolveExplicitPhysicalId(input, "AlarmName");
|
|
14461
|
+
if (explicit) {
|
|
14462
|
+
try {
|
|
14463
|
+
const resp = await this.cloudWatchClient.send(
|
|
14464
|
+
new DescribeAlarmsCommand({ AlarmNames: [explicit] })
|
|
14465
|
+
);
|
|
14466
|
+
return resp.MetricAlarms?.[0] || resp.CompositeAlarms?.[0] ? { physicalId: explicit, attributes: {} } : null;
|
|
14467
|
+
} catch (err) {
|
|
14468
|
+
if (this.isNotFound(err))
|
|
14469
|
+
return null;
|
|
14470
|
+
throw err;
|
|
14471
|
+
}
|
|
14472
|
+
}
|
|
14473
|
+
if (!input.cdkPath)
|
|
14474
|
+
return null;
|
|
14475
|
+
let nextToken;
|
|
14476
|
+
do {
|
|
14477
|
+
const list = await this.cloudWatchClient.send(
|
|
14478
|
+
new DescribeAlarmsCommand({ ...nextToken && { NextToken: nextToken } })
|
|
14479
|
+
);
|
|
14480
|
+
const all = [...list.MetricAlarms ?? [], ...list.CompositeAlarms ?? []];
|
|
14481
|
+
for (const a of all) {
|
|
14482
|
+
if (!a.AlarmArn || !a.AlarmName)
|
|
14483
|
+
continue;
|
|
14484
|
+
try {
|
|
14485
|
+
const tagsResp = await this.cloudWatchClient.send(
|
|
14486
|
+
new ListTagsForResourceCommand3({ ResourceARN: a.AlarmArn })
|
|
14487
|
+
);
|
|
14488
|
+
if (matchesCdkPath(tagsResp.Tags, input.cdkPath)) {
|
|
14489
|
+
return { physicalId: a.AlarmName, attributes: {} };
|
|
14490
|
+
}
|
|
14491
|
+
} catch (err) {
|
|
14492
|
+
if (this.isNotFound(err))
|
|
14493
|
+
continue;
|
|
14494
|
+
throw err;
|
|
14495
|
+
}
|
|
14496
|
+
}
|
|
14497
|
+
nextToken = list.NextToken;
|
|
14498
|
+
} while (nextToken);
|
|
14499
|
+
return null;
|
|
14500
|
+
}
|
|
14501
|
+
isNotFound(err) {
|
|
14502
|
+
if (!(err instanceof Error))
|
|
14503
|
+
return false;
|
|
14504
|
+
const name = err.name ?? "";
|
|
14505
|
+
return name === "ResourceNotFoundException" || name === "ResourceNotFound";
|
|
14506
|
+
}
|
|
14450
14507
|
};
|
|
14451
14508
|
|
|
14452
14509
|
// src/provisioning/providers/secretsmanager-secret-provider.ts
|
|
@@ -14780,7 +14837,7 @@ var SecretsManagerSecretProvider = class {
|
|
|
14780
14837
|
import {
|
|
14781
14838
|
DescribeParametersCommand,
|
|
14782
14839
|
GetParameterCommand as GetParameterCommand3,
|
|
14783
|
-
ListTagsForResourceCommand as
|
|
14840
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand4,
|
|
14784
14841
|
PutParameterCommand,
|
|
14785
14842
|
DeleteParameterCommand,
|
|
14786
14843
|
AddTagsToResourceCommand,
|
|
@@ -15028,7 +15085,7 @@ var SSMParameterProvider = class {
|
|
|
15028
15085
|
continue;
|
|
15029
15086
|
try {
|
|
15030
15087
|
const tagsResp = await this.ssmClient.send(
|
|
15031
|
-
new
|
|
15088
|
+
new ListTagsForResourceCommand4({ ResourceType: "Parameter", ResourceId: p.Name })
|
|
15032
15089
|
);
|
|
15033
15090
|
if (matchesCdkPath(tagsResp.TagList, input.cdkPath)) {
|
|
15034
15091
|
return { physicalId: p.Name, attributes: {} };
|
|
@@ -15343,7 +15400,7 @@ import {
|
|
|
15343
15400
|
DescribeEventBusCommand,
|
|
15344
15401
|
ListEventBusesCommand,
|
|
15345
15402
|
ListRulesCommand,
|
|
15346
|
-
ListTagsForResourceCommand as
|
|
15403
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand5,
|
|
15347
15404
|
RemoveTargetsCommand as RemoveTargetsCommand2,
|
|
15348
15405
|
DeleteRuleCommand as DeleteRuleCommand2,
|
|
15349
15406
|
ListTargetsByRuleCommand as ListTargetsByRuleCommand2,
|
|
@@ -15615,7 +15672,7 @@ var EventBridgeBusProvider = class {
|
|
|
15615
15672
|
continue;
|
|
15616
15673
|
try {
|
|
15617
15674
|
const tagsResp = await this.eventBridgeClient.send(
|
|
15618
|
-
new
|
|
15675
|
+
new ListTagsForResourceCommand5({ ResourceARN: bus.Arn })
|
|
15619
15676
|
);
|
|
15620
15677
|
if (matchesCdkPath(tagsResp.Tags, input.cdkPath)) {
|
|
15621
15678
|
return { physicalId: bus.Name, attributes: {} };
|
|
@@ -18690,6 +18747,8 @@ import {
|
|
|
18690
18747
|
DeleteRouteCommand as DeleteRouteCommand2,
|
|
18691
18748
|
CreateAuthorizerCommand as CreateAuthorizerCommand2,
|
|
18692
18749
|
DeleteAuthorizerCommand as DeleteAuthorizerCommand2,
|
|
18750
|
+
GetApiCommand,
|
|
18751
|
+
GetApisCommand,
|
|
18693
18752
|
NotFoundException as NotFoundException4
|
|
18694
18753
|
} from "@aws-sdk/client-apigatewayv2";
|
|
18695
18754
|
var ApiGatewayV2Provider = class {
|
|
@@ -19223,6 +19282,56 @@ var ApiGatewayV2Provider = class {
|
|
|
19223
19282
|
);
|
|
19224
19283
|
}
|
|
19225
19284
|
}
|
|
19285
|
+
// ─── Import ───────────────────────────────────────────────────────
|
|
19286
|
+
/**
|
|
19287
|
+
* Adopt an existing API Gateway V2 resource into cdkd state.
|
|
19288
|
+
*
|
|
19289
|
+
* `AWS::ApiGatewayV2::Api` supports full tag-based auto-lookup via
|
|
19290
|
+
* `GetApis` (`Tags` is a `Record<string,string>` map on each item).
|
|
19291
|
+
*
|
|
19292
|
+
* Sub-resources (`Stage`, `Integration`, `Route`, `Authorizer`) are
|
|
19293
|
+
* scoped under a parent `ApiId`, and their physical ids are not
|
|
19294
|
+
* globally unique — auto-lookup would need to walk every Api in the
|
|
19295
|
+
* account and every sub-resource within. Explicit-override only;
|
|
19296
|
+
* users adopt an existing HTTP API by passing
|
|
19297
|
+
* `--resource <logicalId>=<physicalId>` for each sub-resource.
|
|
19298
|
+
*/
|
|
19299
|
+
async import(input) {
|
|
19300
|
+
if (input.resourceType !== "AWS::ApiGatewayV2::Api") {
|
|
19301
|
+
if (input.knownPhysicalId) {
|
|
19302
|
+
return { physicalId: input.knownPhysicalId, attributes: {} };
|
|
19303
|
+
}
|
|
19304
|
+
return null;
|
|
19305
|
+
}
|
|
19306
|
+
const explicit = resolveExplicitPhysicalId(input, null);
|
|
19307
|
+
if (explicit) {
|
|
19308
|
+
try {
|
|
19309
|
+
await this.getClient().send(new GetApiCommand({ ApiId: explicit }));
|
|
19310
|
+
return { physicalId: explicit, attributes: {} };
|
|
19311
|
+
} catch (err) {
|
|
19312
|
+
if (err instanceof NotFoundException4)
|
|
19313
|
+
return null;
|
|
19314
|
+
throw err;
|
|
19315
|
+
}
|
|
19316
|
+
}
|
|
19317
|
+
if (!input.cdkPath)
|
|
19318
|
+
return null;
|
|
19319
|
+
let nextToken;
|
|
19320
|
+
do {
|
|
19321
|
+
const list = await this.getClient().send(
|
|
19322
|
+
new GetApisCommand({ ...nextToken && { NextToken: nextToken } })
|
|
19323
|
+
);
|
|
19324
|
+
for (const api of list.Items ?? []) {
|
|
19325
|
+
if (!api.ApiId)
|
|
19326
|
+
continue;
|
|
19327
|
+
if (api.Tags?.[CDK_PATH_TAG] === input.cdkPath) {
|
|
19328
|
+
return { physicalId: api.ApiId, attributes: {} };
|
|
19329
|
+
}
|
|
19330
|
+
}
|
|
19331
|
+
nextToken = list.NextToken;
|
|
19332
|
+
} while (nextToken);
|
|
19333
|
+
return null;
|
|
19334
|
+
}
|
|
19226
19335
|
// ─── Helpers ──────────────────────────────────────────────────────
|
|
19227
19336
|
/**
|
|
19228
19337
|
* Convert CloudFormation Tags (Array<{Key, Value}>) to SDK Tags (Record<string, string>).
|
|
@@ -19396,7 +19505,7 @@ import {
|
|
|
19396
19505
|
GetDistributionCommand,
|
|
19397
19506
|
GetDistributionConfigCommand,
|
|
19398
19507
|
ListDistributionsCommand,
|
|
19399
|
-
ListTagsForResourceCommand as
|
|
19508
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand6,
|
|
19400
19509
|
NoSuchDistribution
|
|
19401
19510
|
} from "@aws-sdk/client-cloudfront";
|
|
19402
19511
|
init_aws_clients();
|
|
@@ -19832,7 +19941,7 @@ var CloudFrontDistributionProvider = class {
|
|
|
19832
19941
|
continue;
|
|
19833
19942
|
try {
|
|
19834
19943
|
const tagsResp = await this.cloudFrontClient.send(
|
|
19835
|
-
new
|
|
19944
|
+
new ListTagsForResourceCommand6({ Resource: d.ARN })
|
|
19836
19945
|
);
|
|
19837
19946
|
if (matchesCdkPath(tagsResp.Tags?.Items, input.cdkPath)) {
|
|
19838
19947
|
return { physicalId: d.Id, attributes: {} };
|
|
@@ -20339,7 +20448,7 @@ import {
|
|
|
20339
20448
|
DescribeServicesCommand,
|
|
20340
20449
|
ListClustersCommand,
|
|
20341
20450
|
ListServicesCommand,
|
|
20342
|
-
ListTagsForResourceCommand as
|
|
20451
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand7
|
|
20343
20452
|
} from "@aws-sdk/client-ecs";
|
|
20344
20453
|
function convertTags(tags) {
|
|
20345
20454
|
if (!tags || tags.length === 0)
|
|
@@ -21117,7 +21226,7 @@ var ECSProvider = class {
|
|
|
21117
21226
|
);
|
|
21118
21227
|
for (const arn of list.clusterArns ?? []) {
|
|
21119
21228
|
const tagsResp = await this.getClient().send(
|
|
21120
|
-
new
|
|
21229
|
+
new ListTagsForResourceCommand7({ resourceArn: arn })
|
|
21121
21230
|
);
|
|
21122
21231
|
if (this.tagsMatchCdkPath(tagsResp.tags, input.cdkPath)) {
|
|
21123
21232
|
const name = arn.substring(arn.lastIndexOf("/") + 1);
|
|
@@ -21150,7 +21259,7 @@ var ECSProvider = class {
|
|
|
21150
21259
|
);
|
|
21151
21260
|
for (const svcArn of svcList.serviceArns ?? []) {
|
|
21152
21261
|
const tagsResp = await this.getClient().send(
|
|
21153
|
-
new
|
|
21262
|
+
new ListTagsForResourceCommand7({ resourceArn: svcArn })
|
|
21154
21263
|
);
|
|
21155
21264
|
if (this.tagsMatchCdkPath(tagsResp.tags, input.cdkPath)) {
|
|
21156
21265
|
const svcName = svcArn.substring(svcArn.lastIndexOf("/") + 1);
|
|
@@ -21724,7 +21833,7 @@ import {
|
|
|
21724
21833
|
DeleteDBSubnetGroupCommand,
|
|
21725
21834
|
DescribeDBSubnetGroupsCommand,
|
|
21726
21835
|
ModifyDBSubnetGroupCommand,
|
|
21727
|
-
ListTagsForResourceCommand as
|
|
21836
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand8
|
|
21728
21837
|
} from "@aws-sdk/client-rds";
|
|
21729
21838
|
var RDSProvider = class {
|
|
21730
21839
|
rdsClient;
|
|
@@ -22365,7 +22474,7 @@ var RDSProvider = class {
|
|
|
22365
22474
|
if (!inst.DBInstanceIdentifier || !inst.DBInstanceArn)
|
|
22366
22475
|
continue;
|
|
22367
22476
|
const tagsResp = await this.getClient().send(
|
|
22368
|
-
new
|
|
22477
|
+
new ListTagsForResourceCommand8({ ResourceName: inst.DBInstanceArn })
|
|
22369
22478
|
);
|
|
22370
22479
|
if (matchesCdkPath(tagsResp.TagList, input.cdkPath)) {
|
|
22371
22480
|
return { physicalId: inst.DBInstanceIdentifier, attributes: {} };
|
|
@@ -22400,7 +22509,7 @@ var RDSProvider = class {
|
|
|
22400
22509
|
if (!c.DBClusterIdentifier || !c.DBClusterArn)
|
|
22401
22510
|
continue;
|
|
22402
22511
|
const tagsResp = await this.getClient().send(
|
|
22403
|
-
new
|
|
22512
|
+
new ListTagsForResourceCommand8({ ResourceName: c.DBClusterArn })
|
|
22404
22513
|
);
|
|
22405
22514
|
if (matchesCdkPath(tagsResp.TagList, input.cdkPath)) {
|
|
22406
22515
|
return { physicalId: c.DBClusterIdentifier, attributes: {} };
|
|
@@ -22435,7 +22544,7 @@ var RDSProvider = class {
|
|
|
22435
22544
|
if (!sg.DBSubnetGroupName || !sg.DBSubnetGroupArn)
|
|
22436
22545
|
continue;
|
|
22437
22546
|
const tagsResp = await this.getClient().send(
|
|
22438
|
-
new
|
|
22547
|
+
new ListTagsForResourceCommand8({ ResourceName: sg.DBSubnetGroupArn })
|
|
22439
22548
|
);
|
|
22440
22549
|
if (matchesCdkPath(tagsResp.TagList, input.cdkPath)) {
|
|
22441
22550
|
return { physicalId: sg.DBSubnetGroupName, attributes: {} };
|
|
@@ -23341,7 +23450,7 @@ import {
|
|
|
23341
23450
|
UpdateUserPoolCommand,
|
|
23342
23451
|
DescribeUserPoolCommand,
|
|
23343
23452
|
ListUserPoolsCommand,
|
|
23344
|
-
ListTagsForResourceCommand as
|
|
23453
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand9,
|
|
23345
23454
|
ResourceNotFoundException as ResourceNotFoundException12
|
|
23346
23455
|
} from "@aws-sdk/client-cognito-identity-provider";
|
|
23347
23456
|
var CognitoUserPoolProvider = class {
|
|
@@ -23726,7 +23835,7 @@ var CognitoUserPoolProvider = class {
|
|
|
23726
23835
|
if (!arn)
|
|
23727
23836
|
continue;
|
|
23728
23837
|
const tagsResp = await this.getClient().send(
|
|
23729
|
-
new
|
|
23838
|
+
new ListTagsForResourceCommand9({ ResourceArn: arn })
|
|
23730
23839
|
);
|
|
23731
23840
|
if (tagsResp.Tags?.[CDK_PATH_TAG] === input.cdkPath) {
|
|
23732
23841
|
return { physicalId: pool.Id, attributes: {} };
|
|
@@ -24512,7 +24621,10 @@ import {
|
|
|
24512
24621
|
DeleteResolverCommand,
|
|
24513
24622
|
CreateApiKeyCommand,
|
|
24514
24623
|
DeleteApiKeyCommand,
|
|
24515
|
-
StartSchemaCreationCommand
|
|
24624
|
+
StartSchemaCreationCommand,
|
|
24625
|
+
GetGraphqlApiCommand,
|
|
24626
|
+
ListGraphqlApisCommand,
|
|
24627
|
+
NotFoundException as AppSyncNotFoundException
|
|
24516
24628
|
} from "@aws-sdk/client-appsync";
|
|
24517
24629
|
var AppSyncProvider = class {
|
|
24518
24630
|
client;
|
|
@@ -25020,6 +25132,51 @@ var AppSyncProvider = class {
|
|
|
25020
25132
|
const name = error.name ?? "";
|
|
25021
25133
|
return message.includes("not found") || message.includes("does not exist") || name === "NotFoundException";
|
|
25022
25134
|
}
|
|
25135
|
+
/**
|
|
25136
|
+
* Adopt an existing AppSync resource into cdkd state.
|
|
25137
|
+
*
|
|
25138
|
+
* `AWS::AppSync::GraphQLApi` supports full tag-based auto-lookup via
|
|
25139
|
+
* `ListGraphqlApis` (each item carries a `tags` map). AppSync sub-resources
|
|
25140
|
+
* (`GraphQLSchema`, `DataSource`, `Resolver`, `ApiKey`) are scoped under a
|
|
25141
|
+
* parent `apiId` and cannot be discovered by tag at the account level —
|
|
25142
|
+
* explicit-override only.
|
|
25143
|
+
*/
|
|
25144
|
+
async import(input) {
|
|
25145
|
+
if (input.resourceType !== "AWS::AppSync::GraphQLApi") {
|
|
25146
|
+
if (input.knownPhysicalId) {
|
|
25147
|
+
return { physicalId: input.knownPhysicalId, attributes: {} };
|
|
25148
|
+
}
|
|
25149
|
+
return null;
|
|
25150
|
+
}
|
|
25151
|
+
const explicit = resolveExplicitPhysicalId(input, null);
|
|
25152
|
+
if (explicit) {
|
|
25153
|
+
try {
|
|
25154
|
+
await this.getClient().send(new GetGraphqlApiCommand({ apiId: explicit }));
|
|
25155
|
+
return { physicalId: explicit, attributes: {} };
|
|
25156
|
+
} catch (err) {
|
|
25157
|
+
if (err instanceof AppSyncNotFoundException)
|
|
25158
|
+
return null;
|
|
25159
|
+
throw err;
|
|
25160
|
+
}
|
|
25161
|
+
}
|
|
25162
|
+
if (!input.cdkPath)
|
|
25163
|
+
return null;
|
|
25164
|
+
let nextToken;
|
|
25165
|
+
do {
|
|
25166
|
+
const list = await this.getClient().send(
|
|
25167
|
+
new ListGraphqlApisCommand({ ...nextToken && { nextToken } })
|
|
25168
|
+
);
|
|
25169
|
+
for (const api of list.graphqlApis ?? []) {
|
|
25170
|
+
if (!api.apiId)
|
|
25171
|
+
continue;
|
|
25172
|
+
if (api.tags?.[CDK_PATH_TAG] === input.cdkPath) {
|
|
25173
|
+
return { physicalId: api.apiId, attributes: {} };
|
|
25174
|
+
}
|
|
25175
|
+
}
|
|
25176
|
+
nextToken = list.nextToken;
|
|
25177
|
+
} while (nextToken);
|
|
25178
|
+
return null;
|
|
25179
|
+
}
|
|
25023
25180
|
};
|
|
25024
25181
|
|
|
25025
25182
|
// src/provisioning/providers/glue-provider.ts
|
|
@@ -26958,6 +27115,9 @@ import {
|
|
|
26958
27115
|
StopLoggingCommand,
|
|
26959
27116
|
PutEventSelectorsCommand,
|
|
26960
27117
|
PutInsightSelectorsCommand,
|
|
27118
|
+
GetTrailCommand,
|
|
27119
|
+
ListTrailsCommand,
|
|
27120
|
+
ListTagsCommand as ListTagsCommand2,
|
|
26961
27121
|
TrailNotFoundException
|
|
26962
27122
|
} from "@aws-sdk/client-cloudtrail";
|
|
26963
27123
|
var CloudTrailProvider = class {
|
|
@@ -27189,6 +27349,54 @@ var CloudTrailProvider = class {
|
|
|
27189
27349
|
getAttribute(_physicalId, _resourceType, attributeName) {
|
|
27190
27350
|
return Promise.resolve(attributeName);
|
|
27191
27351
|
}
|
|
27352
|
+
/**
|
|
27353
|
+
* Adopt an existing CloudTrail trail into cdkd state.
|
|
27354
|
+
*
|
|
27355
|
+
* Lookup order:
|
|
27356
|
+
* 1. `--resource` override or `Properties.TrailName` → verify via `GetTrail`.
|
|
27357
|
+
* 2. `ListTrails` + `ListTags` (CloudTrail uses `Tag[]` arrays per ARN),
|
|
27358
|
+
* match `aws:cdk:path` tag.
|
|
27359
|
+
*/
|
|
27360
|
+
async import(input) {
|
|
27361
|
+
const explicit = resolveExplicitPhysicalId(input, "TrailName");
|
|
27362
|
+
if (explicit) {
|
|
27363
|
+
try {
|
|
27364
|
+
await this.getClient().send(new GetTrailCommand({ Name: explicit }));
|
|
27365
|
+
return { physicalId: explicit, attributes: {} };
|
|
27366
|
+
} catch (err) {
|
|
27367
|
+
if (err instanceof TrailNotFoundException)
|
|
27368
|
+
return null;
|
|
27369
|
+
throw err;
|
|
27370
|
+
}
|
|
27371
|
+
}
|
|
27372
|
+
if (!input.cdkPath)
|
|
27373
|
+
return null;
|
|
27374
|
+
let nextToken;
|
|
27375
|
+
do {
|
|
27376
|
+
const list = await this.getClient().send(
|
|
27377
|
+
new ListTrailsCommand({ ...nextToken && { NextToken: nextToken } })
|
|
27378
|
+
);
|
|
27379
|
+
for (const trail of list.Trails ?? []) {
|
|
27380
|
+
if (!trail.TrailARN || !trail.Name)
|
|
27381
|
+
continue;
|
|
27382
|
+
try {
|
|
27383
|
+
const tagsResp = await this.getClient().send(
|
|
27384
|
+
new ListTagsCommand2({ ResourceIdList: [trail.TrailARN] })
|
|
27385
|
+
);
|
|
27386
|
+
const list2 = tagsResp.ResourceTagList?.[0];
|
|
27387
|
+
if (matchesCdkPath(list2?.TagsList, input.cdkPath)) {
|
|
27388
|
+
return { physicalId: trail.Name, attributes: {} };
|
|
27389
|
+
}
|
|
27390
|
+
} catch (err) {
|
|
27391
|
+
if (err instanceof TrailNotFoundException)
|
|
27392
|
+
continue;
|
|
27393
|
+
throw err;
|
|
27394
|
+
}
|
|
27395
|
+
}
|
|
27396
|
+
nextToken = list.NextToken;
|
|
27397
|
+
} while (nextToken);
|
|
27398
|
+
return null;
|
|
27399
|
+
}
|
|
27192
27400
|
};
|
|
27193
27401
|
|
|
27194
27402
|
// src/provisioning/providers/codebuild-provider.ts
|
|
@@ -27197,6 +27405,8 @@ import {
|
|
|
27197
27405
|
CreateProjectCommand,
|
|
27198
27406
|
DeleteProjectCommand,
|
|
27199
27407
|
UpdateProjectCommand,
|
|
27408
|
+
BatchGetProjectsCommand,
|
|
27409
|
+
ListProjectsCommand,
|
|
27200
27410
|
ResourceNotFoundException as ResourceNotFoundException15
|
|
27201
27411
|
} from "@aws-sdk/client-codebuild";
|
|
27202
27412
|
var CodeBuildProvider = class {
|
|
@@ -27455,6 +27665,54 @@ var CodeBuildProvider = class {
|
|
|
27455
27665
|
getAttribute(_physicalId, _resourceType, attributeName) {
|
|
27456
27666
|
return Promise.resolve(attributeName);
|
|
27457
27667
|
}
|
|
27668
|
+
/**
|
|
27669
|
+
* Adopt an existing CodeBuild project into cdkd state.
|
|
27670
|
+
*
|
|
27671
|
+
* Lookup order:
|
|
27672
|
+
* 1. `--resource` override or `Properties.Name` → verify via `BatchGetProjects`.
|
|
27673
|
+
* 2. `ListProjects` + `BatchGetProjects` (CodeBuild uses lowercase
|
|
27674
|
+
* `key`/`value` tags, not the standard `Key`/`Value`), match
|
|
27675
|
+
* `aws:cdk:path` tag.
|
|
27676
|
+
*/
|
|
27677
|
+
async import(input) {
|
|
27678
|
+
const explicit = resolveExplicitPhysicalId(input, "Name");
|
|
27679
|
+
if (explicit) {
|
|
27680
|
+
try {
|
|
27681
|
+
const resp = await this.getClient().send(
|
|
27682
|
+
new BatchGetProjectsCommand({ names: [explicit] })
|
|
27683
|
+
);
|
|
27684
|
+
return resp.projects?.[0]?.name ? { physicalId: explicit, attributes: {} } : null;
|
|
27685
|
+
} catch (err) {
|
|
27686
|
+
if (err instanceof ResourceNotFoundException15)
|
|
27687
|
+
return null;
|
|
27688
|
+
throw err;
|
|
27689
|
+
}
|
|
27690
|
+
}
|
|
27691
|
+
if (!input.cdkPath)
|
|
27692
|
+
return null;
|
|
27693
|
+
let nextToken;
|
|
27694
|
+
do {
|
|
27695
|
+
const list = await this.getClient().send(
|
|
27696
|
+
new ListProjectsCommand({ ...nextToken && { nextToken } })
|
|
27697
|
+
);
|
|
27698
|
+
const names = (list.projects ?? []).filter((n) => typeof n === "string");
|
|
27699
|
+
if (names.length > 0) {
|
|
27700
|
+
const batch = await this.getClient().send(new BatchGetProjectsCommand({ names }));
|
|
27701
|
+
for (const proj of batch.projects ?? []) {
|
|
27702
|
+
if (!proj.name)
|
|
27703
|
+
continue;
|
|
27704
|
+
const tags = proj.tags ?? [];
|
|
27705
|
+
for (const t of tags) {
|
|
27706
|
+
if (t.key === CDK_PATH_TAG && t.value === input.cdkPath) {
|
|
27707
|
+
return { physicalId: proj.name, attributes: {} };
|
|
27708
|
+
}
|
|
27709
|
+
}
|
|
27710
|
+
}
|
|
27711
|
+
}
|
|
27712
|
+
nextToken = list.nextToken;
|
|
27713
|
+
} while (nextToken);
|
|
27714
|
+
return null;
|
|
27715
|
+
}
|
|
27458
27716
|
};
|
|
27459
27717
|
|
|
27460
27718
|
// src/provisioning/providers/s3-vectors-provider.ts
|
|
@@ -28246,6 +28504,7 @@ import {
|
|
|
28246
28504
|
PutImageScanningConfigurationCommand,
|
|
28247
28505
|
PutImageTagMutabilityCommand,
|
|
28248
28506
|
TagResourceCommand as TagResourceCommand7,
|
|
28507
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand10,
|
|
28249
28508
|
RepositoryNotFoundException
|
|
28250
28509
|
} from "@aws-sdk/client-ecr";
|
|
28251
28510
|
var ECRProvider = class {
|
|
@@ -28479,6 +28738,56 @@ var ECRProvider = class {
|
|
|
28479
28738
|
);
|
|
28480
28739
|
}
|
|
28481
28740
|
}
|
|
28741
|
+
/**
|
|
28742
|
+
* Adopt an existing ECR repository into cdkd state.
|
|
28743
|
+
*
|
|
28744
|
+
* Lookup order:
|
|
28745
|
+
* 1. `--resource` override or `Properties.RepositoryName` → verify via
|
|
28746
|
+
* `DescribeRepositories`.
|
|
28747
|
+
* 2. `DescribeRepositories` paginated, then `ListTagsForResource(arn)`
|
|
28748
|
+
* per repository to match `aws:cdk:path` (`Tag[]` array shape).
|
|
28749
|
+
*/
|
|
28750
|
+
async import(input) {
|
|
28751
|
+
const explicit = resolveExplicitPhysicalId(input, "RepositoryName");
|
|
28752
|
+
if (explicit) {
|
|
28753
|
+
try {
|
|
28754
|
+
const resp = await this.getClient().send(
|
|
28755
|
+
new DescribeRepositoriesCommand({ repositoryNames: [explicit] })
|
|
28756
|
+
);
|
|
28757
|
+
return resp.repositories?.[0]?.repositoryName ? { physicalId: explicit, attributes: {} } : null;
|
|
28758
|
+
} catch (err) {
|
|
28759
|
+
if (err instanceof RepositoryNotFoundException)
|
|
28760
|
+
return null;
|
|
28761
|
+
throw err;
|
|
28762
|
+
}
|
|
28763
|
+
}
|
|
28764
|
+
if (!input.cdkPath)
|
|
28765
|
+
return null;
|
|
28766
|
+
let nextToken;
|
|
28767
|
+
do {
|
|
28768
|
+
const list = await this.getClient().send(
|
|
28769
|
+
new DescribeRepositoriesCommand({ ...nextToken && { nextToken } })
|
|
28770
|
+
);
|
|
28771
|
+
for (const repo of list.repositories ?? []) {
|
|
28772
|
+
if (!repo.repositoryArn || !repo.repositoryName)
|
|
28773
|
+
continue;
|
|
28774
|
+
try {
|
|
28775
|
+
const tagsResp = await this.getClient().send(
|
|
28776
|
+
new ListTagsForResourceCommand10({ resourceArn: repo.repositoryArn })
|
|
28777
|
+
);
|
|
28778
|
+
if (matchesCdkPath(tagsResp.tags, input.cdkPath)) {
|
|
28779
|
+
return { physicalId: repo.repositoryName, attributes: {} };
|
|
28780
|
+
}
|
|
28781
|
+
} catch (err) {
|
|
28782
|
+
if (err instanceof RepositoryNotFoundException)
|
|
28783
|
+
continue;
|
|
28784
|
+
throw err;
|
|
28785
|
+
}
|
|
28786
|
+
}
|
|
28787
|
+
nextToken = list.nextToken;
|
|
28788
|
+
} while (nextToken);
|
|
28789
|
+
return null;
|
|
28790
|
+
}
|
|
28482
28791
|
};
|
|
28483
28792
|
|
|
28484
28793
|
// src/provisioning/register-providers.ts
|
|
@@ -32390,7 +32699,7 @@ function reorderArgs(argv) {
|
|
|
32390
32699
|
}
|
|
32391
32700
|
async function main() {
|
|
32392
32701
|
const program = new Command13();
|
|
32393
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
32702
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.19.0");
|
|
32394
32703
|
program.addCommand(createBootstrapCommand());
|
|
32395
32704
|
program.addCommand(createSynthCommand());
|
|
32396
32705
|
program.addCommand(createListCommand());
|