@go-to-k/cdkd 0.62.0 → 0.63.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 +400 -20
- package/dist/cli.js.map +4 -4
- package/dist/go-to-k-cdkd-0.63.0.tgz +0 -0
- package/package.json +1 -1
- package/dist/go-to-k-cdkd-0.62.0.tgz +0 -0
package/dist/cli.js
CHANGED
|
@@ -42217,6 +42217,42 @@ var EC2Provider = class {
|
|
|
42217
42217
|
throw err;
|
|
42218
42218
|
}
|
|
42219
42219
|
}
|
|
42220
|
+
/**
|
|
42221
|
+
* Drift-unknown paths per resource type.
|
|
42222
|
+
*
|
|
42223
|
+
* The 6 EC2 sub-resource types (`AWS::EC2::Route` /
|
|
42224
|
+
* `VPCGatewayAttachment` / `SubnetRouteTableAssociation` /
|
|
42225
|
+
* `SecurityGroupIngress` / `NetworkAclEntry` /
|
|
42226
|
+
* `SubnetNetworkAclAssociation`) have NO AWS-side `Tags` API — the
|
|
42227
|
+
* underlying AWS objects (route entries, NACL entries, route-table
|
|
42228
|
+
* associations, NACL associations, IGW attachments) are not
|
|
42229
|
+
* tag-bearing on AWS, and the corresponding CFn schemas do not model
|
|
42230
|
+
* `Tags` either. Declaring `'Tags'` here is defense-in-depth: if a
|
|
42231
|
+
* future CFn schema revision adds `Tags` to one of these types, or
|
|
42232
|
+
* cdkd state somehow carries `Tags` for one of them via a custom
|
|
42233
|
+
* property override, the drift comparator will skip the path
|
|
42234
|
+
* instead of firing guaranteed false-positive drift on every clean
|
|
42235
|
+
* run.
|
|
42236
|
+
*
|
|
42237
|
+
* Other EC2 types (`VPC` / `Subnet` / `InternetGateway` /
|
|
42238
|
+
* `NatGateway` / `RouteTable` / `SecurityGroup` / `Instance` /
|
|
42239
|
+
* `NetworkAcl`) have first-class Tags support via
|
|
42240
|
+
* `DescribeTags` — they surface `Tags` directly in
|
|
42241
|
+
* `readCurrentState` and don't need this declaration.
|
|
42242
|
+
*/
|
|
42243
|
+
getDriftUnknownPaths(resourceType) {
|
|
42244
|
+
switch (resourceType) {
|
|
42245
|
+
case "AWS::EC2::Route":
|
|
42246
|
+
case "AWS::EC2::VPCGatewayAttachment":
|
|
42247
|
+
case "AWS::EC2::SubnetRouteTableAssociation":
|
|
42248
|
+
case "AWS::EC2::SecurityGroupIngress":
|
|
42249
|
+
case "AWS::EC2::NetworkAclEntry":
|
|
42250
|
+
case "AWS::EC2::SubnetNetworkAclAssociation":
|
|
42251
|
+
return ["Tags"];
|
|
42252
|
+
default:
|
|
42253
|
+
return [];
|
|
42254
|
+
}
|
|
42255
|
+
}
|
|
42220
42256
|
async readVpcCurrentState(physicalId) {
|
|
42221
42257
|
const resp = await this.ec2Client.send(new DescribeVpcsCommand2({ VpcIds: [physicalId] }));
|
|
42222
42258
|
const vpc = resp.Vpcs?.[0];
|
|
@@ -57944,6 +57980,349 @@ var KinesisStreamProvider = class {
|
|
|
57944
57980
|
}
|
|
57945
57981
|
};
|
|
57946
57982
|
|
|
57983
|
+
// src/provisioning/providers/kinesis-streamconsumer-provider.ts
|
|
57984
|
+
import {
|
|
57985
|
+
KinesisClient as KinesisClient2,
|
|
57986
|
+
RegisterStreamConsumerCommand,
|
|
57987
|
+
DeregisterStreamConsumerCommand,
|
|
57988
|
+
DescribeStreamConsumerCommand,
|
|
57989
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand18,
|
|
57990
|
+
TagResourceCommand as TagResourceCommand15,
|
|
57991
|
+
UntagResourceCommand as UntagResourceCommand15,
|
|
57992
|
+
ResourceNotFoundException as ResourceNotFoundException14
|
|
57993
|
+
} from "@aws-sdk/client-kinesis";
|
|
57994
|
+
var KinesisStreamConsumerProvider = class {
|
|
57995
|
+
client;
|
|
57996
|
+
providerRegion = process.env["AWS_REGION"];
|
|
57997
|
+
logger = getLogger().child("KinesisStreamConsumerProvider");
|
|
57998
|
+
handledProperties = /* @__PURE__ */ new Map([
|
|
57999
|
+
["AWS::Kinesis::StreamConsumer", /* @__PURE__ */ new Set(["ConsumerName", "StreamARN", "Tags"])]
|
|
58000
|
+
]);
|
|
58001
|
+
getClient() {
|
|
58002
|
+
if (!this.client) {
|
|
58003
|
+
this.client = new KinesisClient2(this.providerRegion ? { region: this.providerRegion } : {});
|
|
58004
|
+
}
|
|
58005
|
+
return this.client;
|
|
58006
|
+
}
|
|
58007
|
+
/**
|
|
58008
|
+
* Register a Kinesis stream consumer.
|
|
58009
|
+
*
|
|
58010
|
+
* Polls `DescribeStreamConsumer` until ConsumerStatus flips from
|
|
58011
|
+
* `CREATING` to `ACTIVE` (matches CFn behavior). 1s polling interval
|
|
58012
|
+
* is faster than the CC API exponential backoff used to be.
|
|
58013
|
+
*/
|
|
58014
|
+
async create(logicalId, resourceType, properties) {
|
|
58015
|
+
const consumerName = properties["ConsumerName"];
|
|
58016
|
+
const streamArn = properties["StreamARN"];
|
|
58017
|
+
if (!consumerName) {
|
|
58018
|
+
throw new ProvisioningError(
|
|
58019
|
+
"AWS::Kinesis::StreamConsumer requires ConsumerName",
|
|
58020
|
+
resourceType,
|
|
58021
|
+
logicalId
|
|
58022
|
+
);
|
|
58023
|
+
}
|
|
58024
|
+
if (!streamArn) {
|
|
58025
|
+
throw new ProvisioningError(
|
|
58026
|
+
"AWS::Kinesis::StreamConsumer requires StreamARN",
|
|
58027
|
+
resourceType,
|
|
58028
|
+
logicalId
|
|
58029
|
+
);
|
|
58030
|
+
}
|
|
58031
|
+
this.logger.debug(`Registering Kinesis stream consumer ${logicalId}: ${consumerName}`);
|
|
58032
|
+
const tagList = Array.isArray(properties["Tags"]) ? properties["Tags"] : void 0;
|
|
58033
|
+
const tagMap = tagListToMap(tagList);
|
|
58034
|
+
try {
|
|
58035
|
+
const resp = await this.getClient().send(
|
|
58036
|
+
new RegisterStreamConsumerCommand({
|
|
58037
|
+
StreamARN: streamArn,
|
|
58038
|
+
ConsumerName: consumerName,
|
|
58039
|
+
...tagMap && Object.keys(tagMap).length > 0 ? { Tags: tagMap } : {}
|
|
58040
|
+
})
|
|
58041
|
+
);
|
|
58042
|
+
const consumer = resp.Consumer;
|
|
58043
|
+
if (!consumer?.ConsumerARN || !consumer.ConsumerName) {
|
|
58044
|
+
throw new ProvisioningError(
|
|
58045
|
+
"RegisterStreamConsumer did not return ConsumerARN/ConsumerName",
|
|
58046
|
+
resourceType,
|
|
58047
|
+
logicalId
|
|
58048
|
+
);
|
|
58049
|
+
}
|
|
58050
|
+
const consumerArn = consumer.ConsumerARN;
|
|
58051
|
+
await this.waitForConsumerActive(consumerArn);
|
|
58052
|
+
this.logger.debug(`Successfully registered Kinesis stream consumer ${logicalId}`);
|
|
58053
|
+
return {
|
|
58054
|
+
physicalId: consumerArn,
|
|
58055
|
+
attributes: {
|
|
58056
|
+
ConsumerARN: consumerArn,
|
|
58057
|
+
ConsumerName: consumer.ConsumerName,
|
|
58058
|
+
ConsumerStatus: consumer.ConsumerStatus,
|
|
58059
|
+
ConsumerCreationTimestamp: consumer.ConsumerCreationTimestamp?.toISOString() ?? void 0,
|
|
58060
|
+
// CFn `Id` for StreamConsumer is the ConsumerARN (matches the
|
|
58061
|
+
// CFn return-values doc).
|
|
58062
|
+
Id: consumerArn,
|
|
58063
|
+
StreamARN: streamArn
|
|
58064
|
+
}
|
|
58065
|
+
};
|
|
58066
|
+
} catch (error) {
|
|
58067
|
+
if (error instanceof ProvisioningError)
|
|
58068
|
+
throw error;
|
|
58069
|
+
const cause = error instanceof Error ? error : void 0;
|
|
58070
|
+
throw new ProvisioningError(
|
|
58071
|
+
`Failed to register Kinesis stream consumer ${logicalId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
58072
|
+
resourceType,
|
|
58073
|
+
logicalId,
|
|
58074
|
+
consumerName,
|
|
58075
|
+
cause
|
|
58076
|
+
);
|
|
58077
|
+
}
|
|
58078
|
+
}
|
|
58079
|
+
/**
|
|
58080
|
+
* Update is a no-op for the immutable `ConsumerName` / `StreamARN`
|
|
58081
|
+
* fields (the deploy engine's replacement-detection layer triggers
|
|
58082
|
+
* DELETE + CREATE for those changes). Tags ARE mutable via
|
|
58083
|
+
* `TagResource` / `UntagResource` so the diff is applied here.
|
|
58084
|
+
*
|
|
58085
|
+
* If a non-Tags property changes, throw `ResourceUpdateNotSupportedError`
|
|
58086
|
+
* — `cdkd drift --revert` will surface that to the user with the
|
|
58087
|
+
* "use cdkd deploy --replace" suggestion.
|
|
58088
|
+
*/
|
|
58089
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
58090
|
+
const newConsumerName = properties["ConsumerName"];
|
|
58091
|
+
const oldConsumerName = previousProperties["ConsumerName"];
|
|
58092
|
+
const newStreamArn = properties["StreamARN"];
|
|
58093
|
+
const oldStreamArn = previousProperties["StreamARN"];
|
|
58094
|
+
if (newConsumerName !== oldConsumerName || newStreamArn !== oldStreamArn) {
|
|
58095
|
+
throw new ResourceUpdateNotSupportedError(
|
|
58096
|
+
resourceType,
|
|
58097
|
+
logicalId,
|
|
58098
|
+
"AWS::Kinesis::StreamConsumer ConsumerName / StreamARN are immutable; re-deploy with cdkd deploy --replace, or destroy + redeploy"
|
|
58099
|
+
);
|
|
58100
|
+
}
|
|
58101
|
+
await this.applyTagDiff(
|
|
58102
|
+
physicalId,
|
|
58103
|
+
previousProperties["Tags"],
|
|
58104
|
+
properties["Tags"]
|
|
58105
|
+
);
|
|
58106
|
+
let attrs = {};
|
|
58107
|
+
try {
|
|
58108
|
+
const resp = await this.getClient().send(
|
|
58109
|
+
new DescribeStreamConsumerCommand({ ConsumerARN: physicalId })
|
|
58110
|
+
);
|
|
58111
|
+
const desc = resp.ConsumerDescription;
|
|
58112
|
+
if (desc) {
|
|
58113
|
+
attrs = {
|
|
58114
|
+
ConsumerARN: desc.ConsumerARN,
|
|
58115
|
+
ConsumerName: desc.ConsumerName,
|
|
58116
|
+
ConsumerStatus: desc.ConsumerStatus,
|
|
58117
|
+
ConsumerCreationTimestamp: desc.ConsumerCreationTimestamp?.toISOString() ?? void 0,
|
|
58118
|
+
Id: desc.ConsumerARN,
|
|
58119
|
+
StreamARN: desc.StreamARN
|
|
58120
|
+
};
|
|
58121
|
+
}
|
|
58122
|
+
} catch (err) {
|
|
58123
|
+
this.logger.debug(
|
|
58124
|
+
`DescribeStreamConsumer(${physicalId}) failed: ${err instanceof Error ? err.message : String(err)}`
|
|
58125
|
+
);
|
|
58126
|
+
}
|
|
58127
|
+
return {
|
|
58128
|
+
physicalId,
|
|
58129
|
+
wasReplaced: false,
|
|
58130
|
+
attributes: attrs
|
|
58131
|
+
};
|
|
58132
|
+
}
|
|
58133
|
+
/**
|
|
58134
|
+
* Deregister a Kinesis stream consumer.
|
|
58135
|
+
*
|
|
58136
|
+
* Per CFn semantics, DELETE returns once `DeregisterStreamConsumer`
|
|
58137
|
+
* returns — AWS handles eventual disappearance asynchronously, but
|
|
58138
|
+
* cdkd does not need to poll for that. `ResourceNotFoundException`
|
|
58139
|
+
* is treated as idempotent success (subject to the standard region
|
|
58140
|
+
* verification for delete idempotency).
|
|
58141
|
+
*/
|
|
58142
|
+
async delete(logicalId, physicalId, resourceType, _properties, context) {
|
|
58143
|
+
this.logger.debug(`Deregistering Kinesis stream consumer ${logicalId}: ${physicalId}`);
|
|
58144
|
+
try {
|
|
58145
|
+
await this.getClient().send(new DeregisterStreamConsumerCommand({ ConsumerARN: physicalId }));
|
|
58146
|
+
this.logger.debug(`Successfully deregistered Kinesis stream consumer ${logicalId}`);
|
|
58147
|
+
} catch (error) {
|
|
58148
|
+
if (error instanceof ResourceNotFoundException14) {
|
|
58149
|
+
const clientRegion = await this.getClient().config.region();
|
|
58150
|
+
assertRegionMatch(
|
|
58151
|
+
clientRegion,
|
|
58152
|
+
context?.expectedRegion,
|
|
58153
|
+
resourceType,
|
|
58154
|
+
logicalId,
|
|
58155
|
+
physicalId
|
|
58156
|
+
);
|
|
58157
|
+
this.logger.debug(`Kinesis stream consumer ${physicalId} not found, skipping`);
|
|
58158
|
+
return;
|
|
58159
|
+
}
|
|
58160
|
+
const cause = error instanceof Error ? error : void 0;
|
|
58161
|
+
throw new ProvisioningError(
|
|
58162
|
+
`Failed to deregister Kinesis stream consumer ${logicalId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
58163
|
+
resourceType,
|
|
58164
|
+
logicalId,
|
|
58165
|
+
physicalId,
|
|
58166
|
+
cause
|
|
58167
|
+
);
|
|
58168
|
+
}
|
|
58169
|
+
}
|
|
58170
|
+
async getAttribute(physicalId, _resourceType, attributeName) {
|
|
58171
|
+
if (attributeName === "ConsumerARN" || attributeName === "Id") {
|
|
58172
|
+
return physicalId;
|
|
58173
|
+
}
|
|
58174
|
+
const resp = await this.getClient().send(
|
|
58175
|
+
new DescribeStreamConsumerCommand({ ConsumerARN: physicalId })
|
|
58176
|
+
);
|
|
58177
|
+
const desc = resp.ConsumerDescription;
|
|
58178
|
+
if (!desc)
|
|
58179
|
+
return void 0;
|
|
58180
|
+
switch (attributeName) {
|
|
58181
|
+
case "ConsumerName":
|
|
58182
|
+
return desc.ConsumerName;
|
|
58183
|
+
case "ConsumerStatus":
|
|
58184
|
+
return desc.ConsumerStatus;
|
|
58185
|
+
case "ConsumerCreationTimestamp":
|
|
58186
|
+
return desc.ConsumerCreationTimestamp?.toISOString() ?? void 0;
|
|
58187
|
+
case "StreamARN":
|
|
58188
|
+
return desc.StreamARN;
|
|
58189
|
+
default:
|
|
58190
|
+
return void 0;
|
|
58191
|
+
}
|
|
58192
|
+
}
|
|
58193
|
+
/**
|
|
58194
|
+
* Read the AWS-current StreamConsumer configuration in CFn-property shape.
|
|
58195
|
+
*
|
|
58196
|
+
* Surfaces `ConsumerName` + `StreamARN` (the only user-controllable
|
|
58197
|
+
* top-level CFn properties). AWS-managed read-only fields
|
|
58198
|
+
* (`ConsumerARN`, `ConsumerCreationTimestamp`, `ConsumerStatus`) are
|
|
58199
|
+
* omitted — they are not in `handledProperties` and surface only as
|
|
58200
|
+
* `getAttribute` results.
|
|
58201
|
+
*
|
|
58202
|
+
* `Tags` are surfaced via `ListTagsForResource(ResourceARN=ConsumerARN)`
|
|
58203
|
+
* with `aws:*` filtered out and the always-emit `[]` placeholder
|
|
58204
|
+
* pattern (PR #145). The CFn schema for `AWS::Kinesis::StreamConsumer`
|
|
58205
|
+
* does not currently model Tags as a top-level property, but cdkd
|
|
58206
|
+
* surfaces it defensively so future schema revisions or custom
|
|
58207
|
+
* property overrides can round-trip cleanly.
|
|
58208
|
+
*
|
|
58209
|
+
* Returns `undefined` when the consumer is gone
|
|
58210
|
+
* (`ResourceNotFoundException`).
|
|
58211
|
+
*/
|
|
58212
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
58213
|
+
if (resourceType !== "AWS::Kinesis::StreamConsumer")
|
|
58214
|
+
return void 0;
|
|
58215
|
+
let desc;
|
|
58216
|
+
try {
|
|
58217
|
+
const resp = await this.getClient().send(
|
|
58218
|
+
new DescribeStreamConsumerCommand({ ConsumerARN: physicalId })
|
|
58219
|
+
);
|
|
58220
|
+
desc = resp.ConsumerDescription;
|
|
58221
|
+
} catch (err) {
|
|
58222
|
+
if (err instanceof ResourceNotFoundException14)
|
|
58223
|
+
return void 0;
|
|
58224
|
+
throw err;
|
|
58225
|
+
}
|
|
58226
|
+
if (!desc)
|
|
58227
|
+
return void 0;
|
|
58228
|
+
const result = {};
|
|
58229
|
+
if (desc.ConsumerName !== void 0)
|
|
58230
|
+
result["ConsumerName"] = desc.ConsumerName;
|
|
58231
|
+
if (desc.StreamARN !== void 0)
|
|
58232
|
+
result["StreamARN"] = desc.StreamARN;
|
|
58233
|
+
try {
|
|
58234
|
+
const tagsResp = await this.getClient().send(
|
|
58235
|
+
new ListTagsForResourceCommand18({ ResourceARN: physicalId })
|
|
58236
|
+
);
|
|
58237
|
+
result["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
|
|
58238
|
+
} catch (err) {
|
|
58239
|
+
if (err instanceof ResourceNotFoundException14)
|
|
58240
|
+
return void 0;
|
|
58241
|
+
this.logger.debug(
|
|
58242
|
+
`ListTagsForResource(${physicalId}) failed: ${err instanceof Error ? err.message : String(err)}`
|
|
58243
|
+
);
|
|
58244
|
+
result["Tags"] = [];
|
|
58245
|
+
}
|
|
58246
|
+
return result;
|
|
58247
|
+
}
|
|
58248
|
+
/**
|
|
58249
|
+
* Apply a diff between old and new CFn-shape Tags arrays via Kinesis's
|
|
58250
|
+
* generic `TagResource` (TagMap shape) / `UntagResource` (TagKeys list)
|
|
58251
|
+
* APIs. Mirrors `KinesisStreamProvider.applyTagDiff`, except the
|
|
58252
|
+
* Kinesis service splits the per-resource-type tag APIs vs the generic
|
|
58253
|
+
* tag APIs — StreamConsumer uses the generic ones (which accept any
|
|
58254
|
+
* Kinesis resource ARN).
|
|
58255
|
+
*/
|
|
58256
|
+
async applyTagDiff(consumerArn, oldTagsRaw, newTagsRaw) {
|
|
58257
|
+
const oldMap = tagListToMap(oldTagsRaw) ?? {};
|
|
58258
|
+
const newMap = tagListToMap(newTagsRaw) ?? {};
|
|
58259
|
+
const tagsToAdd = {};
|
|
58260
|
+
for (const [k, v] of Object.entries(newMap)) {
|
|
58261
|
+
if (oldMap[k] !== v)
|
|
58262
|
+
tagsToAdd[k] = v;
|
|
58263
|
+
}
|
|
58264
|
+
const tagsToRemove = [];
|
|
58265
|
+
for (const k of Object.keys(oldMap)) {
|
|
58266
|
+
if (!(k in newMap))
|
|
58267
|
+
tagsToRemove.push(k);
|
|
58268
|
+
}
|
|
58269
|
+
if (tagsToRemove.length > 0) {
|
|
58270
|
+
await this.getClient().send(
|
|
58271
|
+
new UntagResourceCommand15({ ResourceARN: consumerArn, TagKeys: tagsToRemove })
|
|
58272
|
+
);
|
|
58273
|
+
this.logger.debug(
|
|
58274
|
+
`Removed ${tagsToRemove.length} tag(s) from Kinesis stream consumer ${consumerArn}`
|
|
58275
|
+
);
|
|
58276
|
+
}
|
|
58277
|
+
if (Object.keys(tagsToAdd).length > 0) {
|
|
58278
|
+
await this.getClient().send(
|
|
58279
|
+
new TagResourceCommand15({ ResourceARN: consumerArn, Tags: tagsToAdd })
|
|
58280
|
+
);
|
|
58281
|
+
this.logger.debug(
|
|
58282
|
+
`Added/updated ${Object.keys(tagsToAdd).length} tag(s) on Kinesis stream consumer ${consumerArn}`
|
|
58283
|
+
);
|
|
58284
|
+
}
|
|
58285
|
+
}
|
|
58286
|
+
/**
|
|
58287
|
+
* Poll DescribeStreamConsumer until the consumer reaches `ACTIVE`.
|
|
58288
|
+
*
|
|
58289
|
+
* Uses 1s polling intervals — consumer registration is typically
|
|
58290
|
+
* sub-second, but AWS can take up to ~30s under load. Caps at 60
|
|
58291
|
+
* attempts (1 minute total) which is bounded above by the per-resource
|
|
58292
|
+
* `--resource-timeout` deadline.
|
|
58293
|
+
*/
|
|
58294
|
+
async waitForConsumerActive(consumerArn, maxAttempts = 60) {
|
|
58295
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
58296
|
+
const resp = await this.getClient().send(
|
|
58297
|
+
new DescribeStreamConsumerCommand({ ConsumerARN: consumerArn })
|
|
58298
|
+
);
|
|
58299
|
+
const status = resp.ConsumerDescription?.ConsumerStatus;
|
|
58300
|
+
this.logger.debug(
|
|
58301
|
+
`Consumer ${consumerArn} status: ${status} (attempt ${attempt}/${maxAttempts})`
|
|
58302
|
+
);
|
|
58303
|
+
if (status === "ACTIVE")
|
|
58304
|
+
return;
|
|
58305
|
+
if (status !== "CREATING") {
|
|
58306
|
+
throw new Error(`Unexpected consumer status: ${status}`);
|
|
58307
|
+
}
|
|
58308
|
+
await new Promise((resolve4) => setTimeout(resolve4, 1e3));
|
|
58309
|
+
}
|
|
58310
|
+
throw new Error(
|
|
58311
|
+
`Consumer ${consumerArn} did not reach ACTIVE status within ${maxAttempts} seconds`
|
|
58312
|
+
);
|
|
58313
|
+
}
|
|
58314
|
+
};
|
|
58315
|
+
function tagListToMap(tags) {
|
|
58316
|
+
if (!tags || tags.length === 0)
|
|
58317
|
+
return void 0;
|
|
58318
|
+
const out = {};
|
|
58319
|
+
for (const t of tags) {
|
|
58320
|
+
if (t.Key !== void 0 && t.Value !== void 0)
|
|
58321
|
+
out[t.Key] = t.Value;
|
|
58322
|
+
}
|
|
58323
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
58324
|
+
}
|
|
58325
|
+
|
|
57947
58326
|
// src/provisioning/providers/efs-provider.ts
|
|
57948
58327
|
import {
|
|
57949
58328
|
EFSClient,
|
|
@@ -58757,7 +59136,7 @@ import {
|
|
|
58757
59136
|
DescribeDeliveryStreamCommand,
|
|
58758
59137
|
ListDeliveryStreamsCommand,
|
|
58759
59138
|
ListTagsForDeliveryStreamCommand,
|
|
58760
|
-
ResourceNotFoundException as
|
|
59139
|
+
ResourceNotFoundException as ResourceNotFoundException15
|
|
58761
59140
|
} from "@aws-sdk/client-firehose";
|
|
58762
59141
|
var FirehoseProvider = class {
|
|
58763
59142
|
client;
|
|
@@ -58990,7 +59369,7 @@ var FirehoseProvider = class {
|
|
|
58990
59369
|
);
|
|
58991
59370
|
this.logger.debug(`Successfully deleted Firehose delivery stream ${logicalId}`);
|
|
58992
59371
|
} catch (error) {
|
|
58993
|
-
if (error instanceof
|
|
59372
|
+
if (error instanceof ResourceNotFoundException15) {
|
|
58994
59373
|
const clientRegion = await this.getClient().config.region();
|
|
58995
59374
|
assertRegionMatch(
|
|
58996
59375
|
clientRegion,
|
|
@@ -59169,7 +59548,7 @@ var FirehoseProvider = class {
|
|
|
59169
59548
|
);
|
|
59170
59549
|
desc = resp.DeliveryStreamDescription;
|
|
59171
59550
|
} catch (err) {
|
|
59172
|
-
if (err instanceof
|
|
59551
|
+
if (err instanceof ResourceNotFoundException15)
|
|
59173
59552
|
return void 0;
|
|
59174
59553
|
throw err;
|
|
59175
59554
|
}
|
|
@@ -59240,7 +59619,7 @@ var FirehoseProvider = class {
|
|
|
59240
59619
|
);
|
|
59241
59620
|
result["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
|
|
59242
59621
|
} catch (err) {
|
|
59243
|
-
if (err instanceof
|
|
59622
|
+
if (err instanceof ResourceNotFoundException15)
|
|
59244
59623
|
return void 0;
|
|
59245
59624
|
this.logger.debug(
|
|
59246
59625
|
`Firehose ListTagsForDeliveryStream(${physicalId}) failed: ${err instanceof Error ? err.message : String(err)}`
|
|
@@ -59284,7 +59663,7 @@ var FirehoseProvider = class {
|
|
|
59284
59663
|
);
|
|
59285
59664
|
return { physicalId: explicit, attributes: {} };
|
|
59286
59665
|
} catch (err) {
|
|
59287
|
-
if (err instanceof
|
|
59666
|
+
if (err instanceof ResourceNotFoundException15)
|
|
59288
59667
|
return null;
|
|
59289
59668
|
throw err;
|
|
59290
59669
|
}
|
|
@@ -59919,7 +60298,7 @@ import {
|
|
|
59919
60298
|
UpdateProjectCommand,
|
|
59920
60299
|
BatchGetProjectsCommand,
|
|
59921
60300
|
ListProjectsCommand,
|
|
59922
|
-
ResourceNotFoundException as
|
|
60301
|
+
ResourceNotFoundException as ResourceNotFoundException16
|
|
59923
60302
|
} from "@aws-sdk/client-codebuild";
|
|
59924
60303
|
var CodeBuildProvider = class {
|
|
59925
60304
|
client;
|
|
@@ -60157,7 +60536,7 @@ var CodeBuildProvider = class {
|
|
|
60157
60536
|
await this.getClient().send(new DeleteProjectCommand({ name: physicalId }));
|
|
60158
60537
|
this.logger.debug(`Successfully deleted CodeBuild Project ${logicalId}`);
|
|
60159
60538
|
} catch (error) {
|
|
60160
|
-
if (error instanceof
|
|
60539
|
+
if (error instanceof ResourceNotFoundException16) {
|
|
60161
60540
|
const clientRegion = await this.getClient().config.region();
|
|
60162
60541
|
assertRegionMatch(
|
|
60163
60542
|
clientRegion,
|
|
@@ -60228,7 +60607,7 @@ var CodeBuildProvider = class {
|
|
|
60228
60607
|
);
|
|
60229
60608
|
project = resp.projects?.[0];
|
|
60230
60609
|
} catch (err) {
|
|
60231
|
-
if (err instanceof
|
|
60610
|
+
if (err instanceof ResourceNotFoundException16)
|
|
60232
60611
|
return void 0;
|
|
60233
60612
|
throw err;
|
|
60234
60613
|
}
|
|
@@ -60475,7 +60854,7 @@ var CodeBuildProvider = class {
|
|
|
60475
60854
|
);
|
|
60476
60855
|
return resp.projects?.[0]?.name ? { physicalId: explicit, attributes: {} } : null;
|
|
60477
60856
|
} catch (err) {
|
|
60478
|
-
if (err instanceof
|
|
60857
|
+
if (err instanceof ResourceNotFoundException16)
|
|
60479
60858
|
return null;
|
|
60480
60859
|
throw err;
|
|
60481
60860
|
}
|
|
@@ -60515,7 +60894,7 @@ import {
|
|
|
60515
60894
|
GetVectorBucketCommand,
|
|
60516
60895
|
ListIndexesCommand,
|
|
60517
60896
|
ListVectorBucketsCommand,
|
|
60518
|
-
ListTagsForResourceCommand as
|
|
60897
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand19,
|
|
60519
60898
|
DeleteIndexCommand
|
|
60520
60899
|
} from "@aws-sdk/client-s3vectors";
|
|
60521
60900
|
var S3VectorsProvider = class {
|
|
@@ -60749,7 +61128,7 @@ var S3VectorsProvider = class {
|
|
|
60749
61128
|
continue;
|
|
60750
61129
|
try {
|
|
60751
61130
|
const tagsResp = await this.getClient().send(
|
|
60752
|
-
new
|
|
61131
|
+
new ListTagsForResourceCommand19({ resourceArn: bucket.vectorBucketArn })
|
|
60753
61132
|
);
|
|
60754
61133
|
if (tagsResp.tags?.[CDK_PATH_TAG] === input.cdkPath) {
|
|
60755
61134
|
return { physicalId: bucket.vectorBucketName, attributes: {} };
|
|
@@ -61093,7 +61472,7 @@ import {
|
|
|
61093
61472
|
ListNamespacesCommand as ListNamespacesCommand2,
|
|
61094
61473
|
ListTablesCommand as ListTablesCommand2,
|
|
61095
61474
|
ListTableBucketsCommand,
|
|
61096
|
-
ListTagsForResourceCommand as
|
|
61475
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand20,
|
|
61097
61476
|
NotFoundException as NotFoundException6
|
|
61098
61477
|
} from "@aws-sdk/client-s3tables";
|
|
61099
61478
|
var S3TablesProvider = class {
|
|
@@ -61577,7 +61956,7 @@ var S3TablesProvider = class {
|
|
|
61577
61956
|
if (input.cdkPath) {
|
|
61578
61957
|
try {
|
|
61579
61958
|
const tagsResp = await this.getClient().send(
|
|
61580
|
-
new
|
|
61959
|
+
new ListTagsForResourceCommand20({ resourceArn: bucket.arn })
|
|
61581
61960
|
);
|
|
61582
61961
|
if (tagsResp.tags?.[CDK_PATH_TAG] === input.cdkPath) {
|
|
61583
61962
|
return { physicalId: bucket.arn, attributes: {} };
|
|
@@ -61657,7 +62036,7 @@ var S3TablesProvider = class {
|
|
|
61657
62036
|
continue;
|
|
61658
62037
|
try {
|
|
61659
62038
|
const tagsResp = await this.getClient().send(
|
|
61660
|
-
new
|
|
62039
|
+
new ListTagsForResourceCommand20({ resourceArn: table.tableARN })
|
|
61661
62040
|
);
|
|
61662
62041
|
if (tagsResp.tags?.[CDK_PATH_TAG] === input.cdkPath) {
|
|
61663
62042
|
return {
|
|
@@ -61742,8 +62121,8 @@ import {
|
|
|
61742
62121
|
SetRepositoryPolicyCommand,
|
|
61743
62122
|
PutImageScanningConfigurationCommand,
|
|
61744
62123
|
PutImageTagMutabilityCommand,
|
|
61745
|
-
TagResourceCommand as
|
|
61746
|
-
ListTagsForResourceCommand as
|
|
62124
|
+
TagResourceCommand as TagResourceCommand16,
|
|
62125
|
+
ListTagsForResourceCommand as ListTagsForResourceCommand21,
|
|
61747
62126
|
LifecyclePolicyNotFoundException,
|
|
61748
62127
|
RepositoryNotFoundException
|
|
61749
62128
|
} from "@aws-sdk/client-ecr";
|
|
@@ -61931,7 +62310,7 @@ var ECRProvider = class {
|
|
|
61931
62310
|
const repoArn = describeResponse.repositories?.[0]?.repositoryArn;
|
|
61932
62311
|
if (repoArn && newTags) {
|
|
61933
62312
|
await this.getClient().send(
|
|
61934
|
-
new
|
|
62313
|
+
new TagResourceCommand16({
|
|
61935
62314
|
resourceArn: repoArn,
|
|
61936
62315
|
tags: newTags
|
|
61937
62316
|
})
|
|
@@ -62073,7 +62452,7 @@ var ECRProvider = class {
|
|
|
62073
62452
|
if (r.repositoryArn) {
|
|
62074
62453
|
try {
|
|
62075
62454
|
const tagsResp = await this.getClient().send(
|
|
62076
|
-
new
|
|
62455
|
+
new ListTagsForResourceCommand21({ resourceArn: r.repositoryArn })
|
|
62077
62456
|
);
|
|
62078
62457
|
const tags = normalizeAwsTagsToCfn(tagsResp.tags);
|
|
62079
62458
|
result["Tags"] = tags;
|
|
@@ -62119,7 +62498,7 @@ var ECRProvider = class {
|
|
|
62119
62498
|
continue;
|
|
62120
62499
|
try {
|
|
62121
62500
|
const tagsResp = await this.getClient().send(
|
|
62122
|
-
new
|
|
62501
|
+
new ListTagsForResourceCommand21({ resourceArn: repo.repositoryArn })
|
|
62123
62502
|
);
|
|
62124
62503
|
if (matchesCdkPath(tagsResp.tags, input.cdkPath)) {
|
|
62125
62504
|
return { physicalId: repo.repositoryName, attributes: {} };
|
|
@@ -63178,6 +63557,7 @@ function registerAllProviders(registry) {
|
|
|
63178
63557
|
registry.register("AWS::KMS::Key", kmsProvider);
|
|
63179
63558
|
registry.register("AWS::KMS::Alias", kmsProvider);
|
|
63180
63559
|
registry.register("AWS::Kinesis::Stream", new KinesisStreamProvider());
|
|
63560
|
+
registry.register("AWS::Kinesis::StreamConsumer", new KinesisStreamConsumerProvider());
|
|
63181
63561
|
const efsProvider = new EFSProvider();
|
|
63182
63562
|
registry.register("AWS::EFS::FileSystem", efsProvider);
|
|
63183
63563
|
registry.register("AWS::EFS::MountTarget", efsProvider);
|
|
@@ -67993,7 +68373,7 @@ function reorderArgs(argv) {
|
|
|
67993
68373
|
}
|
|
67994
68374
|
async function main() {
|
|
67995
68375
|
const program = new Command14();
|
|
67996
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
68376
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.63.0");
|
|
67997
68377
|
program.addCommand(createBootstrapCommand());
|
|
67998
68378
|
program.addCommand(createSynthCommand());
|
|
67999
68379
|
program.addCommand(createListCommand());
|