@go-to-k/cdkd 0.39.0 → 0.40.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 +1531 -11
- package/dist/cli.js.map +3 -3
- package/dist/go-to-k-cdkd-0.40.0.tgz +0 -0
- package/package.json +1 -1
- package/dist/go-to-k-cdkd-0.39.0.tgz +0 -0
package/dist/cli.js
CHANGED
|
@@ -13207,6 +13207,7 @@ var SNSTopicProvider = class {
|
|
|
13207
13207
|
import {
|
|
13208
13208
|
SubscribeCommand,
|
|
13209
13209
|
UnsubscribeCommand,
|
|
13210
|
+
GetSubscriptionAttributesCommand,
|
|
13210
13211
|
NotFoundException as NotFoundException2
|
|
13211
13212
|
} from "@aws-sdk/client-sns";
|
|
13212
13213
|
init_aws_clients();
|
|
@@ -13338,6 +13339,52 @@ var SNSSubscriptionProvider = class {
|
|
|
13338
13339
|
);
|
|
13339
13340
|
}
|
|
13340
13341
|
}
|
|
13342
|
+
/**
|
|
13343
|
+
* Read the AWS-current SNS Subscription configuration in CFn-property shape.
|
|
13344
|
+
*
|
|
13345
|
+
* Issues `GetSubscriptionAttributes`. AWS returns ALL attribute values
|
|
13346
|
+
* as strings; we type-coerce `RawMessageDelivery` to a boolean and
|
|
13347
|
+
* JSON-parse `FilterPolicy` so the comparator matches cdkd state's
|
|
13348
|
+
* already-typed values. `TopicArn`, `Protocol`, `Endpoint` pass through
|
|
13349
|
+
* as strings.
|
|
13350
|
+
*
|
|
13351
|
+
* Returns `undefined` when the subscription is gone (`NotFoundException`),
|
|
13352
|
+
* including the special "PendingConfirmation" case where the
|
|
13353
|
+
* `SubscriptionArn` has not yet been confirmed and `Attributes` is null.
|
|
13354
|
+
*/
|
|
13355
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
13356
|
+
let attributes;
|
|
13357
|
+
try {
|
|
13358
|
+
const resp = await this.snsClient.send(
|
|
13359
|
+
new GetSubscriptionAttributesCommand({ SubscriptionArn: physicalId })
|
|
13360
|
+
);
|
|
13361
|
+
attributes = resp.Attributes;
|
|
13362
|
+
} catch (err) {
|
|
13363
|
+
if (err instanceof NotFoundException2)
|
|
13364
|
+
return void 0;
|
|
13365
|
+
throw err;
|
|
13366
|
+
}
|
|
13367
|
+
if (!attributes)
|
|
13368
|
+
return void 0;
|
|
13369
|
+
const result = {};
|
|
13370
|
+
if (attributes["TopicArn"] !== void 0)
|
|
13371
|
+
result["TopicArn"] = attributes["TopicArn"];
|
|
13372
|
+
if (attributes["Protocol"] !== void 0)
|
|
13373
|
+
result["Protocol"] = attributes["Protocol"];
|
|
13374
|
+
if (attributes["Endpoint"] !== void 0)
|
|
13375
|
+
result["Endpoint"] = attributes["Endpoint"];
|
|
13376
|
+
if (attributes["RawMessageDelivery"] !== void 0) {
|
|
13377
|
+
result["RawMessageDelivery"] = attributes["RawMessageDelivery"] === "true";
|
|
13378
|
+
}
|
|
13379
|
+
if (attributes["FilterPolicy"]) {
|
|
13380
|
+
try {
|
|
13381
|
+
result["FilterPolicy"] = JSON.parse(attributes["FilterPolicy"]);
|
|
13382
|
+
} catch {
|
|
13383
|
+
result["FilterPolicy"] = attributes["FilterPolicy"];
|
|
13384
|
+
}
|
|
13385
|
+
}
|
|
13386
|
+
return result;
|
|
13387
|
+
}
|
|
13341
13388
|
/**
|
|
13342
13389
|
* Adopt an existing SNS subscription into cdkd state.
|
|
13343
13390
|
*
|
|
@@ -16209,6 +16256,82 @@ var CloudWatchAlarmProvider = class {
|
|
|
16209
16256
|
* 2. `DescribeAlarms` paginated, then `ListTagsForResource(AlarmArn)` per
|
|
16210
16257
|
* alarm to match `aws:cdk:path`.
|
|
16211
16258
|
*/
|
|
16259
|
+
/**
|
|
16260
|
+
* Read the AWS-current CloudWatch Alarm configuration in CFn-property shape.
|
|
16261
|
+
*
|
|
16262
|
+
* Issues `DescribeAlarms` filtered by `AlarmNames=[physicalId]` and
|
|
16263
|
+
* surfaces the keys cdkd's `create()` accepts (`AlarmName`,
|
|
16264
|
+
* `AlarmDescription`, `MetricName`, `Namespace`, `Statistic`,
|
|
16265
|
+
* `ComparisonOperator`, `Threshold`, `EvaluationPeriods`, `Period`,
|
|
16266
|
+
* `DatapointsToAlarm`, `ActionsEnabled`, `AlarmActions`,
|
|
16267
|
+
* `OKActions`, `InsufficientDataActions`, `TreatMissingData`, `Unit`,
|
|
16268
|
+
* `Dimensions`, `Metrics`).
|
|
16269
|
+
*
|
|
16270
|
+
* `DescribeAlarms` returns the result via either `MetricAlarms` (single-
|
|
16271
|
+
* metric form) or `CompositeAlarms` (composite form). cdkd's provider
|
|
16272
|
+
* only handles the single-metric form, so we look at `MetricAlarms` only.
|
|
16273
|
+
*
|
|
16274
|
+
* Returns `undefined` when the alarm is gone (no matching `MetricAlarms`).
|
|
16275
|
+
*/
|
|
16276
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
16277
|
+
const resp = await this.cloudWatchClient.send(
|
|
16278
|
+
new DescribeAlarmsCommand({ AlarmNames: [physicalId], AlarmTypes: ["MetricAlarm"] })
|
|
16279
|
+
);
|
|
16280
|
+
const alarm = resp.MetricAlarms?.[0];
|
|
16281
|
+
if (!alarm)
|
|
16282
|
+
return void 0;
|
|
16283
|
+
const result = {};
|
|
16284
|
+
if (alarm.AlarmName !== void 0)
|
|
16285
|
+
result["AlarmName"] = alarm.AlarmName;
|
|
16286
|
+
if (alarm.AlarmDescription !== void 0 && alarm.AlarmDescription !== "") {
|
|
16287
|
+
result["AlarmDescription"] = alarm.AlarmDescription;
|
|
16288
|
+
}
|
|
16289
|
+
if (alarm.MetricName !== void 0)
|
|
16290
|
+
result["MetricName"] = alarm.MetricName;
|
|
16291
|
+
if (alarm.Namespace !== void 0)
|
|
16292
|
+
result["Namespace"] = alarm.Namespace;
|
|
16293
|
+
if (alarm.Statistic !== void 0)
|
|
16294
|
+
result["Statistic"] = alarm.Statistic;
|
|
16295
|
+
if (alarm.ComparisonOperator !== void 0) {
|
|
16296
|
+
result["ComparisonOperator"] = alarm.ComparisonOperator;
|
|
16297
|
+
}
|
|
16298
|
+
if (alarm.Threshold !== void 0)
|
|
16299
|
+
result["Threshold"] = alarm.Threshold;
|
|
16300
|
+
if (alarm.EvaluationPeriods !== void 0) {
|
|
16301
|
+
result["EvaluationPeriods"] = alarm.EvaluationPeriods;
|
|
16302
|
+
}
|
|
16303
|
+
if (alarm.Period !== void 0)
|
|
16304
|
+
result["Period"] = alarm.Period;
|
|
16305
|
+
if (alarm.DatapointsToAlarm !== void 0) {
|
|
16306
|
+
result["DatapointsToAlarm"] = alarm.DatapointsToAlarm;
|
|
16307
|
+
}
|
|
16308
|
+
if (alarm.ActionsEnabled !== void 0)
|
|
16309
|
+
result["ActionsEnabled"] = alarm.ActionsEnabled;
|
|
16310
|
+
if (alarm.AlarmActions && alarm.AlarmActions.length > 0) {
|
|
16311
|
+
result["AlarmActions"] = [...alarm.AlarmActions];
|
|
16312
|
+
}
|
|
16313
|
+
if (alarm.OKActions && alarm.OKActions.length > 0) {
|
|
16314
|
+
result["OKActions"] = [...alarm.OKActions];
|
|
16315
|
+
}
|
|
16316
|
+
if (alarm.InsufficientDataActions && alarm.InsufficientDataActions.length > 0) {
|
|
16317
|
+
result["InsufficientDataActions"] = [...alarm.InsufficientDataActions];
|
|
16318
|
+
}
|
|
16319
|
+
if (alarm.TreatMissingData !== void 0) {
|
|
16320
|
+
result["TreatMissingData"] = alarm.TreatMissingData;
|
|
16321
|
+
}
|
|
16322
|
+
if (alarm.Unit !== void 0)
|
|
16323
|
+
result["Unit"] = alarm.Unit;
|
|
16324
|
+
if (alarm.Dimensions && alarm.Dimensions.length > 0) {
|
|
16325
|
+
result["Dimensions"] = alarm.Dimensions.map((d) => ({
|
|
16326
|
+
...d.Name !== void 0 ? { Name: d.Name } : {},
|
|
16327
|
+
...d.Value !== void 0 ? { Value: d.Value } : {}
|
|
16328
|
+
}));
|
|
16329
|
+
}
|
|
16330
|
+
if (alarm.Metrics && alarm.Metrics.length > 0) {
|
|
16331
|
+
result["Metrics"] = alarm.Metrics.map((m) => m);
|
|
16332
|
+
}
|
|
16333
|
+
return result;
|
|
16334
|
+
}
|
|
16212
16335
|
async import(input) {
|
|
16213
16336
|
const explicit = resolveExplicitPhysicalId(input, "AlarmName");
|
|
16214
16337
|
if (explicit) {
|
|
@@ -24089,7 +24212,8 @@ import {
|
|
|
24089
24212
|
DescribeTagsCommand,
|
|
24090
24213
|
CreateListenerCommand,
|
|
24091
24214
|
DeleteListenerCommand,
|
|
24092
|
-
ModifyListenerCommand
|
|
24215
|
+
ModifyListenerCommand,
|
|
24216
|
+
DescribeListenersCommand as DescribeListenersCommand2
|
|
24093
24217
|
} from "@aws-sdk/client-elastic-load-balancing-v2";
|
|
24094
24218
|
var ELBv2Provider = class {
|
|
24095
24219
|
elbv2Client;
|
|
@@ -24582,6 +24706,170 @@ var ELBv2Provider = class {
|
|
|
24582
24706
|
return void 0;
|
|
24583
24707
|
return certificates;
|
|
24584
24708
|
}
|
|
24709
|
+
/**
|
|
24710
|
+
* Read the AWS-current ELBv2 resource configuration in CFn-property shape.
|
|
24711
|
+
*
|
|
24712
|
+
* Dispatch per resource type:
|
|
24713
|
+
* - `LoadBalancer` → `DescribeLoadBalancers` (Name, Subnets via
|
|
24714
|
+
* `AvailabilityZones[].SubnetId`, SecurityGroups, Scheme, Type,
|
|
24715
|
+
* IpAddressType). LoadBalancerAttributes is omitted for v1 — it
|
|
24716
|
+
* requires a separate `DescribeLoadBalancerAttributes` call and the
|
|
24717
|
+
* drift comparator only descends into keys present in state, so an
|
|
24718
|
+
* absent key cannot fire false drift.
|
|
24719
|
+
* - `TargetGroup` → `DescribeTargetGroups` (Protocol, Port, VpcId,
|
|
24720
|
+
* TargetType, ProtocolVersion, HealthCheck*, Matcher, Name).
|
|
24721
|
+
* - `Listener` → `DescribeListeners` (LoadBalancerArn, Certificates,
|
|
24722
|
+
* DefaultActions, Port, Protocol, SslPolicy).
|
|
24723
|
+
*
|
|
24724
|
+
* Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
|
|
24725
|
+
* when the resource is gone (`*NotFoundException`).
|
|
24726
|
+
*/
|
|
24727
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
24728
|
+
switch (resourceType) {
|
|
24729
|
+
case "AWS::ElasticLoadBalancingV2::LoadBalancer":
|
|
24730
|
+
return this.readLoadBalancer(physicalId);
|
|
24731
|
+
case "AWS::ElasticLoadBalancingV2::TargetGroup":
|
|
24732
|
+
return this.readTargetGroup(physicalId);
|
|
24733
|
+
case "AWS::ElasticLoadBalancingV2::Listener":
|
|
24734
|
+
return this.readListener(physicalId);
|
|
24735
|
+
default:
|
|
24736
|
+
return void 0;
|
|
24737
|
+
}
|
|
24738
|
+
}
|
|
24739
|
+
async readLoadBalancer(physicalId) {
|
|
24740
|
+
let lb;
|
|
24741
|
+
try {
|
|
24742
|
+
const resp = await this.getClient().send(
|
|
24743
|
+
new DescribeLoadBalancersCommand2({ LoadBalancerArns: [physicalId] })
|
|
24744
|
+
);
|
|
24745
|
+
lb = resp.LoadBalancers?.[0];
|
|
24746
|
+
} catch (err) {
|
|
24747
|
+
if (this.isNotFoundError(err))
|
|
24748
|
+
return void 0;
|
|
24749
|
+
throw err;
|
|
24750
|
+
}
|
|
24751
|
+
if (!lb)
|
|
24752
|
+
return void 0;
|
|
24753
|
+
const result = {};
|
|
24754
|
+
if (lb.LoadBalancerName !== void 0)
|
|
24755
|
+
result["Name"] = lb.LoadBalancerName;
|
|
24756
|
+
if (lb.AvailabilityZones && lb.AvailabilityZones.length > 0) {
|
|
24757
|
+
const subnets = lb.AvailabilityZones.map((az) => az.SubnetId).filter(
|
|
24758
|
+
(id) => !!id
|
|
24759
|
+
);
|
|
24760
|
+
if (subnets.length > 0)
|
|
24761
|
+
result["Subnets"] = subnets;
|
|
24762
|
+
}
|
|
24763
|
+
if (lb.SecurityGroups && lb.SecurityGroups.length > 0) {
|
|
24764
|
+
result["SecurityGroups"] = [...lb.SecurityGroups];
|
|
24765
|
+
}
|
|
24766
|
+
if (lb.Scheme !== void 0)
|
|
24767
|
+
result["Scheme"] = lb.Scheme;
|
|
24768
|
+
if (lb.Type !== void 0)
|
|
24769
|
+
result["Type"] = lb.Type;
|
|
24770
|
+
if (lb.IpAddressType !== void 0)
|
|
24771
|
+
result["IpAddressType"] = lb.IpAddressType;
|
|
24772
|
+
return result;
|
|
24773
|
+
}
|
|
24774
|
+
async readTargetGroup(physicalId) {
|
|
24775
|
+
let tg;
|
|
24776
|
+
try {
|
|
24777
|
+
const resp = await this.getClient().send(
|
|
24778
|
+
new DescribeTargetGroupsCommand({ TargetGroupArns: [physicalId] })
|
|
24779
|
+
);
|
|
24780
|
+
tg = resp.TargetGroups?.[0];
|
|
24781
|
+
} catch (err) {
|
|
24782
|
+
if (this.isNotFoundError(err))
|
|
24783
|
+
return void 0;
|
|
24784
|
+
throw err;
|
|
24785
|
+
}
|
|
24786
|
+
if (!tg)
|
|
24787
|
+
return void 0;
|
|
24788
|
+
const result = {};
|
|
24789
|
+
if (tg.TargetGroupName !== void 0)
|
|
24790
|
+
result["Name"] = tg.TargetGroupName;
|
|
24791
|
+
if (tg.Protocol !== void 0)
|
|
24792
|
+
result["Protocol"] = tg.Protocol;
|
|
24793
|
+
if (tg.Port !== void 0)
|
|
24794
|
+
result["Port"] = tg.Port;
|
|
24795
|
+
if (tg.VpcId !== void 0)
|
|
24796
|
+
result["VpcId"] = tg.VpcId;
|
|
24797
|
+
if (tg.TargetType !== void 0)
|
|
24798
|
+
result["TargetType"] = tg.TargetType;
|
|
24799
|
+
if (tg.ProtocolVersion !== void 0)
|
|
24800
|
+
result["ProtocolVersion"] = tg.ProtocolVersion;
|
|
24801
|
+
if (tg.HealthCheckProtocol !== void 0)
|
|
24802
|
+
result["HealthCheckProtocol"] = tg.HealthCheckProtocol;
|
|
24803
|
+
if (tg.HealthCheckPort !== void 0)
|
|
24804
|
+
result["HealthCheckPort"] = tg.HealthCheckPort;
|
|
24805
|
+
if (tg.HealthCheckPath !== void 0)
|
|
24806
|
+
result["HealthCheckPath"] = tg.HealthCheckPath;
|
|
24807
|
+
if (tg.HealthCheckEnabled !== void 0)
|
|
24808
|
+
result["HealthCheckEnabled"] = tg.HealthCheckEnabled;
|
|
24809
|
+
if (tg.HealthCheckIntervalSeconds !== void 0) {
|
|
24810
|
+
result["HealthCheckIntervalSeconds"] = tg.HealthCheckIntervalSeconds;
|
|
24811
|
+
}
|
|
24812
|
+
if (tg.HealthCheckTimeoutSeconds !== void 0) {
|
|
24813
|
+
result["HealthCheckTimeoutSeconds"] = tg.HealthCheckTimeoutSeconds;
|
|
24814
|
+
}
|
|
24815
|
+
if (tg.HealthyThresholdCount !== void 0) {
|
|
24816
|
+
result["HealthyThresholdCount"] = tg.HealthyThresholdCount;
|
|
24817
|
+
}
|
|
24818
|
+
if (tg.UnhealthyThresholdCount !== void 0) {
|
|
24819
|
+
result["UnhealthyThresholdCount"] = tg.UnhealthyThresholdCount;
|
|
24820
|
+
}
|
|
24821
|
+
if (tg.Matcher) {
|
|
24822
|
+
const matcher = {};
|
|
24823
|
+
if (tg.Matcher.HttpCode !== void 0)
|
|
24824
|
+
matcher["HttpCode"] = tg.Matcher.HttpCode;
|
|
24825
|
+
if (tg.Matcher.GrpcCode !== void 0)
|
|
24826
|
+
matcher["GrpcCode"] = tg.Matcher.GrpcCode;
|
|
24827
|
+
if (Object.keys(matcher).length > 0)
|
|
24828
|
+
result["Matcher"] = matcher;
|
|
24829
|
+
}
|
|
24830
|
+
return result;
|
|
24831
|
+
}
|
|
24832
|
+
async readListener(physicalId) {
|
|
24833
|
+
let listener;
|
|
24834
|
+
try {
|
|
24835
|
+
const resp = await this.getClient().send(
|
|
24836
|
+
new DescribeListenersCommand2({ ListenerArns: [physicalId] })
|
|
24837
|
+
);
|
|
24838
|
+
listener = resp.Listeners?.[0];
|
|
24839
|
+
} catch (err) {
|
|
24840
|
+
if (this.isNotFoundError(err))
|
|
24841
|
+
return void 0;
|
|
24842
|
+
throw err;
|
|
24843
|
+
}
|
|
24844
|
+
if (!listener)
|
|
24845
|
+
return void 0;
|
|
24846
|
+
const result = {};
|
|
24847
|
+
if (listener.LoadBalancerArn !== void 0) {
|
|
24848
|
+
result["LoadBalancerArn"] = listener.LoadBalancerArn;
|
|
24849
|
+
}
|
|
24850
|
+
if (listener.Port !== void 0)
|
|
24851
|
+
result["Port"] = listener.Port;
|
|
24852
|
+
if (listener.Protocol !== void 0)
|
|
24853
|
+
result["Protocol"] = listener.Protocol;
|
|
24854
|
+
if (listener.SslPolicy !== void 0)
|
|
24855
|
+
result["SslPolicy"] = listener.SslPolicy;
|
|
24856
|
+
if (listener.Certificates && listener.Certificates.length > 0) {
|
|
24857
|
+
result["Certificates"] = listener.Certificates.map((c) => {
|
|
24858
|
+
const out = {};
|
|
24859
|
+
if (c.CertificateArn !== void 0)
|
|
24860
|
+
out["CertificateArn"] = c.CertificateArn;
|
|
24861
|
+
if (c.IsDefault !== void 0)
|
|
24862
|
+
out["IsDefault"] = c.IsDefault;
|
|
24863
|
+
return out;
|
|
24864
|
+
});
|
|
24865
|
+
}
|
|
24866
|
+
if (listener.DefaultActions && listener.DefaultActions.length > 0) {
|
|
24867
|
+
result["DefaultActions"] = listener.DefaultActions.map(
|
|
24868
|
+
(a) => a
|
|
24869
|
+
);
|
|
24870
|
+
}
|
|
24871
|
+
return result;
|
|
24872
|
+
}
|
|
24585
24873
|
/**
|
|
24586
24874
|
* Adopt an existing ELBv2 LoadBalancer or TargetGroup into cdkd state.
|
|
24587
24875
|
*
|
|
@@ -25589,6 +25877,7 @@ import {
|
|
|
25589
25877
|
ListQueryLoggingConfigsCommand,
|
|
25590
25878
|
ListHostedZonesByNameCommand as ListHostedZonesByNameCommand2,
|
|
25591
25879
|
ListHostedZonesCommand,
|
|
25880
|
+
ListResourceRecordSetsCommand,
|
|
25592
25881
|
ListTagsForResourceCommand as ListTagsForResourceCommand11
|
|
25593
25882
|
} from "@aws-sdk/client-route-53";
|
|
25594
25883
|
var Route53Provider = class {
|
|
@@ -26236,6 +26525,150 @@ var Route53Provider = class {
|
|
|
26236
26525
|
physicalId
|
|
26237
26526
|
);
|
|
26238
26527
|
}
|
|
26528
|
+
/**
|
|
26529
|
+
* Read the AWS-current Route 53 resource configuration in CFn-property shape.
|
|
26530
|
+
*
|
|
26531
|
+
* Dispatch per resource type:
|
|
26532
|
+
* - `HostedZone` → `GetHostedZone` (Name, HostedZoneConfig{Comment,
|
|
26533
|
+
* PrivateZone}, VPCs from `VPCs[]`). Tags are skipped (CDK auto-tag
|
|
26534
|
+
* handling deferred); QueryLoggingConfig is skipped because it's a
|
|
26535
|
+
* separate `ListQueryLoggingConfigs` call and the v1 surface does
|
|
26536
|
+
* not surface it.
|
|
26537
|
+
* - `RecordSet` → `ListResourceRecordSets` filtered to the exact
|
|
26538
|
+
* `(name, type)` pair from the composite physicalId
|
|
26539
|
+
* (`{zoneId}|{name}|{type}`). Surfaces TTL, ResourceRecords (with
|
|
26540
|
+
* `[{Value}]` -> string[] re-shape to match cdkd state), AliasTarget,
|
|
26541
|
+
* Weight, Region, Failover, MultiValueAnswer, HealthCheckId,
|
|
26542
|
+
* GeoLocation, SetIdentifier.
|
|
26543
|
+
*
|
|
26544
|
+
* Returns `undefined` when the parent zone is gone (`NoSuchHostedZone`).
|
|
26545
|
+
*/
|
|
26546
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
26547
|
+
switch (resourceType) {
|
|
26548
|
+
case "AWS::Route53::HostedZone":
|
|
26549
|
+
return this.readHostedZone(physicalId);
|
|
26550
|
+
case "AWS::Route53::RecordSet":
|
|
26551
|
+
return this.readRecordSet(physicalId);
|
|
26552
|
+
default:
|
|
26553
|
+
return void 0;
|
|
26554
|
+
}
|
|
26555
|
+
}
|
|
26556
|
+
async readHostedZone(physicalId) {
|
|
26557
|
+
let resp;
|
|
26558
|
+
try {
|
|
26559
|
+
resp = await this.getClient().send(new GetHostedZoneCommand2({ Id: physicalId }));
|
|
26560
|
+
} catch (err) {
|
|
26561
|
+
if (err instanceof Error && err.name === "NoSuchHostedZone")
|
|
26562
|
+
return void 0;
|
|
26563
|
+
throw err;
|
|
26564
|
+
}
|
|
26565
|
+
if (!resp.HostedZone)
|
|
26566
|
+
return void 0;
|
|
26567
|
+
const result = {};
|
|
26568
|
+
if (resp.HostedZone.Name !== void 0)
|
|
26569
|
+
result["Name"] = resp.HostedZone.Name;
|
|
26570
|
+
if (resp.HostedZone.Config) {
|
|
26571
|
+
const cfg = {};
|
|
26572
|
+
if (resp.HostedZone.Config.Comment !== void 0) {
|
|
26573
|
+
cfg["Comment"] = resp.HostedZone.Config.Comment;
|
|
26574
|
+
}
|
|
26575
|
+
if (resp.HostedZone.Config.PrivateZone !== void 0) {
|
|
26576
|
+
cfg["PrivateZone"] = resp.HostedZone.Config.PrivateZone;
|
|
26577
|
+
}
|
|
26578
|
+
if (Object.keys(cfg).length > 0)
|
|
26579
|
+
result["HostedZoneConfig"] = cfg;
|
|
26580
|
+
}
|
|
26581
|
+
if (resp.VPCs && resp.VPCs.length > 0) {
|
|
26582
|
+
result["VPCs"] = resp.VPCs.map((v) => {
|
|
26583
|
+
const out = {};
|
|
26584
|
+
if (v.VPCId !== void 0)
|
|
26585
|
+
out["VPCId"] = v.VPCId;
|
|
26586
|
+
if (v.VPCRegion !== void 0)
|
|
26587
|
+
out["VPCRegion"] = v.VPCRegion;
|
|
26588
|
+
return out;
|
|
26589
|
+
});
|
|
26590
|
+
}
|
|
26591
|
+
return result;
|
|
26592
|
+
}
|
|
26593
|
+
async readRecordSet(physicalId) {
|
|
26594
|
+
const parts = physicalId.split("|");
|
|
26595
|
+
if (parts.length < 3)
|
|
26596
|
+
return void 0;
|
|
26597
|
+
const [hostedZoneId, name, type] = parts;
|
|
26598
|
+
if (!hostedZoneId || !name || !type)
|
|
26599
|
+
return void 0;
|
|
26600
|
+
let resp;
|
|
26601
|
+
try {
|
|
26602
|
+
resp = await this.getClient().send(
|
|
26603
|
+
new ListResourceRecordSetsCommand({
|
|
26604
|
+
HostedZoneId: hostedZoneId,
|
|
26605
|
+
StartRecordName: name,
|
|
26606
|
+
StartRecordType: type,
|
|
26607
|
+
MaxItems: 1
|
|
26608
|
+
})
|
|
26609
|
+
);
|
|
26610
|
+
} catch (err) {
|
|
26611
|
+
if (err instanceof Error && err.name === "NoSuchHostedZone")
|
|
26612
|
+
return void 0;
|
|
26613
|
+
throw err;
|
|
26614
|
+
}
|
|
26615
|
+
const recordSet = resp.ResourceRecordSets?.find((r) => r.Name === name && r.Type === type);
|
|
26616
|
+
if (!recordSet)
|
|
26617
|
+
return void 0;
|
|
26618
|
+
const result = {
|
|
26619
|
+
HostedZoneId: hostedZoneId,
|
|
26620
|
+
Name: name,
|
|
26621
|
+
Type: type
|
|
26622
|
+
};
|
|
26623
|
+
if (recordSet.TTL !== void 0)
|
|
26624
|
+
result["TTL"] = recordSet.TTL;
|
|
26625
|
+
if (recordSet.ResourceRecords && recordSet.ResourceRecords.length > 0) {
|
|
26626
|
+
result["ResourceRecords"] = recordSet.ResourceRecords.map((r) => r.Value).filter(
|
|
26627
|
+
(v) => typeof v === "string"
|
|
26628
|
+
);
|
|
26629
|
+
}
|
|
26630
|
+
if (recordSet.AliasTarget) {
|
|
26631
|
+
const at = {};
|
|
26632
|
+
if (recordSet.AliasTarget.HostedZoneId !== void 0) {
|
|
26633
|
+
at["HostedZoneId"] = recordSet.AliasTarget.HostedZoneId;
|
|
26634
|
+
}
|
|
26635
|
+
if (recordSet.AliasTarget.DNSName !== void 0) {
|
|
26636
|
+
at["DNSName"] = recordSet.AliasTarget.DNSName;
|
|
26637
|
+
}
|
|
26638
|
+
if (recordSet.AliasTarget.EvaluateTargetHealth !== void 0) {
|
|
26639
|
+
at["EvaluateTargetHealth"] = recordSet.AliasTarget.EvaluateTargetHealth;
|
|
26640
|
+
}
|
|
26641
|
+
result["AliasTarget"] = at;
|
|
26642
|
+
}
|
|
26643
|
+
if (recordSet.SetIdentifier !== void 0)
|
|
26644
|
+
result["SetIdentifier"] = recordSet.SetIdentifier;
|
|
26645
|
+
if (recordSet.Weight !== void 0)
|
|
26646
|
+
result["Weight"] = recordSet.Weight;
|
|
26647
|
+
if (recordSet.Region !== void 0)
|
|
26648
|
+
result["Region"] = recordSet.Region;
|
|
26649
|
+
if (recordSet.Failover !== void 0)
|
|
26650
|
+
result["Failover"] = recordSet.Failover;
|
|
26651
|
+
if (recordSet.MultiValueAnswer !== void 0) {
|
|
26652
|
+
result["MultiValueAnswer"] = recordSet.MultiValueAnswer;
|
|
26653
|
+
}
|
|
26654
|
+
if (recordSet.HealthCheckId !== void 0)
|
|
26655
|
+
result["HealthCheckId"] = recordSet.HealthCheckId;
|
|
26656
|
+
if (recordSet.GeoLocation) {
|
|
26657
|
+
const geo = {};
|
|
26658
|
+
if (recordSet.GeoLocation.ContinentCode !== void 0) {
|
|
26659
|
+
geo["ContinentCode"] = recordSet.GeoLocation.ContinentCode;
|
|
26660
|
+
}
|
|
26661
|
+
if (recordSet.GeoLocation.CountryCode !== void 0) {
|
|
26662
|
+
geo["CountryCode"] = recordSet.GeoLocation.CountryCode;
|
|
26663
|
+
}
|
|
26664
|
+
if (recordSet.GeoLocation.SubdivisionCode !== void 0) {
|
|
26665
|
+
geo["SubdivisionCode"] = recordSet.GeoLocation.SubdivisionCode;
|
|
26666
|
+
}
|
|
26667
|
+
if (Object.keys(geo).length > 0)
|
|
26668
|
+
result["GeoLocation"] = geo;
|
|
26669
|
+
}
|
|
26670
|
+
return result;
|
|
26671
|
+
}
|
|
26239
26672
|
/**
|
|
26240
26673
|
* Adopt an existing Route 53 resource into cdkd state.
|
|
26241
26674
|
*
|
|
@@ -26524,6 +26957,75 @@ var WAFv2WebACLProvider = class {
|
|
|
26524
26957
|
);
|
|
26525
26958
|
}
|
|
26526
26959
|
}
|
|
26960
|
+
/**
|
|
26961
|
+
* Read the AWS-current WAFv2 WebACL configuration in CFn-property shape.
|
|
26962
|
+
*
|
|
26963
|
+
* The cdkd physicalId is the WebACL ARN; we parse it back to
|
|
26964
|
+
* `(id, name, scope)` and call `GetWebACL`. The response holds Name,
|
|
26965
|
+
* Description, DefaultAction, Rules, VisibilityConfig,
|
|
26966
|
+
* CustomResponseBodies, CaptchaConfig, ChallengeConfig, TokenDomains,
|
|
26967
|
+
* and AssociationConfig — every key cdkd state declares as
|
|
26968
|
+
* `handledProperties`. `Scope` is recovered from the ARN parse.
|
|
26969
|
+
*
|
|
26970
|
+
* Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
|
|
26971
|
+
* when the ARN can't be parsed or the WebACL is gone
|
|
26972
|
+
* (`WAFNonexistentItemException`).
|
|
26973
|
+
*/
|
|
26974
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
26975
|
+
let id;
|
|
26976
|
+
let name;
|
|
26977
|
+
let scope;
|
|
26978
|
+
try {
|
|
26979
|
+
({ id, name, scope } = parseWebACLArn(physicalId));
|
|
26980
|
+
} catch {
|
|
26981
|
+
return void 0;
|
|
26982
|
+
}
|
|
26983
|
+
let webACL;
|
|
26984
|
+
try {
|
|
26985
|
+
const resp = await this.getClient().send(
|
|
26986
|
+
new GetWebACLCommand({ Id: id, Name: name, Scope: scope })
|
|
26987
|
+
);
|
|
26988
|
+
webACL = resp.WebACL;
|
|
26989
|
+
} catch (err) {
|
|
26990
|
+
if (err instanceof WAFNonexistentItemException)
|
|
26991
|
+
return void 0;
|
|
26992
|
+
throw err;
|
|
26993
|
+
}
|
|
26994
|
+
if (!webACL)
|
|
26995
|
+
return void 0;
|
|
26996
|
+
const result = {};
|
|
26997
|
+
if (webACL.Name !== void 0)
|
|
26998
|
+
result["Name"] = webACL.Name;
|
|
26999
|
+
result["Scope"] = scope;
|
|
27000
|
+
if (webACL.Description !== void 0 && webACL.Description !== "") {
|
|
27001
|
+
result["Description"] = webACL.Description;
|
|
27002
|
+
}
|
|
27003
|
+
if (webACL.DefaultAction) {
|
|
27004
|
+
result["DefaultAction"] = webACL.DefaultAction;
|
|
27005
|
+
}
|
|
27006
|
+
if (webACL.Rules && webACL.Rules.length > 0) {
|
|
27007
|
+
result["Rules"] = webACL.Rules.map((r) => r);
|
|
27008
|
+
}
|
|
27009
|
+
if (webACL.VisibilityConfig) {
|
|
27010
|
+
result["VisibilityConfig"] = webACL.VisibilityConfig;
|
|
27011
|
+
}
|
|
27012
|
+
if (webACL.CustomResponseBodies && Object.keys(webACL.CustomResponseBodies).length > 0) {
|
|
27013
|
+
result["CustomResponseBodies"] = webACL.CustomResponseBodies;
|
|
27014
|
+
}
|
|
27015
|
+
if (webACL.CaptchaConfig) {
|
|
27016
|
+
result["CaptchaConfig"] = webACL.CaptchaConfig;
|
|
27017
|
+
}
|
|
27018
|
+
if (webACL.ChallengeConfig) {
|
|
27019
|
+
result["ChallengeConfig"] = webACL.ChallengeConfig;
|
|
27020
|
+
}
|
|
27021
|
+
if (webACL.TokenDomains && webACL.TokenDomains.length > 0) {
|
|
27022
|
+
result["TokenDomains"] = [...webACL.TokenDomains];
|
|
27023
|
+
}
|
|
27024
|
+
if (webACL.AssociationConfig) {
|
|
27025
|
+
result["AssociationConfig"] = webACL.AssociationConfig;
|
|
27026
|
+
}
|
|
27027
|
+
return result;
|
|
27028
|
+
}
|
|
26527
27029
|
/**
|
|
26528
27030
|
* Adopt an existing WAFv2 WebACL into cdkd state.
|
|
26529
27031
|
*
|
|
@@ -27496,6 +27998,133 @@ var ElastiCacheProvider = class {
|
|
|
27496
27998
|
sleep(ms) {
|
|
27497
27999
|
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
27498
28000
|
}
|
|
28001
|
+
/**
|
|
28002
|
+
* Read the AWS-current ElastiCache resource configuration in CFn-property shape.
|
|
28003
|
+
*
|
|
28004
|
+
* Dispatch per resource type:
|
|
28005
|
+
* - `CacheCluster` → `DescribeCacheClusters` filtered by `CacheClusterId`,
|
|
28006
|
+
* surfacing `Engine`, `CacheNodeType`, `NumCacheNodes`,
|
|
28007
|
+
* `CacheSubnetGroupName`, `Port`, `EngineVersion`,
|
|
28008
|
+
* `CacheParameterGroupName`, `PreferredMaintenanceWindow`,
|
|
28009
|
+
* `PreferredAvailabilityZone`, `SnapshotRetentionLimit`,
|
|
28010
|
+
* `SnapshotWindow`, `AutoMinorVersionUpgrade`, `NotificationTopicArn`,
|
|
28011
|
+
* `IpDiscovery`, `NetworkType`, `TransitEncryptionEnabled`, plus
|
|
28012
|
+
* `VpcSecurityGroupIds` derived from the cluster's `SecurityGroups[]`.
|
|
28013
|
+
* - `SubnetGroup` → `DescribeCacheSubnetGroups` filtered by name,
|
|
28014
|
+
* surfacing `CacheSubnetGroupName`, `CacheSubnetGroupDescription`,
|
|
28015
|
+
* and `SubnetIds` derived from `Subnets[].SubnetIdentifier`.
|
|
28016
|
+
*
|
|
28017
|
+
* Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
|
|
28018
|
+
* when the resource is gone (`*NotFoundFault`).
|
|
28019
|
+
*/
|
|
28020
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
28021
|
+
switch (resourceType) {
|
|
28022
|
+
case "AWS::ElastiCache::CacheCluster":
|
|
28023
|
+
return this.readCacheCluster(physicalId);
|
|
28024
|
+
case "AWS::ElastiCache::SubnetGroup":
|
|
28025
|
+
return this.readSubnetGroup(physicalId);
|
|
28026
|
+
default:
|
|
28027
|
+
return void 0;
|
|
28028
|
+
}
|
|
28029
|
+
}
|
|
28030
|
+
async readCacheCluster(physicalId) {
|
|
28031
|
+
let cluster;
|
|
28032
|
+
try {
|
|
28033
|
+
const resp = await this.getClient().send(
|
|
28034
|
+
new DescribeCacheClustersCommand({
|
|
28035
|
+
CacheClusterId: physicalId,
|
|
28036
|
+
ShowCacheNodeInfo: true
|
|
28037
|
+
})
|
|
28038
|
+
);
|
|
28039
|
+
cluster = resp.CacheClusters?.[0];
|
|
28040
|
+
} catch (err) {
|
|
28041
|
+
if (this.isNotFoundError(err, "CacheClusterNotFoundFault"))
|
|
28042
|
+
return void 0;
|
|
28043
|
+
throw err;
|
|
28044
|
+
}
|
|
28045
|
+
if (!cluster)
|
|
28046
|
+
return void 0;
|
|
28047
|
+
const result = {};
|
|
28048
|
+
if (cluster.CacheClusterId !== void 0)
|
|
28049
|
+
result["ClusterName"] = cluster.CacheClusterId;
|
|
28050
|
+
if (cluster.Engine !== void 0)
|
|
28051
|
+
result["Engine"] = cluster.Engine;
|
|
28052
|
+
if (cluster.CacheNodeType !== void 0)
|
|
28053
|
+
result["CacheNodeType"] = cluster.CacheNodeType;
|
|
28054
|
+
if (cluster.NumCacheNodes !== void 0)
|
|
28055
|
+
result["NumCacheNodes"] = cluster.NumCacheNodes;
|
|
28056
|
+
if (cluster.CacheSubnetGroupName !== void 0) {
|
|
28057
|
+
result["CacheSubnetGroupName"] = cluster.CacheSubnetGroupName;
|
|
28058
|
+
}
|
|
28059
|
+
if (cluster.EngineVersion !== void 0)
|
|
28060
|
+
result["EngineVersion"] = cluster.EngineVersion;
|
|
28061
|
+
if (cluster.CacheParameterGroup?.CacheParameterGroupName !== void 0) {
|
|
28062
|
+
result["CacheParameterGroupName"] = cluster.CacheParameterGroup.CacheParameterGroupName;
|
|
28063
|
+
}
|
|
28064
|
+
if (cluster.PreferredMaintenanceWindow !== void 0) {
|
|
28065
|
+
result["PreferredMaintenanceWindow"] = cluster.PreferredMaintenanceWindow;
|
|
28066
|
+
}
|
|
28067
|
+
if (cluster.PreferredAvailabilityZone !== void 0) {
|
|
28068
|
+
result["PreferredAvailabilityZone"] = cluster.PreferredAvailabilityZone;
|
|
28069
|
+
}
|
|
28070
|
+
if (cluster.SnapshotRetentionLimit !== void 0) {
|
|
28071
|
+
result["SnapshotRetentionLimit"] = cluster.SnapshotRetentionLimit;
|
|
28072
|
+
}
|
|
28073
|
+
if (cluster.SnapshotWindow !== void 0)
|
|
28074
|
+
result["SnapshotWindow"] = cluster.SnapshotWindow;
|
|
28075
|
+
if (cluster.AutoMinorVersionUpgrade !== void 0) {
|
|
28076
|
+
result["AutoMinorVersionUpgrade"] = cluster.AutoMinorVersionUpgrade;
|
|
28077
|
+
}
|
|
28078
|
+
if (cluster.NotificationConfiguration?.TopicArn !== void 0) {
|
|
28079
|
+
result["NotificationTopicArn"] = cluster.NotificationConfiguration.TopicArn;
|
|
28080
|
+
}
|
|
28081
|
+
if (cluster.IpDiscovery !== void 0)
|
|
28082
|
+
result["IpDiscovery"] = cluster.IpDiscovery;
|
|
28083
|
+
if (cluster.NetworkType !== void 0)
|
|
28084
|
+
result["NetworkType"] = cluster.NetworkType;
|
|
28085
|
+
if (cluster.TransitEncryptionEnabled !== void 0) {
|
|
28086
|
+
result["TransitEncryptionEnabled"] = cluster.TransitEncryptionEnabled;
|
|
28087
|
+
}
|
|
28088
|
+
if (cluster.CacheNodes?.[0]?.Endpoint?.Port !== void 0) {
|
|
28089
|
+
result["Port"] = cluster.CacheNodes[0].Endpoint.Port;
|
|
28090
|
+
}
|
|
28091
|
+
if (cluster.SecurityGroups && cluster.SecurityGroups.length > 0) {
|
|
28092
|
+
const ids = cluster.SecurityGroups.map((sg) => sg.SecurityGroupId).filter(
|
|
28093
|
+
(id) => !!id
|
|
28094
|
+
);
|
|
28095
|
+
if (ids.length > 0)
|
|
28096
|
+
result["VpcSecurityGroupIds"] = ids;
|
|
28097
|
+
}
|
|
28098
|
+
return result;
|
|
28099
|
+
}
|
|
28100
|
+
async readSubnetGroup(physicalId) {
|
|
28101
|
+
let group;
|
|
28102
|
+
try {
|
|
28103
|
+
const resp = await this.getClient().send(
|
|
28104
|
+
new DescribeCacheSubnetGroupsCommand({ CacheSubnetGroupName: physicalId })
|
|
28105
|
+
);
|
|
28106
|
+
group = resp.CacheSubnetGroups?.[0];
|
|
28107
|
+
} catch (err) {
|
|
28108
|
+
if (this.isNotFoundError(err, "CacheSubnetGroupNotFoundFault"))
|
|
28109
|
+
return void 0;
|
|
28110
|
+
throw err;
|
|
28111
|
+
}
|
|
28112
|
+
if (!group)
|
|
28113
|
+
return void 0;
|
|
28114
|
+
const result = {};
|
|
28115
|
+
if (group.CacheSubnetGroupName !== void 0) {
|
|
28116
|
+
result["CacheSubnetGroupName"] = group.CacheSubnetGroupName;
|
|
28117
|
+
}
|
|
28118
|
+
if (group.CacheSubnetGroupDescription !== void 0) {
|
|
28119
|
+
result["CacheSubnetGroupDescription"] = group.CacheSubnetGroupDescription;
|
|
28120
|
+
}
|
|
28121
|
+
if (group.Subnets && group.Subnets.length > 0) {
|
|
28122
|
+
const ids = group.Subnets.map((s) => s.SubnetIdentifier).filter((id) => !!id);
|
|
28123
|
+
if (ids.length > 0)
|
|
28124
|
+
result["SubnetIds"] = ids;
|
|
28125
|
+
}
|
|
28126
|
+
return result;
|
|
28127
|
+
}
|
|
27499
28128
|
/**
|
|
27500
28129
|
* Adopt an existing ElastiCache resource into cdkd state.
|
|
27501
28130
|
*
|
|
@@ -27968,20 +28597,101 @@ var ServiceDiscoveryProvider = class {
|
|
|
27968
28597
|
* - **AWS::ServiceDiscovery::Service**: same shape — `ListServices` +
|
|
27969
28598
|
* `ListTagsForResource`. Both use `Tag[]` arrays.
|
|
27970
28599
|
*/
|
|
27971
|
-
|
|
27972
|
-
|
|
28600
|
+
/**
|
|
28601
|
+
* Read the AWS-current ServiceDiscovery resource configuration in CFn-property shape.
|
|
28602
|
+
*
|
|
28603
|
+
* Dispatch per resource type:
|
|
28604
|
+
* - `PrivateDnsNamespace` → `GetNamespace` (Name, Description). `Vpc`
|
|
28605
|
+
* is NOT returned by `GetNamespace` — Cloud Map exposes the VPC only
|
|
28606
|
+
* at create time and via `ListNamespaces`-side `Properties.DnsProperties.HostedZoneId`,
|
|
28607
|
+
* not as a directly comparable VPC ID. We skip it; the comparator
|
|
28608
|
+
* only descends into keys present in cdkd state, so an absent key
|
|
28609
|
+
* cannot fire false drift, but a `Vpc` change will not be detected
|
|
28610
|
+
* via this provider's drift surface (use the CFn-side `aws cloudmap`
|
|
28611
|
+
* CLI for that edge case).
|
|
28612
|
+
* - `Service` → `GetService` (Name, NamespaceId, Description, Type,
|
|
28613
|
+
* DnsConfig, HealthCheckConfig, HealthCheckCustomConfig).
|
|
28614
|
+
*
|
|
28615
|
+
* Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
|
|
28616
|
+
* when the resource is gone (`NamespaceNotFound` / `ServiceNotFound`).
|
|
28617
|
+
*/
|
|
28618
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
28619
|
+
switch (resourceType) {
|
|
27973
28620
|
case "AWS::ServiceDiscovery::PrivateDnsNamespace":
|
|
27974
|
-
return this.
|
|
28621
|
+
return this.readNamespace(physicalId);
|
|
27975
28622
|
case "AWS::ServiceDiscovery::Service":
|
|
27976
|
-
return this.
|
|
28623
|
+
return this.readService(physicalId);
|
|
27977
28624
|
default:
|
|
27978
|
-
return
|
|
28625
|
+
return void 0;
|
|
27979
28626
|
}
|
|
27980
28627
|
}
|
|
27981
|
-
async
|
|
27982
|
-
|
|
27983
|
-
|
|
27984
|
-
|
|
28628
|
+
async readNamespace(physicalId) {
|
|
28629
|
+
let ns;
|
|
28630
|
+
try {
|
|
28631
|
+
const resp = await this.getClient().send(new GetNamespaceCommand({ Id: physicalId }));
|
|
28632
|
+
ns = resp.Namespace;
|
|
28633
|
+
} catch (err) {
|
|
28634
|
+
if (err instanceof NamespaceNotFound)
|
|
28635
|
+
return void 0;
|
|
28636
|
+
throw err;
|
|
28637
|
+
}
|
|
28638
|
+
if (!ns)
|
|
28639
|
+
return void 0;
|
|
28640
|
+
const result = {};
|
|
28641
|
+
if (ns.Name !== void 0)
|
|
28642
|
+
result["Name"] = ns.Name;
|
|
28643
|
+
if (ns.Description !== void 0 && ns.Description !== "") {
|
|
28644
|
+
result["Description"] = ns.Description;
|
|
28645
|
+
}
|
|
28646
|
+
return result;
|
|
28647
|
+
}
|
|
28648
|
+
async readService(physicalId) {
|
|
28649
|
+
let svc;
|
|
28650
|
+
try {
|
|
28651
|
+
const resp = await this.getClient().send(new GetServiceCommand({ Id: physicalId }));
|
|
28652
|
+
svc = resp.Service;
|
|
28653
|
+
} catch (err) {
|
|
28654
|
+
if (err instanceof ServiceNotFound)
|
|
28655
|
+
return void 0;
|
|
28656
|
+
throw err;
|
|
28657
|
+
}
|
|
28658
|
+
if (!svc)
|
|
28659
|
+
return void 0;
|
|
28660
|
+
const result = {};
|
|
28661
|
+
if (svc.Name !== void 0)
|
|
28662
|
+
result["Name"] = svc.Name;
|
|
28663
|
+
if (svc.NamespaceId !== void 0)
|
|
28664
|
+
result["NamespaceId"] = svc.NamespaceId;
|
|
28665
|
+
if (svc.Description !== void 0 && svc.Description !== "") {
|
|
28666
|
+
result["Description"] = svc.Description;
|
|
28667
|
+
}
|
|
28668
|
+
if (svc.Type !== void 0)
|
|
28669
|
+
result["Type"] = svc.Type;
|
|
28670
|
+
if (svc.DnsConfig) {
|
|
28671
|
+
result["DnsConfig"] = svc.DnsConfig;
|
|
28672
|
+
}
|
|
28673
|
+
if (svc.HealthCheckConfig) {
|
|
28674
|
+
result["HealthCheckConfig"] = svc.HealthCheckConfig;
|
|
28675
|
+
}
|
|
28676
|
+
if (svc.HealthCheckCustomConfig) {
|
|
28677
|
+
result["HealthCheckCustomConfig"] = svc.HealthCheckCustomConfig;
|
|
28678
|
+
}
|
|
28679
|
+
return result;
|
|
28680
|
+
}
|
|
28681
|
+
async import(input) {
|
|
28682
|
+
switch (input.resourceType) {
|
|
28683
|
+
case "AWS::ServiceDiscovery::PrivateDnsNamespace":
|
|
28684
|
+
return this.importNamespaceResource(input);
|
|
28685
|
+
case "AWS::ServiceDiscovery::Service":
|
|
28686
|
+
return this.importServiceResource(input);
|
|
28687
|
+
default:
|
|
28688
|
+
return null;
|
|
28689
|
+
}
|
|
28690
|
+
}
|
|
28691
|
+
async importNamespaceResource(input) {
|
|
28692
|
+
if (input.knownPhysicalId) {
|
|
28693
|
+
try {
|
|
28694
|
+
await this.getClient().send(new GetNamespaceCommand({ Id: input.knownPhysicalId }));
|
|
27985
28695
|
return { physicalId: input.knownPhysicalId, attributes: {} };
|
|
27986
28696
|
} catch (err) {
|
|
27987
28697
|
if (err instanceof NamespaceNotFound)
|
|
@@ -28084,6 +28794,9 @@ import {
|
|
|
28084
28794
|
DeleteApiKeyCommand,
|
|
28085
28795
|
StartSchemaCreationCommand,
|
|
28086
28796
|
GetGraphqlApiCommand,
|
|
28797
|
+
GetDataSourceCommand,
|
|
28798
|
+
GetResolverCommand,
|
|
28799
|
+
ListApiKeysCommand,
|
|
28087
28800
|
ListGraphqlApisCommand,
|
|
28088
28801
|
NotFoundException as AppSyncNotFoundException
|
|
28089
28802
|
} from "@aws-sdk/client-appsync";
|
|
@@ -28593,6 +29306,209 @@ var AppSyncProvider = class {
|
|
|
28593
29306
|
const name = error.name ?? "";
|
|
28594
29307
|
return message.includes("not found") || message.includes("does not exist") || name === "NotFoundException";
|
|
28595
29308
|
}
|
|
29309
|
+
/**
|
|
29310
|
+
* Read the AWS-current AppSync resource configuration in CFn-property shape.
|
|
29311
|
+
*
|
|
29312
|
+
* Dispatches per resource type:
|
|
29313
|
+
* - `GraphQLApi` → `GetGraphqlApi` (Name, AuthenticationType, XrayEnabled,
|
|
29314
|
+
* LogConfig). Tags are skipped (CDK auto-tag handling deferred).
|
|
29315
|
+
* - `DataSource` → `GetDataSource` (Name, Type, Description,
|
|
29316
|
+
* ServiceRoleArn, DynamoDBConfig, LambdaConfig, HttpConfig). The
|
|
29317
|
+
* `ApiId` cdkd holds is recovered from the `apiId|name` physicalId.
|
|
29318
|
+
* - `Resolver` → `GetResolver` (TypeName, FieldName, DataSourceName,
|
|
29319
|
+
* request/response templates, Kind, PipelineConfig, Runtime, Code).
|
|
29320
|
+
* - `ApiKey` → `ListApiKeys` filtered by id (no `GetApiKey` SDK call;
|
|
29321
|
+
* AppSync only exposes list-based access). Surfaces Description and
|
|
29322
|
+
* Expires.
|
|
29323
|
+
* - `GraphQLSchema` → `GetSchemaCreationStatus` is the closest live
|
|
29324
|
+
* state, but it returns a status string only (not the full schema
|
|
29325
|
+
* body). Schema bodies live in cdkd state's `Definition` and would
|
|
29326
|
+
* need `GetIntrospectionSchema` + reverse-mapping to compare; that's
|
|
29327
|
+
* a separate task. Returns `undefined` so the comparator marks it
|
|
29328
|
+
* as "drift unknown" rather than firing a false positive.
|
|
29329
|
+
*
|
|
29330
|
+
* Returns `undefined` when the parent resource is gone (`NotFoundException`).
|
|
29331
|
+
*/
|
|
29332
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
29333
|
+
switch (resourceType) {
|
|
29334
|
+
case "AWS::AppSync::GraphQLApi":
|
|
29335
|
+
return this.readGraphQLApi(physicalId);
|
|
29336
|
+
case "AWS::AppSync::DataSource":
|
|
29337
|
+
return this.readDataSource(physicalId);
|
|
29338
|
+
case "AWS::AppSync::Resolver":
|
|
29339
|
+
return this.readResolver(physicalId);
|
|
29340
|
+
case "AWS::AppSync::ApiKey":
|
|
29341
|
+
return this.readApiKey(physicalId);
|
|
29342
|
+
case "AWS::AppSync::GraphQLSchema":
|
|
29343
|
+
return void 0;
|
|
29344
|
+
default:
|
|
29345
|
+
return void 0;
|
|
29346
|
+
}
|
|
29347
|
+
}
|
|
29348
|
+
async readGraphQLApi(physicalId) {
|
|
29349
|
+
let api;
|
|
29350
|
+
try {
|
|
29351
|
+
const resp = await this.getClient().send(new GetGraphqlApiCommand({ apiId: physicalId }));
|
|
29352
|
+
api = resp.graphqlApi;
|
|
29353
|
+
} catch (err) {
|
|
29354
|
+
if (err instanceof AppSyncNotFoundException)
|
|
29355
|
+
return void 0;
|
|
29356
|
+
throw err;
|
|
29357
|
+
}
|
|
29358
|
+
if (!api)
|
|
29359
|
+
return void 0;
|
|
29360
|
+
const result = {};
|
|
29361
|
+
if (api.name !== void 0)
|
|
29362
|
+
result["Name"] = api.name;
|
|
29363
|
+
if (api.authenticationType !== void 0) {
|
|
29364
|
+
result["AuthenticationType"] = api.authenticationType;
|
|
29365
|
+
}
|
|
29366
|
+
if (api.xrayEnabled !== void 0)
|
|
29367
|
+
result["XrayEnabled"] = api.xrayEnabled;
|
|
29368
|
+
if (api.logConfig) {
|
|
29369
|
+
const log = {};
|
|
29370
|
+
if (api.logConfig.cloudWatchLogsRoleArn !== void 0) {
|
|
29371
|
+
log["CloudWatchLogsRoleArn"] = api.logConfig.cloudWatchLogsRoleArn;
|
|
29372
|
+
}
|
|
29373
|
+
if (api.logConfig.fieldLogLevel !== void 0) {
|
|
29374
|
+
log["FieldLogLevel"] = api.logConfig.fieldLogLevel;
|
|
29375
|
+
}
|
|
29376
|
+
if (api.logConfig.excludeVerboseContent !== void 0) {
|
|
29377
|
+
log["ExcludeVerboseContent"] = api.logConfig.excludeVerboseContent;
|
|
29378
|
+
}
|
|
29379
|
+
if (Object.keys(log).length > 0)
|
|
29380
|
+
result["LogConfig"] = log;
|
|
29381
|
+
}
|
|
29382
|
+
return result;
|
|
29383
|
+
}
|
|
29384
|
+
async readDataSource(physicalId) {
|
|
29385
|
+
const [apiId, name] = physicalId.split("|");
|
|
29386
|
+
if (!apiId || !name)
|
|
29387
|
+
return void 0;
|
|
29388
|
+
let ds;
|
|
29389
|
+
try {
|
|
29390
|
+
const resp = await this.getClient().send(new GetDataSourceCommand({ apiId, name }));
|
|
29391
|
+
ds = resp.dataSource;
|
|
29392
|
+
} catch (err) {
|
|
29393
|
+
if (err instanceof AppSyncNotFoundException)
|
|
29394
|
+
return void 0;
|
|
29395
|
+
throw err;
|
|
29396
|
+
}
|
|
29397
|
+
if (!ds)
|
|
29398
|
+
return void 0;
|
|
29399
|
+
const result = { ApiId: apiId };
|
|
29400
|
+
if (ds.name !== void 0)
|
|
29401
|
+
result["Name"] = ds.name;
|
|
29402
|
+
if (ds.type !== void 0)
|
|
29403
|
+
result["Type"] = ds.type;
|
|
29404
|
+
if (ds.description !== void 0 && ds.description !== "") {
|
|
29405
|
+
result["Description"] = ds.description;
|
|
29406
|
+
}
|
|
29407
|
+
if (ds.serviceRoleArn !== void 0)
|
|
29408
|
+
result["ServiceRoleArn"] = ds.serviceRoleArn;
|
|
29409
|
+
if (ds.dynamodbConfig) {
|
|
29410
|
+
const dynamo = {};
|
|
29411
|
+
if (ds.dynamodbConfig.tableName !== void 0)
|
|
29412
|
+
dynamo["TableName"] = ds.dynamodbConfig.tableName;
|
|
29413
|
+
if (ds.dynamodbConfig.awsRegion !== void 0)
|
|
29414
|
+
dynamo["AwsRegion"] = ds.dynamodbConfig.awsRegion;
|
|
29415
|
+
if (ds.dynamodbConfig.useCallerCredentials !== void 0) {
|
|
29416
|
+
dynamo["UseCallerCredentials"] = ds.dynamodbConfig.useCallerCredentials;
|
|
29417
|
+
}
|
|
29418
|
+
if (Object.keys(dynamo).length > 0)
|
|
29419
|
+
result["DynamoDBConfig"] = dynamo;
|
|
29420
|
+
}
|
|
29421
|
+
if (ds.lambdaConfig?.lambdaFunctionArn !== void 0) {
|
|
29422
|
+
result["LambdaConfig"] = { LambdaFunctionArn: ds.lambdaConfig.lambdaFunctionArn };
|
|
29423
|
+
}
|
|
29424
|
+
if (ds.httpConfig?.endpoint !== void 0) {
|
|
29425
|
+
result["HttpConfig"] = { Endpoint: ds.httpConfig.endpoint };
|
|
29426
|
+
}
|
|
29427
|
+
return result;
|
|
29428
|
+
}
|
|
29429
|
+
async readResolver(physicalId) {
|
|
29430
|
+
const parts = physicalId.split("|");
|
|
29431
|
+
if (parts.length < 3)
|
|
29432
|
+
return void 0;
|
|
29433
|
+
const [apiId, typeName, fieldName] = parts;
|
|
29434
|
+
if (!apiId || !typeName || !fieldName)
|
|
29435
|
+
return void 0;
|
|
29436
|
+
let resolver;
|
|
29437
|
+
try {
|
|
29438
|
+
const resp = await this.getClient().send(
|
|
29439
|
+
new GetResolverCommand({ apiId, typeName, fieldName })
|
|
29440
|
+
);
|
|
29441
|
+
resolver = resp.resolver;
|
|
29442
|
+
} catch (err) {
|
|
29443
|
+
if (err instanceof AppSyncNotFoundException)
|
|
29444
|
+
return void 0;
|
|
29445
|
+
throw err;
|
|
29446
|
+
}
|
|
29447
|
+
if (!resolver)
|
|
29448
|
+
return void 0;
|
|
29449
|
+
const result = { ApiId: apiId };
|
|
29450
|
+
if (resolver.typeName !== void 0)
|
|
29451
|
+
result["TypeName"] = resolver.typeName;
|
|
29452
|
+
if (resolver.fieldName !== void 0)
|
|
29453
|
+
result["FieldName"] = resolver.fieldName;
|
|
29454
|
+
if (resolver.dataSourceName !== void 0)
|
|
29455
|
+
result["DataSourceName"] = resolver.dataSourceName;
|
|
29456
|
+
if (resolver.requestMappingTemplate !== void 0) {
|
|
29457
|
+
result["RequestMappingTemplate"] = resolver.requestMappingTemplate;
|
|
29458
|
+
}
|
|
29459
|
+
if (resolver.responseMappingTemplate !== void 0) {
|
|
29460
|
+
result["ResponseMappingTemplate"] = resolver.responseMappingTemplate;
|
|
29461
|
+
}
|
|
29462
|
+
if (resolver.kind !== void 0)
|
|
29463
|
+
result["Kind"] = resolver.kind;
|
|
29464
|
+
if (resolver.pipelineConfig?.functions && resolver.pipelineConfig.functions.length > 0) {
|
|
29465
|
+
result["PipelineConfig"] = { Functions: [...resolver.pipelineConfig.functions] };
|
|
29466
|
+
}
|
|
29467
|
+
if (resolver.runtime) {
|
|
29468
|
+
const runtime = {};
|
|
29469
|
+
if (resolver.runtime.name !== void 0)
|
|
29470
|
+
runtime["Name"] = resolver.runtime.name;
|
|
29471
|
+
if (resolver.runtime.runtimeVersion !== void 0) {
|
|
29472
|
+
runtime["RuntimeVersion"] = resolver.runtime.runtimeVersion;
|
|
29473
|
+
}
|
|
29474
|
+
if (Object.keys(runtime).length > 0)
|
|
29475
|
+
result["Runtime"] = runtime;
|
|
29476
|
+
}
|
|
29477
|
+
if (resolver.code !== void 0)
|
|
29478
|
+
result["Code"] = resolver.code;
|
|
29479
|
+
return result;
|
|
29480
|
+
}
|
|
29481
|
+
async readApiKey(physicalId) {
|
|
29482
|
+
const [apiId, apiKeyId] = physicalId.split("|");
|
|
29483
|
+
if (!apiId || !apiKeyId)
|
|
29484
|
+
return void 0;
|
|
29485
|
+
let nextToken;
|
|
29486
|
+
do {
|
|
29487
|
+
let resp;
|
|
29488
|
+
try {
|
|
29489
|
+
resp = await this.getClient().send(
|
|
29490
|
+
new ListApiKeysCommand({ apiId, ...nextToken && { nextToken } })
|
|
29491
|
+
);
|
|
29492
|
+
} catch (err) {
|
|
29493
|
+
if (err instanceof AppSyncNotFoundException)
|
|
29494
|
+
return void 0;
|
|
29495
|
+
throw err;
|
|
29496
|
+
}
|
|
29497
|
+
for (const key of resp.apiKeys ?? []) {
|
|
29498
|
+
if (key.id === apiKeyId) {
|
|
29499
|
+
const result = { ApiId: apiId };
|
|
29500
|
+
if (key.description !== void 0 && key.description !== "") {
|
|
29501
|
+
result["Description"] = key.description;
|
|
29502
|
+
}
|
|
29503
|
+
if (key.expires !== void 0)
|
|
29504
|
+
result["Expires"] = key.expires;
|
|
29505
|
+
return result;
|
|
29506
|
+
}
|
|
29507
|
+
}
|
|
29508
|
+
nextToken = resp.nextToken;
|
|
29509
|
+
} while (nextToken);
|
|
29510
|
+
return void 0;
|
|
29511
|
+
}
|
|
28596
29512
|
/**
|
|
28597
29513
|
* Adopt an existing AppSync resource into cdkd state.
|
|
28598
29514
|
*
|
|
@@ -29044,6 +29960,116 @@ var GlueProvider = class {
|
|
|
29044
29960
|
* Glue list APIs return only names — ARNs are constructed locally
|
|
29045
29961
|
* for the per-item GetTags call.
|
|
29046
29962
|
*/
|
|
29963
|
+
/**
|
|
29964
|
+
* Read the AWS-current Glue resource configuration in CFn-property shape.
|
|
29965
|
+
*
|
|
29966
|
+
* Dispatch per resource type:
|
|
29967
|
+
* - `Database` → `GetDatabase` returning DatabaseInput-shape
|
|
29968
|
+
* (`Name`, `Description`, `LocationUri`, `Parameters`).
|
|
29969
|
+
* - `Table` → `GetTable` returning the same-named TableInput-shape
|
|
29970
|
+
* fields (`Name`, `Description`, `Owner`, `Retention`, `TableType`,
|
|
29971
|
+
* `PartitionKeys`, `Parameters`, `StorageDescriptor`, `ViewOriginalText`,
|
|
29972
|
+
* `ViewExpandedText`, `TargetTable`). The table physicalId is
|
|
29973
|
+
* `databaseName|tableName`; we recover both from the split.
|
|
29974
|
+
*
|
|
29975
|
+
* `CatalogId` is intentionally not surfaced — `GetDatabase` /
|
|
29976
|
+
* `GetTable` do not echo it back, and cdkd state's `CatalogId` is
|
|
29977
|
+
* usually the AWS account id (defaulted by the API). Comparator only
|
|
29978
|
+
* descends into keys present in state, so an absent surface key cannot
|
|
29979
|
+
* fire false drift here.
|
|
29980
|
+
*
|
|
29981
|
+
* Returns `undefined` when the resource is gone (`EntityNotFoundException`).
|
|
29982
|
+
* Other Glue resource types (`Job`, `Crawler`, `Connection`, `Trigger`,
|
|
29983
|
+
* `Workflow`, `SecurityConfiguration`, etc.) are out of scope for v1 —
|
|
29984
|
+
* the provider's `create()` only handles Database/Table; CC API picks
|
|
29985
|
+
* up drift detection for the rest.
|
|
29986
|
+
*/
|
|
29987
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
29988
|
+
switch (resourceType) {
|
|
29989
|
+
case "AWS::Glue::Database":
|
|
29990
|
+
return this.readDatabase(physicalId);
|
|
29991
|
+
case "AWS::Glue::Table":
|
|
29992
|
+
return this.readTable(physicalId);
|
|
29993
|
+
default:
|
|
29994
|
+
return void 0;
|
|
29995
|
+
}
|
|
29996
|
+
}
|
|
29997
|
+
async readDatabase(physicalId) {
|
|
29998
|
+
let db;
|
|
29999
|
+
try {
|
|
30000
|
+
const resp = await this.getClient().send(new GetDatabaseCommand({ Name: physicalId }));
|
|
30001
|
+
db = resp.Database;
|
|
30002
|
+
} catch (err) {
|
|
30003
|
+
if (err instanceof EntityNotFoundException)
|
|
30004
|
+
return void 0;
|
|
30005
|
+
throw err;
|
|
30006
|
+
}
|
|
30007
|
+
if (!db)
|
|
30008
|
+
return void 0;
|
|
30009
|
+
const dbInput = {};
|
|
30010
|
+
if (db.Name !== void 0)
|
|
30011
|
+
dbInput["Name"] = db.Name;
|
|
30012
|
+
if (db.Description !== void 0 && db.Description !== "") {
|
|
30013
|
+
dbInput["Description"] = db.Description;
|
|
30014
|
+
}
|
|
30015
|
+
if (db.LocationUri !== void 0)
|
|
30016
|
+
dbInput["LocationUri"] = db.LocationUri;
|
|
30017
|
+
if (db.Parameters && Object.keys(db.Parameters).length > 0) {
|
|
30018
|
+
dbInput["Parameters"] = db.Parameters;
|
|
30019
|
+
}
|
|
30020
|
+
return { DatabaseInput: dbInput };
|
|
30021
|
+
}
|
|
30022
|
+
async readTable(physicalId) {
|
|
30023
|
+
const [databaseName, tableName] = physicalId.split("|");
|
|
30024
|
+
if (!databaseName || !tableName)
|
|
30025
|
+
return void 0;
|
|
30026
|
+
let table;
|
|
30027
|
+
try {
|
|
30028
|
+
const resp = await this.getClient().send(
|
|
30029
|
+
new GetTableCommand({ DatabaseName: databaseName, Name: tableName })
|
|
30030
|
+
);
|
|
30031
|
+
table = resp.Table;
|
|
30032
|
+
} catch (err) {
|
|
30033
|
+
if (err instanceof EntityNotFoundException)
|
|
30034
|
+
return void 0;
|
|
30035
|
+
throw err;
|
|
30036
|
+
}
|
|
30037
|
+
if (!table)
|
|
30038
|
+
return void 0;
|
|
30039
|
+
const tableInput = {};
|
|
30040
|
+
if (table.Name !== void 0)
|
|
30041
|
+
tableInput["Name"] = table.Name;
|
|
30042
|
+
if (table.Description !== void 0 && table.Description !== "") {
|
|
30043
|
+
tableInput["Description"] = table.Description;
|
|
30044
|
+
}
|
|
30045
|
+
if (table.Owner !== void 0)
|
|
30046
|
+
tableInput["Owner"] = table.Owner;
|
|
30047
|
+
if (table.Retention !== void 0)
|
|
30048
|
+
tableInput["Retention"] = table.Retention;
|
|
30049
|
+
if (table.TableType !== void 0)
|
|
30050
|
+
tableInput["TableType"] = table.TableType;
|
|
30051
|
+
if (table.PartitionKeys && table.PartitionKeys.length > 0) {
|
|
30052
|
+
tableInput["PartitionKeys"] = table.PartitionKeys.map(
|
|
30053
|
+
(k) => k
|
|
30054
|
+
);
|
|
30055
|
+
}
|
|
30056
|
+
if (table.Parameters && Object.keys(table.Parameters).length > 0) {
|
|
30057
|
+
tableInput["Parameters"] = table.Parameters;
|
|
30058
|
+
}
|
|
30059
|
+
if (table.StorageDescriptor) {
|
|
30060
|
+
tableInput["StorageDescriptor"] = table.StorageDescriptor;
|
|
30061
|
+
}
|
|
30062
|
+
if (table.ViewOriginalText !== void 0) {
|
|
30063
|
+
tableInput["ViewOriginalText"] = table.ViewOriginalText;
|
|
30064
|
+
}
|
|
30065
|
+
if (table.ViewExpandedText !== void 0) {
|
|
30066
|
+
tableInput["ViewExpandedText"] = table.ViewExpandedText;
|
|
30067
|
+
}
|
|
30068
|
+
if (table.TargetTable) {
|
|
30069
|
+
tableInput["TargetTable"] = table.TargetTable;
|
|
30070
|
+
}
|
|
30071
|
+
return { DatabaseName: databaseName, TableInput: tableInput };
|
|
30072
|
+
}
|
|
29047
30073
|
async import(input) {
|
|
29048
30074
|
switch (input.resourceType) {
|
|
29049
30075
|
case "AWS::Glue::Database":
|
|
@@ -30020,6 +31046,57 @@ var KinesisStreamProvider = class {
|
|
|
30020
31046
|
* Kinesis tags use the standard `Tag[]` array shape (`Key`/`Value`),
|
|
30021
31047
|
* so `matchesCdkPath` from import-helpers applies directly.
|
|
30022
31048
|
*/
|
|
31049
|
+
/**
|
|
31050
|
+
* Read the AWS-current Kinesis stream configuration in CFn-property shape.
|
|
31051
|
+
*
|
|
31052
|
+
* Issues `DescribeStream` and surfaces the keys cdkd's `create()`
|
|
31053
|
+
* accepts: `Name`, `StreamModeDetails`, `ShardCount`, `RetentionPeriodHours`,
|
|
31054
|
+
* and `StreamEncryption`. Tags are skipped (CDK auto-tag handling deferred).
|
|
31055
|
+
*
|
|
31056
|
+
* `ShardCount` is reported as the count of `Shards[]` in the stream
|
|
31057
|
+
* description (only present for PROVISIONED-mode streams; ON_DEMAND
|
|
31058
|
+
* mode reports an empty list).
|
|
31059
|
+
*
|
|
31060
|
+
* Returns `undefined` when the stream is gone (`ResourceNotFoundException`).
|
|
31061
|
+
* Only `AWS::Kinesis::Stream` is supported (the provider does not handle
|
|
31062
|
+
* `AWS::Kinesis::StreamConsumer`).
|
|
31063
|
+
*/
|
|
31064
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
31065
|
+
if (resourceType !== "AWS::Kinesis::Stream")
|
|
31066
|
+
return void 0;
|
|
31067
|
+
let stream;
|
|
31068
|
+
try {
|
|
31069
|
+
const resp = await this.getClient().send(
|
|
31070
|
+
new DescribeStreamCommand({ StreamName: physicalId })
|
|
31071
|
+
);
|
|
31072
|
+
stream = resp.StreamDescription;
|
|
31073
|
+
} catch (err) {
|
|
31074
|
+
if (err instanceof ResourceNotFoundException13)
|
|
31075
|
+
return void 0;
|
|
31076
|
+
throw err;
|
|
31077
|
+
}
|
|
31078
|
+
if (!stream)
|
|
31079
|
+
return void 0;
|
|
31080
|
+
const result = {};
|
|
31081
|
+
if (stream.StreamName !== void 0)
|
|
31082
|
+
result["Name"] = stream.StreamName;
|
|
31083
|
+
if (stream.StreamModeDetails?.StreamMode !== void 0) {
|
|
31084
|
+
result["StreamModeDetails"] = { StreamMode: stream.StreamModeDetails.StreamMode };
|
|
31085
|
+
}
|
|
31086
|
+
if (stream.Shards && stream.Shards.length > 0) {
|
|
31087
|
+
result["ShardCount"] = stream.Shards.length;
|
|
31088
|
+
}
|
|
31089
|
+
if (stream.RetentionPeriodHours !== void 0) {
|
|
31090
|
+
result["RetentionPeriodHours"] = stream.RetentionPeriodHours;
|
|
31091
|
+
}
|
|
31092
|
+
if (stream.EncryptionType !== void 0 && stream.EncryptionType !== "NONE") {
|
|
31093
|
+
const encryption = { EncryptionType: stream.EncryptionType };
|
|
31094
|
+
if (stream.KeyId !== void 0)
|
|
31095
|
+
encryption["KeyId"] = stream.KeyId;
|
|
31096
|
+
result["StreamEncryption"] = encryption;
|
|
31097
|
+
}
|
|
31098
|
+
return result;
|
|
31099
|
+
}
|
|
30023
31100
|
async import(input) {
|
|
30024
31101
|
const explicit = resolveExplicitPhysicalId(input, "Name");
|
|
30025
31102
|
if (explicit) {
|
|
@@ -30099,6 +31176,8 @@ import {
|
|
|
30099
31176
|
DeleteAccessPointCommand,
|
|
30100
31177
|
DescribeFileSystemsCommand,
|
|
30101
31178
|
DescribeAccessPointsCommand,
|
|
31179
|
+
DescribeLifecycleConfigurationCommand,
|
|
31180
|
+
DescribeBackupPolicyCommand,
|
|
30102
31181
|
FileSystemNotFound,
|
|
30103
31182
|
MountTargetNotFound,
|
|
30104
31183
|
AccessPointNotFound
|
|
@@ -30500,6 +31579,173 @@ var EFSProvider = class {
|
|
|
30500
31579
|
);
|
|
30501
31580
|
}
|
|
30502
31581
|
}
|
|
31582
|
+
/**
|
|
31583
|
+
* Read the AWS-current EFS resource configuration in CFn-property shape.
|
|
31584
|
+
*
|
|
31585
|
+
* Dispatch per resource type:
|
|
31586
|
+
* - `FileSystem` → `DescribeFileSystems` filtered by id (PerformanceMode,
|
|
31587
|
+
* ThroughputMode, Encrypted, KmsKeyId, ProvisionedThroughputInMibps),
|
|
31588
|
+
* plus optional `DescribeLifecycleConfiguration` and
|
|
31589
|
+
* `DescribeBackupPolicy` enrichment. Each enrichment call is wrapped
|
|
31590
|
+
* in its own try/catch so a "not configured" error on either omits
|
|
31591
|
+
* the corresponding key without failing the whole snapshot.
|
|
31592
|
+
* - `AccessPoint` → `DescribeAccessPoints` filtered by id (PosixUser,
|
|
31593
|
+
* RootDirectory).
|
|
31594
|
+
* - `MountTarget` → `DescribeMountTargets` (FileSystemId, SubnetId).
|
|
31595
|
+
* SecurityGroups requires a separate call and is omitted for v1.
|
|
31596
|
+
*
|
|
31597
|
+
* Tags are skipped across all three (CDK auto-tag handling deferred).
|
|
31598
|
+
* Returns `undefined` when the resource is gone (`*NotFound`).
|
|
31599
|
+
*/
|
|
31600
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
31601
|
+
switch (resourceType) {
|
|
31602
|
+
case "AWS::EFS::FileSystem":
|
|
31603
|
+
return this.readFileSystem(physicalId);
|
|
31604
|
+
case "AWS::EFS::AccessPoint":
|
|
31605
|
+
return this.readAccessPoint(physicalId);
|
|
31606
|
+
case "AWS::EFS::MountTarget":
|
|
31607
|
+
return this.readMountTarget(physicalId);
|
|
31608
|
+
default:
|
|
31609
|
+
return void 0;
|
|
31610
|
+
}
|
|
31611
|
+
}
|
|
31612
|
+
async readFileSystem(physicalId) {
|
|
31613
|
+
let fs;
|
|
31614
|
+
try {
|
|
31615
|
+
const resp = await this.getClient().send(
|
|
31616
|
+
new DescribeFileSystemsCommand({ FileSystemId: physicalId })
|
|
31617
|
+
);
|
|
31618
|
+
fs = resp.FileSystems?.[0];
|
|
31619
|
+
} catch (err) {
|
|
31620
|
+
if (err instanceof FileSystemNotFound)
|
|
31621
|
+
return void 0;
|
|
31622
|
+
throw err;
|
|
31623
|
+
}
|
|
31624
|
+
if (!fs)
|
|
31625
|
+
return void 0;
|
|
31626
|
+
const result = {};
|
|
31627
|
+
if (fs.PerformanceMode !== void 0)
|
|
31628
|
+
result["PerformanceMode"] = fs.PerformanceMode;
|
|
31629
|
+
if (fs.ThroughputMode !== void 0)
|
|
31630
|
+
result["ThroughputMode"] = fs.ThroughputMode;
|
|
31631
|
+
if (fs.Encrypted !== void 0)
|
|
31632
|
+
result["Encrypted"] = fs.Encrypted;
|
|
31633
|
+
if (fs.KmsKeyId !== void 0)
|
|
31634
|
+
result["KmsKeyId"] = fs.KmsKeyId;
|
|
31635
|
+
if (fs.ProvisionedThroughputInMibps !== void 0) {
|
|
31636
|
+
result["ProvisionedThroughputInMibps"] = fs.ProvisionedThroughputInMibps;
|
|
31637
|
+
}
|
|
31638
|
+
try {
|
|
31639
|
+
const resp = await this.getClient().send(
|
|
31640
|
+
new DescribeLifecycleConfigurationCommand({ FileSystemId: physicalId })
|
|
31641
|
+
);
|
|
31642
|
+
const policies = resp.LifecyclePolicies;
|
|
31643
|
+
if (policies && policies.length > 0) {
|
|
31644
|
+
result["LifecyclePolicies"] = policies.map((p) => {
|
|
31645
|
+
const out = {};
|
|
31646
|
+
if (p.TransitionToIA !== void 0)
|
|
31647
|
+
out["TransitionToIA"] = p.TransitionToIA;
|
|
31648
|
+
if (p.TransitionToPrimaryStorageClass !== void 0) {
|
|
31649
|
+
out["TransitionToPrimaryStorageClass"] = p.TransitionToPrimaryStorageClass;
|
|
31650
|
+
}
|
|
31651
|
+
if (p.TransitionToArchive !== void 0)
|
|
31652
|
+
out["TransitionToArchive"] = p.TransitionToArchive;
|
|
31653
|
+
return out;
|
|
31654
|
+
});
|
|
31655
|
+
}
|
|
31656
|
+
} catch (err) {
|
|
31657
|
+
if (err instanceof FileSystemNotFound)
|
|
31658
|
+
return void 0;
|
|
31659
|
+
const e = err;
|
|
31660
|
+
if (e.name !== "PolicyNotFound") {
|
|
31661
|
+
}
|
|
31662
|
+
}
|
|
31663
|
+
try {
|
|
31664
|
+
const resp = await this.getClient().send(
|
|
31665
|
+
new DescribeBackupPolicyCommand({ FileSystemId: physicalId })
|
|
31666
|
+
);
|
|
31667
|
+
if (resp.BackupPolicy?.Status !== void 0) {
|
|
31668
|
+
result["BackupPolicy"] = { Status: resp.BackupPolicy.Status };
|
|
31669
|
+
}
|
|
31670
|
+
} catch (err) {
|
|
31671
|
+
if (err instanceof FileSystemNotFound)
|
|
31672
|
+
return void 0;
|
|
31673
|
+
}
|
|
31674
|
+
return result;
|
|
31675
|
+
}
|
|
31676
|
+
async readAccessPoint(physicalId) {
|
|
31677
|
+
let ap;
|
|
31678
|
+
try {
|
|
31679
|
+
const resp = await this.getClient().send(
|
|
31680
|
+
new DescribeAccessPointsCommand({ AccessPointId: physicalId })
|
|
31681
|
+
);
|
|
31682
|
+
ap = resp.AccessPoints?.[0];
|
|
31683
|
+
} catch (err) {
|
|
31684
|
+
if (err instanceof AccessPointNotFound)
|
|
31685
|
+
return void 0;
|
|
31686
|
+
throw err;
|
|
31687
|
+
}
|
|
31688
|
+
if (!ap)
|
|
31689
|
+
return void 0;
|
|
31690
|
+
const result = {};
|
|
31691
|
+
if (ap.FileSystemId !== void 0)
|
|
31692
|
+
result["FileSystemId"] = ap.FileSystemId;
|
|
31693
|
+
if (ap.PosixUser) {
|
|
31694
|
+
const posix = {};
|
|
31695
|
+
if (ap.PosixUser.Uid !== void 0)
|
|
31696
|
+
posix["Uid"] = ap.PosixUser.Uid;
|
|
31697
|
+
if (ap.PosixUser.Gid !== void 0)
|
|
31698
|
+
posix["Gid"] = ap.PosixUser.Gid;
|
|
31699
|
+
if (ap.PosixUser.SecondaryGids && ap.PosixUser.SecondaryGids.length > 0) {
|
|
31700
|
+
posix["SecondaryGids"] = [...ap.PosixUser.SecondaryGids];
|
|
31701
|
+
}
|
|
31702
|
+
if (Object.keys(posix).length > 0)
|
|
31703
|
+
result["PosixUser"] = posix;
|
|
31704
|
+
}
|
|
31705
|
+
if (ap.RootDirectory) {
|
|
31706
|
+
const root = {};
|
|
31707
|
+
if (ap.RootDirectory.Path !== void 0)
|
|
31708
|
+
root["Path"] = ap.RootDirectory.Path;
|
|
31709
|
+
if (ap.RootDirectory.CreationInfo) {
|
|
31710
|
+
const ci = {};
|
|
31711
|
+
if (ap.RootDirectory.CreationInfo.OwnerUid !== void 0) {
|
|
31712
|
+
ci["OwnerUid"] = ap.RootDirectory.CreationInfo.OwnerUid;
|
|
31713
|
+
}
|
|
31714
|
+
if (ap.RootDirectory.CreationInfo.OwnerGid !== void 0) {
|
|
31715
|
+
ci["OwnerGid"] = ap.RootDirectory.CreationInfo.OwnerGid;
|
|
31716
|
+
}
|
|
31717
|
+
if (ap.RootDirectory.CreationInfo.Permissions !== void 0) {
|
|
31718
|
+
ci["Permissions"] = ap.RootDirectory.CreationInfo.Permissions;
|
|
31719
|
+
}
|
|
31720
|
+
if (Object.keys(ci).length > 0)
|
|
31721
|
+
root["CreationInfo"] = ci;
|
|
31722
|
+
}
|
|
31723
|
+
if (Object.keys(root).length > 0)
|
|
31724
|
+
result["RootDirectory"] = root;
|
|
31725
|
+
}
|
|
31726
|
+
return result;
|
|
31727
|
+
}
|
|
31728
|
+
async readMountTarget(physicalId) {
|
|
31729
|
+
let mt;
|
|
31730
|
+
try {
|
|
31731
|
+
const resp = await this.getClient().send(
|
|
31732
|
+
new DescribeMountTargetsCommand({ MountTargetId: physicalId })
|
|
31733
|
+
);
|
|
31734
|
+
mt = resp.MountTargets?.[0];
|
|
31735
|
+
} catch (err) {
|
|
31736
|
+
if (err instanceof MountTargetNotFound)
|
|
31737
|
+
return void 0;
|
|
31738
|
+
throw err;
|
|
31739
|
+
}
|
|
31740
|
+
if (!mt)
|
|
31741
|
+
return void 0;
|
|
31742
|
+
const result = {};
|
|
31743
|
+
if (mt.FileSystemId !== void 0)
|
|
31744
|
+
result["FileSystemId"] = mt.FileSystemId;
|
|
31745
|
+
if (mt.SubnetId !== void 0)
|
|
31746
|
+
result["SubnetId"] = mt.SubnetId;
|
|
31747
|
+
return result;
|
|
31748
|
+
}
|
|
30503
31749
|
/**
|
|
30504
31750
|
* Adopt an existing EFS resource into cdkd state.
|
|
30505
31751
|
*
|
|
@@ -30952,6 +32198,63 @@ var FirehoseProvider = class {
|
|
|
30952
32198
|
*
|
|
30953
32199
|
* Firehose tags use the standard `Tag[]` array shape (`Key`/`Value`).
|
|
30954
32200
|
*/
|
|
32201
|
+
/**
|
|
32202
|
+
* Read the AWS-current Firehose delivery stream configuration in CFn-property shape.
|
|
32203
|
+
*
|
|
32204
|
+
* Surfaces top-level configuration that has a clean 1:1 mapping back to
|
|
32205
|
+
* cdkd state — `DeliveryStreamName`, `DeliveryStreamType`, and the
|
|
32206
|
+
* `KinesisStreamSourceConfiguration` parent fields when present (the
|
|
32207
|
+
* `DescribeDeliveryStream` response splits source under `Source.KinesisStreamSourceDescription`).
|
|
32208
|
+
*
|
|
32209
|
+
* Destination configurations (`*DestinationConfiguration` in CFn vs.
|
|
32210
|
+
* `*DestinationDescription` in `DescribeDeliveryStream`) are intentionally
|
|
32211
|
+
* not re-shaped here. Their nested fields are large and the description
|
|
32212
|
+
* vs. configuration shape divergence (extra metadata, write-only fields
|
|
32213
|
+
* like `Password` redacted) makes a clean comparator surface impossible
|
|
32214
|
+
* for v1. We do surface the destination *kind* under a stable key so
|
|
32215
|
+
* users at least see destination drift across types, but not the inner
|
|
32216
|
+
* fields. Drift on destination contents is best chased manually via
|
|
32217
|
+
* `aws firehose describe-delivery-stream` for now.
|
|
32218
|
+
*
|
|
32219
|
+
* Tags + DeliveryStreamEncryptionConfigurationInput are skipped (they
|
|
32220
|
+
* each need separate calls / shape decisions).
|
|
32221
|
+
*
|
|
32222
|
+
* Returns `undefined` when the stream is gone (`ResourceNotFoundException`).
|
|
32223
|
+
*/
|
|
32224
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
32225
|
+
let desc;
|
|
32226
|
+
try {
|
|
32227
|
+
const resp = await this.getClient().send(
|
|
32228
|
+
new DescribeDeliveryStreamCommand({ DeliveryStreamName: physicalId })
|
|
32229
|
+
);
|
|
32230
|
+
desc = resp.DeliveryStreamDescription;
|
|
32231
|
+
} catch (err) {
|
|
32232
|
+
if (err instanceof ResourceNotFoundException14)
|
|
32233
|
+
return void 0;
|
|
32234
|
+
throw err;
|
|
32235
|
+
}
|
|
32236
|
+
if (!desc)
|
|
32237
|
+
return void 0;
|
|
32238
|
+
const result = {};
|
|
32239
|
+
if (desc.DeliveryStreamName !== void 0) {
|
|
32240
|
+
result["DeliveryStreamName"] = desc.DeliveryStreamName;
|
|
32241
|
+
}
|
|
32242
|
+
if (desc.DeliveryStreamType !== void 0) {
|
|
32243
|
+
result["DeliveryStreamType"] = desc.DeliveryStreamType;
|
|
32244
|
+
}
|
|
32245
|
+
if (desc.Source?.KinesisStreamSourceDescription) {
|
|
32246
|
+
const src = desc.Source.KinesisStreamSourceDescription;
|
|
32247
|
+
const srcOut = {};
|
|
32248
|
+
if (src.KinesisStreamARN !== void 0)
|
|
32249
|
+
srcOut["KinesisStreamARN"] = src.KinesisStreamARN;
|
|
32250
|
+
if (src.RoleARN !== void 0)
|
|
32251
|
+
srcOut["RoleARN"] = src.RoleARN;
|
|
32252
|
+
if (Object.keys(srcOut).length > 0) {
|
|
32253
|
+
result["KinesisStreamSourceConfiguration"] = srcOut;
|
|
32254
|
+
}
|
|
32255
|
+
}
|
|
32256
|
+
return result;
|
|
32257
|
+
}
|
|
30955
32258
|
async import(input) {
|
|
30956
32259
|
const explicit = resolveExplicitPhysicalId(input, "DeliveryStreamName");
|
|
30957
32260
|
if (explicit) {
|
|
@@ -31027,6 +32330,8 @@ import {
|
|
|
31027
32330
|
PutEventSelectorsCommand,
|
|
31028
32331
|
PutInsightSelectorsCommand,
|
|
31029
32332
|
GetTrailCommand,
|
|
32333
|
+
GetTrailStatusCommand,
|
|
32334
|
+
GetEventSelectorsCommand,
|
|
31030
32335
|
ListTrailsCommand,
|
|
31031
32336
|
ListTagsCommand as ListTagsCommand3,
|
|
31032
32337
|
TrailNotFoundException
|
|
@@ -31268,6 +32573,86 @@ var CloudTrailProvider = class {
|
|
|
31268
32573
|
* 2. `ListTrails` + `ListTags` (CloudTrail uses `Tag[]` arrays per ARN),
|
|
31269
32574
|
* match `aws:cdk:path` tag.
|
|
31270
32575
|
*/
|
|
32576
|
+
/**
|
|
32577
|
+
* Read the AWS-current CloudTrail Trail configuration in CFn-property shape.
|
|
32578
|
+
*
|
|
32579
|
+
* Issues `GetTrail`, plus best-effort `GetTrailStatus` (for `IsLogging`)
|
|
32580
|
+
* and `GetEventSelectors` (for `EventSelectors`). Each enrichment call is
|
|
32581
|
+
* wrapped in its own try/catch so an "AccessDenied" or other transient
|
|
32582
|
+
* error on the secondary calls omits that key without failing the
|
|
32583
|
+
* whole snapshot — the comparator only descends into keys present in
|
|
32584
|
+
* state.
|
|
32585
|
+
*
|
|
32586
|
+
* Mapping: AWS `GetTrail` returns `KmsKeyId` (lowercase `s`) while CFn
|
|
32587
|
+
* uses `KMSKeyId`; we re-shape the key. SnsTopicARN is the Trail's
|
|
32588
|
+
* derived field; the cdkd state property is `SnsTopicName` so we
|
|
32589
|
+
* surface `SnsTopicName` directly from `GetTrail.SnsTopicName`.
|
|
32590
|
+
*
|
|
32591
|
+
* Tags + InsightSelectors are skipped for v1 (each needs its own
|
|
32592
|
+
* separate call + shape mapping).
|
|
32593
|
+
*
|
|
32594
|
+
* Returns `undefined` when the trail is gone (`TrailNotFoundException`).
|
|
32595
|
+
*/
|
|
32596
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
32597
|
+
let trail;
|
|
32598
|
+
try {
|
|
32599
|
+
const resp = await this.getClient().send(new GetTrailCommand({ Name: physicalId }));
|
|
32600
|
+
trail = resp.Trail;
|
|
32601
|
+
} catch (err) {
|
|
32602
|
+
if (err instanceof TrailNotFoundException)
|
|
32603
|
+
return void 0;
|
|
32604
|
+
throw err;
|
|
32605
|
+
}
|
|
32606
|
+
if (!trail)
|
|
32607
|
+
return void 0;
|
|
32608
|
+
const result = {};
|
|
32609
|
+
if (trail.Name !== void 0)
|
|
32610
|
+
result["TrailName"] = trail.Name;
|
|
32611
|
+
if (trail.S3BucketName !== void 0)
|
|
32612
|
+
result["S3BucketName"] = trail.S3BucketName;
|
|
32613
|
+
if (trail.S3KeyPrefix !== void 0)
|
|
32614
|
+
result["S3KeyPrefix"] = trail.S3KeyPrefix;
|
|
32615
|
+
if (trail.IsMultiRegionTrail !== void 0) {
|
|
32616
|
+
result["IsMultiRegionTrail"] = trail.IsMultiRegionTrail;
|
|
32617
|
+
}
|
|
32618
|
+
if (trail.IncludeGlobalServiceEvents !== void 0) {
|
|
32619
|
+
result["IncludeGlobalServiceEvents"] = trail.IncludeGlobalServiceEvents;
|
|
32620
|
+
}
|
|
32621
|
+
if (trail.LogFileValidationEnabled !== void 0) {
|
|
32622
|
+
result["EnableLogFileValidation"] = trail.LogFileValidationEnabled;
|
|
32623
|
+
}
|
|
32624
|
+
if (trail.CloudWatchLogsLogGroupArn !== void 0) {
|
|
32625
|
+
result["CloudWatchLogsLogGroupArn"] = trail.CloudWatchLogsLogGroupArn;
|
|
32626
|
+
}
|
|
32627
|
+
if (trail.CloudWatchLogsRoleArn !== void 0) {
|
|
32628
|
+
result["CloudWatchLogsRoleArn"] = trail.CloudWatchLogsRoleArn;
|
|
32629
|
+
}
|
|
32630
|
+
if (trail.KmsKeyId !== void 0)
|
|
32631
|
+
result["KMSKeyId"] = trail.KmsKeyId;
|
|
32632
|
+
if (trail.SnsTopicName !== void 0)
|
|
32633
|
+
result["SnsTopicName"] = trail.SnsTopicName;
|
|
32634
|
+
if (trail.IsOrganizationTrail !== void 0) {
|
|
32635
|
+
result["IsOrganizationTrail"] = trail.IsOrganizationTrail;
|
|
32636
|
+
}
|
|
32637
|
+
try {
|
|
32638
|
+
const status = await this.getClient().send(new GetTrailStatusCommand({ Name: physicalId }));
|
|
32639
|
+
if (status.IsLogging !== void 0)
|
|
32640
|
+
result["IsLogging"] = status.IsLogging;
|
|
32641
|
+
} catch {
|
|
32642
|
+
}
|
|
32643
|
+
try {
|
|
32644
|
+
const sel = await this.getClient().send(
|
|
32645
|
+
new GetEventSelectorsCommand({ TrailName: physicalId })
|
|
32646
|
+
);
|
|
32647
|
+
if (sel.EventSelectors && sel.EventSelectors.length > 0) {
|
|
32648
|
+
result["EventSelectors"] = sel.EventSelectors.map(
|
|
32649
|
+
(es) => es
|
|
32650
|
+
);
|
|
32651
|
+
}
|
|
32652
|
+
} catch {
|
|
32653
|
+
}
|
|
32654
|
+
return result;
|
|
32655
|
+
}
|
|
31271
32656
|
async import(input) {
|
|
31272
32657
|
const explicit = resolveExplicitPhysicalId(input, "TrailName");
|
|
31273
32658
|
if (explicit) {
|
|
@@ -31585,6 +32970,141 @@ var CodeBuildProvider = class {
|
|
|
31585
32970
|
* `key`/`value` tags, not the standard `Key`/`Value`), match
|
|
31586
32971
|
* `aws:cdk:path` tag.
|
|
31587
32972
|
*/
|
|
32973
|
+
/**
|
|
32974
|
+
* Read the AWS-current CodeBuild Project configuration in CFn-property shape.
|
|
32975
|
+
*
|
|
32976
|
+
* Issues `BatchGetProjects` and re-shapes the SDK's camelCase response back
|
|
32977
|
+
* to CFn's PascalCase shape (the `mapProperties` helper above goes the
|
|
32978
|
+
* other way at create time). The drift comparator only descends into
|
|
32979
|
+
* keys present in cdkd state, so we focus on the high-value top-level
|
|
32980
|
+
* fields and the most commonly-set `Source` / `Artifacts` /
|
|
32981
|
+
* `Environment` sub-fields. Less common nested config (full
|
|
32982
|
+
* `LogsConfig`, `VpcConfig` rebuild, secondary sources/artifacts, etc.)
|
|
32983
|
+
* is left to a follow-up — surfacing them with a partial shape would
|
|
32984
|
+
* fire false drift on every project that uses them.
|
|
32985
|
+
*
|
|
32986
|
+
* Tags are skipped (CDK auto-tag handling deferred). Returns `undefined`
|
|
32987
|
+
* when the project is gone (`projects` array empty / `projectsNotFound` set).
|
|
32988
|
+
*/
|
|
32989
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
32990
|
+
let project;
|
|
32991
|
+
try {
|
|
32992
|
+
const resp = await this.getClient().send(
|
|
32993
|
+
new BatchGetProjectsCommand({ names: [physicalId] })
|
|
32994
|
+
);
|
|
32995
|
+
project = resp.projects?.[0];
|
|
32996
|
+
} catch (err) {
|
|
32997
|
+
if (err instanceof ResourceNotFoundException15)
|
|
32998
|
+
return void 0;
|
|
32999
|
+
throw err;
|
|
33000
|
+
}
|
|
33001
|
+
if (!project)
|
|
33002
|
+
return void 0;
|
|
33003
|
+
const result = {};
|
|
33004
|
+
if (project.name !== void 0)
|
|
33005
|
+
result["Name"] = project.name;
|
|
33006
|
+
if (project.description !== void 0 && project.description !== "") {
|
|
33007
|
+
result["Description"] = project.description;
|
|
33008
|
+
}
|
|
33009
|
+
if (project.serviceRole !== void 0)
|
|
33010
|
+
result["ServiceRole"] = project.serviceRole;
|
|
33011
|
+
if (project.timeoutInMinutes !== void 0) {
|
|
33012
|
+
result["TimeoutInMinutes"] = project.timeoutInMinutes;
|
|
33013
|
+
}
|
|
33014
|
+
if (project.queuedTimeoutInMinutes !== void 0) {
|
|
33015
|
+
result["QueuedTimeoutInMinutes"] = project.queuedTimeoutInMinutes;
|
|
33016
|
+
}
|
|
33017
|
+
if (project.encryptionKey !== void 0)
|
|
33018
|
+
result["EncryptionKey"] = project.encryptionKey;
|
|
33019
|
+
if (project.concurrentBuildLimit !== void 0) {
|
|
33020
|
+
result["ConcurrentBuildLimit"] = project.concurrentBuildLimit;
|
|
33021
|
+
}
|
|
33022
|
+
if (project.badge?.badgeEnabled !== void 0) {
|
|
33023
|
+
result["BadgeEnabled"] = project.badge.badgeEnabled;
|
|
33024
|
+
}
|
|
33025
|
+
if (project.sourceVersion !== void 0)
|
|
33026
|
+
result["SourceVersion"] = project.sourceVersion;
|
|
33027
|
+
if (project.source) {
|
|
33028
|
+
const src = {};
|
|
33029
|
+
if (project.source.type !== void 0)
|
|
33030
|
+
src["Type"] = project.source.type;
|
|
33031
|
+
if (project.source.location !== void 0)
|
|
33032
|
+
src["Location"] = project.source.location;
|
|
33033
|
+
if (project.source.buildspec !== void 0)
|
|
33034
|
+
src["BuildSpec"] = project.source.buildspec;
|
|
33035
|
+
if (project.source.gitCloneDepth !== void 0) {
|
|
33036
|
+
src["GitCloneDepth"] = project.source.gitCloneDepth;
|
|
33037
|
+
}
|
|
33038
|
+
if (project.source.insecureSsl !== void 0)
|
|
33039
|
+
src["InsecureSsl"] = project.source.insecureSsl;
|
|
33040
|
+
if (project.source.reportBuildStatus !== void 0) {
|
|
33041
|
+
src["ReportBuildStatus"] = project.source.reportBuildStatus;
|
|
33042
|
+
}
|
|
33043
|
+
if (Object.keys(src).length > 0)
|
|
33044
|
+
result["Source"] = src;
|
|
33045
|
+
}
|
|
33046
|
+
if (project.artifacts) {
|
|
33047
|
+
const art = {};
|
|
33048
|
+
if (project.artifacts.type !== void 0)
|
|
33049
|
+
art["Type"] = project.artifacts.type;
|
|
33050
|
+
if (project.artifacts.location !== void 0)
|
|
33051
|
+
art["Location"] = project.artifacts.location;
|
|
33052
|
+
if (project.artifacts.path !== void 0)
|
|
33053
|
+
art["Path"] = project.artifacts.path;
|
|
33054
|
+
if (project.artifacts.name !== void 0)
|
|
33055
|
+
art["Name"] = project.artifacts.name;
|
|
33056
|
+
if (project.artifacts.namespaceType !== void 0) {
|
|
33057
|
+
art["NamespaceType"] = project.artifacts.namespaceType;
|
|
33058
|
+
}
|
|
33059
|
+
if (project.artifacts.packaging !== void 0)
|
|
33060
|
+
art["Packaging"] = project.artifacts.packaging;
|
|
33061
|
+
if (project.artifacts.encryptionDisabled !== void 0) {
|
|
33062
|
+
art["EncryptionDisabled"] = project.artifacts.encryptionDisabled;
|
|
33063
|
+
}
|
|
33064
|
+
if (project.artifacts.overrideArtifactName !== void 0) {
|
|
33065
|
+
art["OverrideArtifactName"] = project.artifacts.overrideArtifactName;
|
|
33066
|
+
}
|
|
33067
|
+
if (project.artifacts.artifactIdentifier !== void 0) {
|
|
33068
|
+
art["ArtifactIdentifier"] = project.artifacts.artifactIdentifier;
|
|
33069
|
+
}
|
|
33070
|
+
if (Object.keys(art).length > 0)
|
|
33071
|
+
result["Artifacts"] = art;
|
|
33072
|
+
}
|
|
33073
|
+
if (project.environment) {
|
|
33074
|
+
const env = {};
|
|
33075
|
+
if (project.environment.type !== void 0)
|
|
33076
|
+
env["Type"] = project.environment.type;
|
|
33077
|
+
if (project.environment.image !== void 0)
|
|
33078
|
+
env["Image"] = project.environment.image;
|
|
33079
|
+
if (project.environment.computeType !== void 0) {
|
|
33080
|
+
env["ComputeType"] = project.environment.computeType;
|
|
33081
|
+
}
|
|
33082
|
+
if (project.environment.privilegedMode !== void 0) {
|
|
33083
|
+
env["PrivilegedMode"] = project.environment.privilegedMode;
|
|
33084
|
+
}
|
|
33085
|
+
if (project.environment.imagePullCredentialsType !== void 0) {
|
|
33086
|
+
env["ImagePullCredentialsType"] = project.environment.imagePullCredentialsType;
|
|
33087
|
+
}
|
|
33088
|
+
if (project.environment.certificate !== void 0) {
|
|
33089
|
+
env["Certificate"] = project.environment.certificate;
|
|
33090
|
+
}
|
|
33091
|
+
if (project.environment.environmentVariables && project.environment.environmentVariables.length > 0) {
|
|
33092
|
+
env["EnvironmentVariables"] = project.environment.environmentVariables.map((ev) => {
|
|
33093
|
+
const out = {};
|
|
33094
|
+
if (ev.name !== void 0)
|
|
33095
|
+
out["Name"] = ev.name;
|
|
33096
|
+
if (ev.value !== void 0)
|
|
33097
|
+
out["Value"] = ev.value;
|
|
33098
|
+
if (ev.type !== void 0)
|
|
33099
|
+
out["Type"] = ev.type;
|
|
33100
|
+
return out;
|
|
33101
|
+
});
|
|
33102
|
+
}
|
|
33103
|
+
if (Object.keys(env).length > 0)
|
|
33104
|
+
result["Environment"] = env;
|
|
33105
|
+
}
|
|
33106
|
+
return result;
|
|
33107
|
+
}
|
|
31588
33108
|
async import(input) {
|
|
31589
33109
|
const explicit = resolveExplicitPhysicalId(input, "Name");
|
|
31590
33110
|
if (explicit) {
|
|
@@ -38869,7 +40389,7 @@ function reorderArgs(argv) {
|
|
|
38869
40389
|
}
|
|
38870
40390
|
async function main() {
|
|
38871
40391
|
const program = new Command14();
|
|
38872
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
40392
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.40.0");
|
|
38873
40393
|
program.addCommand(createBootstrapCommand());
|
|
38874
40394
|
program.addCommand(createSynthCommand());
|
|
38875
40395
|
program.addCommand(createListCommand());
|