@go-to-k/cdkd 0.278.40 → 0.278.42
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/{asg-provider-z4TiJLsS.js → asg-provider-mwqciloR.js} +2 -2
- package/dist/{asg-provider-z4TiJLsS.js.map → asg-provider-mwqciloR.js.map} +1 -1
- package/dist/cli.js +226 -94
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-CI_K8S3J.js → deploy-engine-DxexHYwK.js} +73 -15
- package/dist/deploy-engine-DxexHYwK.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-CI_K8S3J.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as DiffCalculator, $t as resolveBucketRegion, A as red, At as getDockerImageBySourceHash, B as isTerminationProtectionPropagationError, Bt as resolveStateBucketWithDefaultAndSource, C as isStatefulRecreateTargetSync, Ct as validateContainerRepoName, D as cyan, Dt as runDockerForeground, E as bold, En as withErrorHandling, Et as getDockerCmd, F as ProviderRegistry, Ft as resolveApp, G as normalizeAwsTagsToCfn, Gt as CFN_TEMPLATE_URL_LIMIT, H as cfnRefValueFromPhysicalId, Ht as stateBucketExistenceConfirmed, I as findActionableSilentDrops, It as resolveAutoAssetStorage, J as readConfigString, Jt as uploadCfnTemplate, K as resolveExplicitPhysicalId, Kt as MIGRATE_TMP_PREFIX, L as CloudControlProvider, Lt as resolveCaptureObservedState, M as IAMRoleProvider, Mt as synthesisStatusMessage, N as collectInlinePolicyNamesManagedBySiblings, Nt as getDefaultStateBucketName, O as gray, Ot as runDockerStreaming, P as clearOnUpdateRemoval, Pt as getLegacyStateBucketName, Q as applyRoleArnIfSet, R as slowCcOperationTimeoutMs, Rt as resolveSkipPrefix, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, St as validateAssetBucketName, T as formatResourceLine, Tn as normalizeAwsError, Tt as formatDockerLoginError, U as refStateLookupFromResource, Ut as warnDeprecatedNoPrefixCliFlag, V as IntrinsicFunctionResolver, Vt as resolveUseCdkBootstrapAssets, W as WAFv2WebACLProvider, Wt as CFN_TEMPLATE_BODY_LIMIT, X as requireConfigArray, Xt as AssemblyReader, Y as replayWarn, Yt as expectedOwnerParam, Z as requireConfigString, Zt as processStackMessages, _ as createPreDeleteFinalSnapshot, _n as ResourceTimeoutError, _t as AssetModeResolver, a as DeploymentEventsStore, an as CdkdError, at as TemplateParser, b as unsupportedFinalSnapshotError, bn as StackTerminationProtectionError, bt as getBootstrapMarkerKey, c as replayFailedOperations, cn as DeployCancelledError, ct as rebuildClientForBucketRegion, d as IMPLICIT_DELETE_DEPENDENCIES, dn as LocalStartServiceError, dt as stringifyValue, en as AwsClients, et as describeTypeWithThrottleRetry, f as computeImplicitDeleteEdges, ft as WorkGraph, g as ccRoutedFinalSnapshotError, gn as ProvisioningError, gt as rewriteTemplateAssetReferences, h as buildFinalSnapshotIdentifier, hn as PartialFailureError, ht as loadPublishableAssetManifest, i as DeploymentEventsReader, it as DagBuilder, j as yellow, jt as Synthesizer, k as green, kt as AssetManifestLoader, l as replayRollback, ln as LocalInvokeBuildError$1, lt as shouldRetainResource, m as PRE_DELETE_SNAPSHOT_TYPES, mn as NestedStackChildDirectDestroyError, mt as createAssetRedirectResolver, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as resetAwsClients, nt as isRetryableTransientError, o as planFailedOps, ot as LockManager, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as MissingCdkCliError, pt as buildAssetRedirectMap, q as assertRegionMatch, qt as findLargeInlineResources, r as DeployEngine, rn as setAwsClients, rt as isThrottlingError, s as planRollback, st as S3StateBackend, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as getAwsClients, tt as withRetry, u as withResourceDeadline, un as LocalMigrateError, ut as AssetPublisher, v as isFinalSnapshotError, vn as ResourceUpdateNotSupportedError, vt as BOOTSTRAP_MARKER_PREFIX, w as renderStatefulReason, wt as buildDockerImage, x as extractDeploymentEventError, xt as parseBootstrapMarker, y as refusesFinalSnapshot, yn as StackHasActiveImportsError, yt as ensureAssetStorage, z as disableInstanceApiTermination, zt as resolveStateBucketWithDefault } from "./deploy-engine-DxexHYwK.js";
|
|
3
3
|
import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, f as withSkipPrefix, i as runStackBuffered, n as getLogger, o as PATTERN_B_NAME_OPTIONS, p as withStackName, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-BYMEE-BS.js";
|
|
4
|
-
import { t as ASGProvider } from "./asg-provider-
|
|
4
|
+
import { t as ASGProvider } from "./asg-provider-mwqciloR.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
7
7
|
import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
@@ -3688,11 +3688,11 @@ var IAMAccessKeyProvider = class {
|
|
|
3688
3688
|
* exist on AWS without a cdkd state record, and the next deploy's re-CREATE
|
|
3689
3689
|
* would burn the user's 2-keys-per-user quota.
|
|
3690
3690
|
*/
|
|
3691
|
-
async create(logicalId, resourceType, properties) {
|
|
3691
|
+
async create(logicalId, resourceType, properties, context) {
|
|
3692
3692
|
this.logger.debug(`Creating IAM access key ${logicalId}`);
|
|
3693
3693
|
const userName = properties["UserName"];
|
|
3694
3694
|
if (!userName) throw new ProvisioningError(`AccessKey ${logicalId} requires UserName`, resourceType, logicalId);
|
|
3695
|
-
const status = properties["Status"]
|
|
3695
|
+
const status = requireConfigString(properties["Status"], "Active", "AWS::IAM::AccessKey Status", replayWarn(this.logger, context));
|
|
3696
3696
|
try {
|
|
3697
3697
|
const response = await this.iamClient.send(new CreateAccessKeyCommand({ UserName: userName }));
|
|
3698
3698
|
const accessKeyId = response.AccessKey?.AccessKeyId;
|
|
@@ -3747,10 +3747,11 @@ var IAMAccessKeyProvider = class {
|
|
|
3747
3747
|
* that REMOVES `Status` resets to the CFn default `Active` (absent-field
|
|
3748
3748
|
* removal semantics), so the desired status is always sent explicitly.
|
|
3749
3749
|
*/
|
|
3750
|
-
async update(logicalId, physicalId, resourceType, properties,
|
|
3750
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
3751
3751
|
this.logger.debug(`Updating IAM access key ${logicalId}: ${physicalId}`);
|
|
3752
3752
|
const userName = properties["UserName"];
|
|
3753
|
-
const
|
|
3753
|
+
const previousStatus = previousProperties["Status"] === "Inactive" ? "Inactive" : "Active";
|
|
3754
|
+
const status = properties["Status"] === void 0 ? "Active" : requireConfigString(properties["Status"], previousStatus, "AWS::IAM::AccessKey Status", { onUnusable: (message) => this.logger.warn(message) });
|
|
3754
3755
|
try {
|
|
3755
3756
|
await this.iamClient.send(new UpdateAccessKeyCommand({
|
|
3756
3757
|
UserName: userName,
|
|
@@ -5109,7 +5110,8 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
5109
5110
|
});
|
|
5110
5111
|
await this.s3Client.send(new PutBucketLifecycleConfigurationCommand({
|
|
5111
5112
|
Bucket: bucketName,
|
|
5112
|
-
LifecycleConfiguration: { Rules: rules }
|
|
5113
|
+
LifecycleConfiguration: { Rules: rules },
|
|
5114
|
+
TransitionDefaultMinimumObjectSize: lifecycleConfig["TransitionDefaultMinimumObjectSize"]
|
|
5113
5115
|
}));
|
|
5114
5116
|
this.logger.debug(`Applied lifecycle configuration to bucket ${bucketName}`);
|
|
5115
5117
|
}
|
|
@@ -5146,12 +5148,14 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
5146
5148
|
if (!Array.isArray(encryptionConfig?.ServerSideEncryptionConfiguration)) throw new Error(`BucketEncryption.ServerSideEncryptionConfiguration must be an array (got ${encryptionConfig?.ServerSideEncryptionConfiguration === void 0 ? "undefined" : typeof encryptionConfig.ServerSideEncryptionConfiguration}) — check for an unresolved intrinsic or a mis-nested template value`);
|
|
5147
5149
|
const rules = encryptionConfig.ServerSideEncryptionConfiguration.map((rule) => {
|
|
5148
5150
|
const byDefault = rule["ServerSideEncryptionByDefault"];
|
|
5151
|
+
const blocked = rule["BlockedEncryptionTypes"];
|
|
5149
5152
|
return {
|
|
5150
5153
|
ApplyServerSideEncryptionByDefault: byDefault ? {
|
|
5151
5154
|
SSEAlgorithm: byDefault["SSEAlgorithm"],
|
|
5152
5155
|
KMSMasterKeyID: byDefault["KMSMasterKeyID"]
|
|
5153
5156
|
} : void 0,
|
|
5154
|
-
BucketKeyEnabled: rule["BucketKeyEnabled"]
|
|
5157
|
+
BucketKeyEnabled: rule["BucketKeyEnabled"],
|
|
5158
|
+
BlockedEncryptionTypes: blocked != null && blocked["EncryptionType"] !== void 0 ? { EncryptionType: blocked["EncryptionType"] } : void 0
|
|
5155
5159
|
};
|
|
5156
5160
|
});
|
|
5157
5161
|
await this.s3Client.send(new PutBucketEncryptionCommand({
|
|
@@ -5178,12 +5182,21 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
5178
5182
|
this.logger.debug(`Cleared logging configuration on bucket ${bucketName}`);
|
|
5179
5183
|
return;
|
|
5180
5184
|
}
|
|
5185
|
+
const loggingEnabled = {
|
|
5186
|
+
TargetBucket: destinationBucket,
|
|
5187
|
+
TargetPrefix: readConfigString(loggingConfig, "LogFilePrefix", "", "AWS::S3::Bucket LoggingConfiguration")
|
|
5188
|
+
};
|
|
5189
|
+
const keyFormat = loggingConfig["TargetObjectKeyFormat"];
|
|
5190
|
+
if (keyFormat != null) {
|
|
5191
|
+
const sdkKeyFormat = {};
|
|
5192
|
+
if (keyFormat["SimplePrefix"] !== void 0) sdkKeyFormat.SimplePrefix = {};
|
|
5193
|
+
const partitioned = keyFormat["PartitionedPrefix"];
|
|
5194
|
+
if (partitioned != null && partitioned["PartitionDateSource"] !== void 0) sdkKeyFormat.PartitionedPrefix = { PartitionDateSource: partitioned["PartitionDateSource"] };
|
|
5195
|
+
if (Object.keys(sdkKeyFormat).length > 0) loggingEnabled.TargetObjectKeyFormat = sdkKeyFormat;
|
|
5196
|
+
}
|
|
5181
5197
|
await this.s3Client.send(new PutBucketLoggingCommand({
|
|
5182
5198
|
Bucket: bucketName,
|
|
5183
|
-
BucketLoggingStatus: { LoggingEnabled:
|
|
5184
|
-
TargetBucket: destinationBucket,
|
|
5185
|
-
TargetPrefix: readConfigString(loggingConfig, "LogFilePrefix", "", "AWS::S3::Bucket LoggingConfiguration")
|
|
5186
|
-
} }
|
|
5199
|
+
BucketLoggingStatus: { LoggingEnabled: loggingEnabled }
|
|
5187
5200
|
}));
|
|
5188
5201
|
this.logger.debug(`Applied logging configuration to bucket ${bucketName}`);
|
|
5189
5202
|
}
|
|
@@ -5454,6 +5467,54 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
5454
5467
|
* - Rules[] (replication rules)
|
|
5455
5468
|
* SDK: PutBucketReplication with ReplicationConfiguration
|
|
5456
5469
|
*/
|
|
5470
|
+
/**
|
|
5471
|
+
* Build the SDK `Destination` for one replication rule.
|
|
5472
|
+
*
|
|
5473
|
+
* Before issue #1495 this was an inline literal carrying `Bucket` / `Account`
|
|
5474
|
+
* / `StorageClass` only, so FOUR whole sub-blocks the CFn schema declares
|
|
5475
|
+
* were accepted from the template and never sent — each one silently:
|
|
5476
|
+
*
|
|
5477
|
+
* - `AccessControlTranslation` — cross-account replication with owner
|
|
5478
|
+
* override; without it the replicas keep the SOURCE account's ownership.
|
|
5479
|
+
* - `EncryptionConfiguration.ReplicaKmsKeyID` — the replica-side SSE-KMS key;
|
|
5480
|
+
* dropped, the replicas are not encrypted with the declared key. CDK's
|
|
5481
|
+
* `aws-s3` L2 emits this for a `replicationRules` entry with a KMS key.
|
|
5482
|
+
* - `ReplicationTime` + `Metrics` — S3 Replication Time Control. RTC is a
|
|
5483
|
+
* billed SLA feature and both blocks are required to enable it, so a
|
|
5484
|
+
* template asking for RTC got plain asynchronous replication.
|
|
5485
|
+
*
|
|
5486
|
+
* CFn and the SDK spell every member identically here (verified against
|
|
5487
|
+
* `@aws-sdk/client-s3`'s `Destination`), but the block is assembled member by
|
|
5488
|
+
* member rather than forwarded so a CFn-only member cannot ride through.
|
|
5489
|
+
*/
|
|
5490
|
+
buildReplicationDestination(dest) {
|
|
5491
|
+
const sdkDest = {
|
|
5492
|
+
Bucket: dest["Bucket"],
|
|
5493
|
+
Account: dest["Account"],
|
|
5494
|
+
StorageClass: dest["StorageClass"]
|
|
5495
|
+
};
|
|
5496
|
+
const acl = dest["AccessControlTranslation"];
|
|
5497
|
+
if (acl != null && acl["Owner"] !== void 0) sdkDest["AccessControlTranslation"] = { Owner: acl["Owner"] };
|
|
5498
|
+
const encryption = dest["EncryptionConfiguration"];
|
|
5499
|
+
if (encryption != null && encryption["ReplicaKmsKeyID"] !== void 0) sdkDest["EncryptionConfiguration"] = { ReplicaKmsKeyID: encryption["ReplicaKmsKeyID"] };
|
|
5500
|
+
const replicationTime = dest["ReplicationTime"];
|
|
5501
|
+
if (replicationTime != null) {
|
|
5502
|
+
const time = replicationTime["Time"];
|
|
5503
|
+
const rt = {};
|
|
5504
|
+
if (replicationTime["Status"] !== void 0) rt["Status"] = replicationTime["Status"];
|
|
5505
|
+
if (time != null && time["Minutes"] !== void 0) rt["Time"] = { Minutes: time["Minutes"] };
|
|
5506
|
+
if (Object.keys(rt).length > 0) sdkDest["ReplicationTime"] = rt;
|
|
5507
|
+
}
|
|
5508
|
+
const metrics = dest["Metrics"];
|
|
5509
|
+
if (metrics != null) {
|
|
5510
|
+
const threshold = metrics["EventThreshold"];
|
|
5511
|
+
const m = {};
|
|
5512
|
+
if (metrics["Status"] !== void 0) m["Status"] = metrics["Status"];
|
|
5513
|
+
if (threshold != null && threshold["Minutes"] !== void 0) m["EventThreshold"] = { Minutes: threshold["Minutes"] };
|
|
5514
|
+
if (Object.keys(m).length > 0) sdkDest["Metrics"] = m;
|
|
5515
|
+
}
|
|
5516
|
+
return sdkDest;
|
|
5517
|
+
}
|
|
5457
5518
|
async applyReplicationConfiguration(bucketName, replConfig) {
|
|
5458
5519
|
const rules = replConfig["Rules"];
|
|
5459
5520
|
await this.s3Client.send(new PutBucketReplicationCommand({
|
|
@@ -5466,12 +5527,17 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
5466
5527
|
ID: rule["Id"],
|
|
5467
5528
|
Status: readConfigString(rule, "Status", "Enabled", "AWS::S3::Bucket ReplicationConfiguration.Rules[]"),
|
|
5468
5529
|
Priority: rule["Priority"],
|
|
5469
|
-
Destination:
|
|
5470
|
-
Bucket: dest["Bucket"],
|
|
5471
|
-
Account: dest["Account"],
|
|
5472
|
-
StorageClass: dest["StorageClass"]
|
|
5473
|
-
}
|
|
5530
|
+
Destination: this.buildReplicationDestination(dest)
|
|
5474
5531
|
};
|
|
5532
|
+
const criteria = rule["SourceSelectionCriteria"];
|
|
5533
|
+
if (criteria != null) {
|
|
5534
|
+
const sdkCriteria = {};
|
|
5535
|
+
const replicaMods = criteria["ReplicaModifications"];
|
|
5536
|
+
if (replicaMods != null && replicaMods["Status"] !== void 0) sdkCriteria["ReplicaModifications"] = { Status: replicaMods["Status"] };
|
|
5537
|
+
const sseKms = criteria["SseKmsEncryptedObjects"];
|
|
5538
|
+
if (sseKms != null && sseKms["Status"] !== void 0) sdkCriteria["SseKmsEncryptedObjects"] = { Status: sseKms["Status"] };
|
|
5539
|
+
if (Object.keys(sdkCriteria).length > 0) sdkRule["SourceSelectionCriteria"] = sdkCriteria;
|
|
5540
|
+
}
|
|
5475
5541
|
const filter = rule["Filter"];
|
|
5476
5542
|
if (filter) {
|
|
5477
5543
|
const and = filter["And"];
|
|
@@ -5987,6 +6053,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
5987
6053
|
out["ServerSideEncryptionByDefault"] = sseOut;
|
|
5988
6054
|
}
|
|
5989
6055
|
if (rule.BucketKeyEnabled !== void 0) out["BucketKeyEnabled"] = rule.BucketKeyEnabled;
|
|
6056
|
+
if (rule.BlockedEncryptionTypes?.EncryptionType !== void 0) out["BlockedEncryptionTypes"] = { EncryptionType: rule.BlockedEncryptionTypes.EncryptionType };
|
|
5990
6057
|
return out;
|
|
5991
6058
|
}) };
|
|
5992
6059
|
} catch (err) {
|
|
@@ -6023,59 +6090,66 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
6023
6090
|
}
|
|
6024
6091
|
async readLifecycle(bucket) {
|
|
6025
6092
|
try {
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
if (r.
|
|
6035
|
-
if (r.
|
|
6036
|
-
out["
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
return item;
|
|
6044
|
-
});
|
|
6045
|
-
if (r.NoncurrentVersionExpiration) {
|
|
6046
|
-
const nve = {};
|
|
6047
|
-
if (r.NoncurrentVersionExpiration.NoncurrentDays !== void 0) nve["NoncurrentDays"] = r.NoncurrentVersionExpiration.NoncurrentDays;
|
|
6048
|
-
if (r.NoncurrentVersionExpiration.NewerNoncurrentVersions !== void 0) nve["NewerNoncurrentVersions"] = r.NoncurrentVersionExpiration.NewerNoncurrentVersions;
|
|
6049
|
-
out["NoncurrentVersionExpiration"] = nve;
|
|
6050
|
-
}
|
|
6051
|
-
if (r.NoncurrentVersionTransitions && r.NoncurrentVersionTransitions.length > 0) out["NoncurrentVersionTransitions"] = r.NoncurrentVersionTransitions.map((nvt) => {
|
|
6052
|
-
const item = {};
|
|
6053
|
-
if (nvt.NoncurrentDays !== void 0) item["TransitionInDays"] = nvt.NoncurrentDays;
|
|
6054
|
-
if (nvt.StorageClass !== void 0) item["StorageClass"] = nvt.StorageClass;
|
|
6055
|
-
if (nvt.NewerNoncurrentVersions !== void 0) item["NewerNoncurrentVersions"] = nvt.NewerNoncurrentVersions;
|
|
6056
|
-
return item;
|
|
6057
|
-
});
|
|
6058
|
-
if (r.AbortIncompleteMultipartUpload) out["AbortIncompleteMultipartUpload"] = { DaysAfterInitiation: r.AbortIncompleteMultipartUpload.DaysAfterInitiation };
|
|
6059
|
-
if (r.Filter) {
|
|
6060
|
-
const f = r.Filter;
|
|
6061
|
-
const cfnFilter = {};
|
|
6062
|
-
const and = f["And"];
|
|
6063
|
-
const tagOnly = f["Tag"];
|
|
6064
|
-
if (and) {
|
|
6065
|
-
if (and["Prefix"] !== void 0) cfnFilter["Prefix"] = and["Prefix"];
|
|
6066
|
-
if (and["Tags"]) cfnFilter["TagFilters"] = and["Tags"];
|
|
6067
|
-
if (and["ObjectSizeGreaterThan"] !== void 0) cfnFilter["ObjectSizeGreaterThan"] = and["ObjectSizeGreaterThan"];
|
|
6068
|
-
if (and["ObjectSizeLessThan"] !== void 0) cfnFilter["ObjectSizeLessThan"] = and["ObjectSizeLessThan"];
|
|
6069
|
-
} else if (tagOnly) cfnFilter["TagFilters"] = [tagOnly];
|
|
6070
|
-
else {
|
|
6071
|
-
if (f["Prefix"] !== void 0) cfnFilter["Prefix"] = f["Prefix"];
|
|
6072
|
-
if (f["ObjectSizeGreaterThan"] !== void 0) cfnFilter["ObjectSizeGreaterThan"] = f["ObjectSizeGreaterThan"];
|
|
6073
|
-
if (f["ObjectSizeLessThan"] !== void 0) cfnFilter["ObjectSizeLessThan"] = f["ObjectSizeLessThan"];
|
|
6093
|
+
const resp = await this.s3Client.send(new GetBucketLifecycleConfigurationCommand({ Bucket: bucket }));
|
|
6094
|
+
const rules = resp.Rules ?? [];
|
|
6095
|
+
const lifecycleOut = {};
|
|
6096
|
+
if (resp.TransitionDefaultMinimumObjectSize !== void 0) lifecycleOut["TransitionDefaultMinimumObjectSize"] = resp.TransitionDefaultMinimumObjectSize;
|
|
6097
|
+
return {
|
|
6098
|
+
...lifecycleOut,
|
|
6099
|
+
Rules: rules.map((r) => {
|
|
6100
|
+
const out = {};
|
|
6101
|
+
if (r.ID !== void 0) out["Id"] = r.ID;
|
|
6102
|
+
if (r.Status !== void 0) out["Status"] = r.Status;
|
|
6103
|
+
if (r.Prefix !== void 0) out["Prefix"] = r.Prefix;
|
|
6104
|
+
if (r.Expiration) {
|
|
6105
|
+
const exp = {};
|
|
6106
|
+
if (r.Expiration.Days !== void 0) exp["Days"] = r.Expiration.Days;
|
|
6107
|
+
if (r.Expiration.Date !== void 0) exp["Date"] = r.Expiration.Date.toISOString();
|
|
6108
|
+
if (r.Expiration.ExpiredObjectDeleteMarker !== void 0) exp["ExpiredObjectDeleteMarker"] = r.Expiration.ExpiredObjectDeleteMarker;
|
|
6109
|
+
out["Expiration"] = exp;
|
|
6074
6110
|
}
|
|
6075
|
-
if (
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6111
|
+
if (r.Transitions && r.Transitions.length > 0) out["Transitions"] = r.Transitions.map((t) => {
|
|
6112
|
+
const item = {};
|
|
6113
|
+
if (t.Days !== void 0) item["TransitionInDays"] = t.Days;
|
|
6114
|
+
if (t.Date !== void 0) item["TransitionDate"] = t.Date.toISOString();
|
|
6115
|
+
if (t.StorageClass !== void 0) item["StorageClass"] = t.StorageClass;
|
|
6116
|
+
return item;
|
|
6117
|
+
});
|
|
6118
|
+
if (r.NoncurrentVersionExpiration) {
|
|
6119
|
+
const nve = {};
|
|
6120
|
+
if (r.NoncurrentVersionExpiration.NoncurrentDays !== void 0) nve["NoncurrentDays"] = r.NoncurrentVersionExpiration.NoncurrentDays;
|
|
6121
|
+
if (r.NoncurrentVersionExpiration.NewerNoncurrentVersions !== void 0) nve["NewerNoncurrentVersions"] = r.NoncurrentVersionExpiration.NewerNoncurrentVersions;
|
|
6122
|
+
out["NoncurrentVersionExpiration"] = nve;
|
|
6123
|
+
}
|
|
6124
|
+
if (r.NoncurrentVersionTransitions && r.NoncurrentVersionTransitions.length > 0) out["NoncurrentVersionTransitions"] = r.NoncurrentVersionTransitions.map((nvt) => {
|
|
6125
|
+
const item = {};
|
|
6126
|
+
if (nvt.NoncurrentDays !== void 0) item["TransitionInDays"] = nvt.NoncurrentDays;
|
|
6127
|
+
if (nvt.StorageClass !== void 0) item["StorageClass"] = nvt.StorageClass;
|
|
6128
|
+
if (nvt.NewerNoncurrentVersions !== void 0) item["NewerNoncurrentVersions"] = nvt.NewerNoncurrentVersions;
|
|
6129
|
+
return item;
|
|
6130
|
+
});
|
|
6131
|
+
if (r.AbortIncompleteMultipartUpload) out["AbortIncompleteMultipartUpload"] = { DaysAfterInitiation: r.AbortIncompleteMultipartUpload.DaysAfterInitiation };
|
|
6132
|
+
if (r.Filter) {
|
|
6133
|
+
const f = r.Filter;
|
|
6134
|
+
const cfnFilter = {};
|
|
6135
|
+
const and = f["And"];
|
|
6136
|
+
const tagOnly = f["Tag"];
|
|
6137
|
+
if (and) {
|
|
6138
|
+
if (and["Prefix"] !== void 0) cfnFilter["Prefix"] = and["Prefix"];
|
|
6139
|
+
if (and["Tags"]) cfnFilter["TagFilters"] = and["Tags"];
|
|
6140
|
+
if (and["ObjectSizeGreaterThan"] !== void 0) cfnFilter["ObjectSizeGreaterThan"] = and["ObjectSizeGreaterThan"];
|
|
6141
|
+
if (and["ObjectSizeLessThan"] !== void 0) cfnFilter["ObjectSizeLessThan"] = and["ObjectSizeLessThan"];
|
|
6142
|
+
} else if (tagOnly) cfnFilter["TagFilters"] = [tagOnly];
|
|
6143
|
+
else {
|
|
6144
|
+
if (f["Prefix"] !== void 0) cfnFilter["Prefix"] = f["Prefix"];
|
|
6145
|
+
if (f["ObjectSizeGreaterThan"] !== void 0) cfnFilter["ObjectSizeGreaterThan"] = f["ObjectSizeGreaterThan"];
|
|
6146
|
+
if (f["ObjectSizeLessThan"] !== void 0) cfnFilter["ObjectSizeLessThan"] = f["ObjectSizeLessThan"];
|
|
6147
|
+
}
|
|
6148
|
+
if (Object.keys(cfnFilter).length > 0) out["Filter"] = cfnFilter;
|
|
6149
|
+
}
|
|
6150
|
+
return out;
|
|
6151
|
+
})
|
|
6152
|
+
};
|
|
6079
6153
|
} catch (err) {
|
|
6080
6154
|
if (err.name === "NoSuchLifecycleConfiguration") return { Rules: [] };
|
|
6081
6155
|
throw err;
|
|
@@ -6141,6 +6215,17 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
6141
6215
|
const out = {};
|
|
6142
6216
|
if (resp.LoggingEnabled.TargetBucket !== void 0) out["DestinationBucketName"] = resp.LoggingEnabled.TargetBucket;
|
|
6143
6217
|
if (resp.LoggingEnabled.TargetPrefix !== void 0) out["LogFilePrefix"] = resp.LoggingEnabled.TargetPrefix;
|
|
6218
|
+
const keyFormat = resp.LoggingEnabled.TargetObjectKeyFormat;
|
|
6219
|
+
if (keyFormat) {
|
|
6220
|
+
const cfnKeyFormat = {};
|
|
6221
|
+
if (keyFormat.SimplePrefix !== void 0) cfnKeyFormat["SimplePrefix"] = {};
|
|
6222
|
+
if (keyFormat.PartitionedPrefix) {
|
|
6223
|
+
const partitioned = {};
|
|
6224
|
+
if (keyFormat.PartitionedPrefix.PartitionDateSource !== void 0) partitioned["PartitionDateSource"] = keyFormat.PartitionedPrefix.PartitionDateSource;
|
|
6225
|
+
cfnKeyFormat["PartitionedPrefix"] = partitioned;
|
|
6226
|
+
}
|
|
6227
|
+
if (Object.keys(cfnKeyFormat).length > 0) out["TargetObjectKeyFormat"] = cfnKeyFormat;
|
|
6228
|
+
}
|
|
6144
6229
|
return out;
|
|
6145
6230
|
}
|
|
6146
6231
|
async readNotification(bucket) {
|
|
@@ -6201,8 +6286,34 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
6201
6286
|
if (r.Destination.Bucket !== void 0) d["Bucket"] = r.Destination.Bucket;
|
|
6202
6287
|
if (r.Destination.Account !== void 0) d["Account"] = r.Destination.Account;
|
|
6203
6288
|
if (r.Destination.StorageClass !== void 0) d["StorageClass"] = r.Destination.StorageClass;
|
|
6289
|
+
const acl = r.Destination.AccessControlTranslation;
|
|
6290
|
+
if (acl?.Owner !== void 0) d["AccessControlTranslation"] = { Owner: acl.Owner };
|
|
6291
|
+
const enc = r.Destination.EncryptionConfiguration;
|
|
6292
|
+
if (enc?.ReplicaKmsKeyID !== void 0) d["EncryptionConfiguration"] = { ReplicaKmsKeyID: enc.ReplicaKmsKeyID };
|
|
6293
|
+
const rtIn = r.Destination.ReplicationTime;
|
|
6294
|
+
if (rtIn) {
|
|
6295
|
+
const rt = {};
|
|
6296
|
+
if (rtIn.Status !== void 0) rt["Status"] = rtIn.Status;
|
|
6297
|
+
if (rtIn.Time?.Minutes !== void 0) rt["Time"] = { Minutes: rtIn.Time.Minutes };
|
|
6298
|
+
if (Object.keys(rt).length > 0) d["ReplicationTime"] = rt;
|
|
6299
|
+
}
|
|
6300
|
+
const metricsIn = r.Destination.Metrics;
|
|
6301
|
+
if (metricsIn) {
|
|
6302
|
+
const m = {};
|
|
6303
|
+
if (metricsIn.Status !== void 0) m["Status"] = metricsIn.Status;
|
|
6304
|
+
if (metricsIn.EventThreshold?.Minutes !== void 0) m["EventThreshold"] = { Minutes: metricsIn.EventThreshold.Minutes };
|
|
6305
|
+
if (Object.keys(m).length > 0) d["Metrics"] = m;
|
|
6306
|
+
}
|
|
6204
6307
|
ruleOut["Destination"] = d;
|
|
6205
6308
|
}
|
|
6309
|
+
if (r.SourceSelectionCriteria) {
|
|
6310
|
+
const criteria = {};
|
|
6311
|
+
const replicaMods = r.SourceSelectionCriteria.ReplicaModifications;
|
|
6312
|
+
if (replicaMods?.Status !== void 0) criteria["ReplicaModifications"] = { Status: replicaMods.Status };
|
|
6313
|
+
const sseKms = r.SourceSelectionCriteria.SseKmsEncryptedObjects;
|
|
6314
|
+
if (sseKms?.Status !== void 0) criteria["SseKmsEncryptedObjects"] = { Status: sseKms.Status };
|
|
6315
|
+
if (Object.keys(criteria).length > 0) ruleOut["SourceSelectionCriteria"] = criteria;
|
|
6316
|
+
}
|
|
6206
6317
|
if (r.Filter) {
|
|
6207
6318
|
const f = r.Filter;
|
|
6208
6319
|
const cfnFilter = {};
|
|
@@ -6218,7 +6329,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
6218
6329
|
else if (f["Prefix"] !== void 0) cfnFilter["Prefix"] = f["Prefix"];
|
|
6219
6330
|
if (Object.keys(cfnFilter).length > 0) ruleOut["Filter"] = cfnFilter;
|
|
6220
6331
|
}
|
|
6221
|
-
if (r.DeleteMarkerReplication) ruleOut["DeleteMarkerReplication"] = { Status: r.DeleteMarkerReplication.Status };
|
|
6332
|
+
if (r.DeleteMarkerReplication?.Status !== void 0) ruleOut["DeleteMarkerReplication"] = { Status: r.DeleteMarkerReplication.Status };
|
|
6222
6333
|
return ruleOut;
|
|
6223
6334
|
});
|
|
6224
6335
|
return out;
|
|
@@ -10682,7 +10793,10 @@ var LambdaEventInvokeConfigProvider = class {
|
|
|
10682
10793
|
}
|
|
10683
10794
|
buildPutInput(properties) {
|
|
10684
10795
|
const functionName = properties["FunctionName"];
|
|
10685
|
-
const qualifier = properties["Qualifier"]
|
|
10796
|
+
const qualifier = requireConfigString(properties["Qualifier"], "$LATEST", "AWS::Lambda::EventInvokeConfig Qualifier", {
|
|
10797
|
+
coerceNumber: true,
|
|
10798
|
+
onUnusable: (message) => this.logger.warn(message)
|
|
10799
|
+
});
|
|
10686
10800
|
const input = { FunctionName: functionName };
|
|
10687
10801
|
if (qualifier !== "$LATEST") input.Qualifier = qualifier;
|
|
10688
10802
|
if (properties["MaximumEventAgeInSeconds"] !== void 0) input.MaximumEventAgeInSeconds = Number(properties["MaximumEventAgeInSeconds"]);
|
|
@@ -10691,11 +10805,14 @@ var LambdaEventInvokeConfigProvider = class {
|
|
|
10691
10805
|
if (dest) input.DestinationConfig = dest;
|
|
10692
10806
|
return input;
|
|
10693
10807
|
}
|
|
10694
|
-
async create(logicalId, resourceType, properties) {
|
|
10808
|
+
async create(logicalId, resourceType, properties, context) {
|
|
10695
10809
|
this.logger.debug(`Creating Lambda EventInvokeConfig ${logicalId}`);
|
|
10696
10810
|
const functionName = properties["FunctionName"];
|
|
10697
10811
|
if (!functionName) throw new ProvisioningError(`FunctionName is required for Lambda EventInvokeConfig ${logicalId}`, resourceType, logicalId);
|
|
10698
|
-
const qualifier = properties["Qualifier"]
|
|
10812
|
+
const qualifier = requireConfigString(properties["Qualifier"], "$LATEST", "AWS::Lambda::EventInvokeConfig Qualifier", {
|
|
10813
|
+
coerceNumber: true,
|
|
10814
|
+
...replayWarn(this.logger, context)
|
|
10815
|
+
});
|
|
10699
10816
|
try {
|
|
10700
10817
|
await this.lambdaClient.send(new PutFunctionEventInvokeConfigCommand(this.buildPutInput(properties)));
|
|
10701
10818
|
const physicalId = this.buildPhysicalId(functionName, qualifier);
|
|
@@ -17131,20 +17248,20 @@ var EC2Provider = class {
|
|
|
17131
17248
|
const awsClients = getAwsClients();
|
|
17132
17249
|
this.ec2Client = awsClients.ec2;
|
|
17133
17250
|
}
|
|
17134
|
-
async create(logicalId, resourceType, properties) {
|
|
17251
|
+
async create(logicalId, resourceType, properties, context) {
|
|
17135
17252
|
switch (resourceType) {
|
|
17136
17253
|
case "AWS::EC2::VPC": return this.createVpc(logicalId, resourceType, properties);
|
|
17137
17254
|
case "AWS::EC2::Subnet": return this.createSubnet(logicalId, resourceType, properties);
|
|
17138
17255
|
case "AWS::EC2::InternetGateway": return this.createInternetGateway(logicalId, resourceType, properties);
|
|
17139
|
-
case "AWS::EC2::EIP": return this.createEip(logicalId, resourceType, properties);
|
|
17256
|
+
case "AWS::EC2::EIP": return this.createEip(logicalId, resourceType, properties, context);
|
|
17140
17257
|
case "AWS::EC2::VPCGatewayAttachment": return this.createVpcGatewayAttachment(logicalId, resourceType, properties);
|
|
17141
17258
|
case "AWS::EC2::NatGateway": return this.createNatGateway(logicalId, resourceType, properties);
|
|
17142
17259
|
case "AWS::EC2::RouteTable": return this.createRouteTable(logicalId, resourceType, properties);
|
|
17143
17260
|
case "AWS::EC2::Route": return this.createRoute(logicalId, resourceType, properties);
|
|
17144
17261
|
case "AWS::EC2::SubnetRouteTableAssociation": return this.createSubnetRouteTableAssociation(logicalId, resourceType, properties);
|
|
17145
17262
|
case "AWS::EC2::SecurityGroup": return this.createSecurityGroup(logicalId, resourceType, properties);
|
|
17146
|
-
case "AWS::EC2::SecurityGroupIngress": return this.createSecurityGroupIngress(logicalId, resourceType, properties);
|
|
17147
|
-
case "AWS::EC2::Instance": return this.createInstance(logicalId, resourceType, properties);
|
|
17263
|
+
case "AWS::EC2::SecurityGroupIngress": return this.createSecurityGroupIngress(logicalId, resourceType, properties, context?.replayingState === true ? (message) => this.logger.warn(message) : void 0);
|
|
17264
|
+
case "AWS::EC2::Instance": return this.createInstance(logicalId, resourceType, properties, context);
|
|
17148
17265
|
case "AWS::EC2::NetworkAcl": return this.createNetworkAcl(logicalId, resourceType, properties);
|
|
17149
17266
|
case "AWS::EC2::NetworkAclEntry": return this.createNetworkAclEntry(logicalId, resourceType, properties);
|
|
17150
17267
|
case "AWS::EC2::SubnetNetworkAclAssociation": return this.createSubnetNetworkAclAssociation(logicalId, resourceType, properties);
|
|
@@ -17592,11 +17709,11 @@ var EC2Provider = class {
|
|
|
17592
17709
|
if (physicalId.startsWith("eipalloc-")) return { allocationId: physicalId };
|
|
17593
17710
|
return { publicIp: physicalId };
|
|
17594
17711
|
}
|
|
17595
|
-
async createEip(logicalId, resourceType, properties) {
|
|
17712
|
+
async createEip(logicalId, resourceType, properties, context) {
|
|
17596
17713
|
this.logger.debug(`Creating EIP ${logicalId}`);
|
|
17597
17714
|
try {
|
|
17598
17715
|
const response = await this.ec2Client.send(new AllocateAddressCommand({
|
|
17599
|
-
Domain: properties["Domain"]
|
|
17716
|
+
Domain: requireConfigString(properties["Domain"], "vpc", "AWS::EC2::EIP Domain", replayWarn(this.logger, context)),
|
|
17600
17717
|
NetworkBorderGroup: properties["NetworkBorderGroup"],
|
|
17601
17718
|
PublicIpv4Pool: properties["PublicIpv4Pool"]
|
|
17602
17719
|
}));
|
|
@@ -18144,17 +18261,32 @@ var EC2Provider = class {
|
|
|
18144
18261
|
return;
|
|
18145
18262
|
}
|
|
18146
18263
|
}
|
|
18147
|
-
|
|
18264
|
+
/**
|
|
18265
|
+
* @param onUnusableProtocol When supplied, a malformed `IpProtocol` WARNS and
|
|
18266
|
+
* defaults instead of throwing. Passed by `updateSecurityGroupIngress`,
|
|
18267
|
+
* which reaches this method as the re-create half of a delete-then-create
|
|
18268
|
+
* replacement: by then `RevokeSecurityGroupIngress` has already committed,
|
|
18269
|
+
* so a refusal would leave the rule deleted from AWS with the op failed —
|
|
18270
|
+
* and on a rollback replay the value comes from a STATE record, which no
|
|
18271
|
+
* template edit can fix. Absent (the plain CREATE dispatch) it throws.
|
|
18272
|
+
*/
|
|
18273
|
+
async createSecurityGroupIngress(logicalId, resourceType, properties, onUnusableProtocol) {
|
|
18148
18274
|
this.logger.debug(`Creating SecurityGroupIngress ${logicalId}`);
|
|
18149
18275
|
const groupId = properties["GroupId"];
|
|
18150
18276
|
if (!groupId) throw new ProvisioningError(`GroupId is required for SecurityGroupIngress ${logicalId}`, resourceType, logicalId);
|
|
18151
|
-
const ipProtocol = properties["IpProtocol"]
|
|
18277
|
+
const ipProtocol = requireConfigString(properties["IpProtocol"], "-1", "AWS::EC2::SecurityGroupIngress IpProtocol", {
|
|
18278
|
+
coerceNumber: true,
|
|
18279
|
+
...onUnusableProtocol && { onUnusable: onUnusableProtocol }
|
|
18280
|
+
});
|
|
18152
18281
|
const fromPort = properties["FromPort"];
|
|
18153
18282
|
const toPort = properties["ToPort"];
|
|
18154
18283
|
try {
|
|
18155
18284
|
await this.ec2Client.send(new AuthorizeSecurityGroupIngressCommand({
|
|
18156
18285
|
GroupId: groupId,
|
|
18157
|
-
IpPermissions: [
|
|
18286
|
+
IpPermissions: [{
|
|
18287
|
+
...this.buildIpPermission(properties),
|
|
18288
|
+
IpProtocol: ipProtocol
|
|
18289
|
+
}]
|
|
18158
18290
|
}));
|
|
18159
18291
|
const physicalId = `${groupId}|${ipProtocol}|${fromPort ?? "-1"}|${toPort ?? "-1"}`;
|
|
18160
18292
|
this.logger.debug(`Successfully created SecurityGroupIngress ${logicalId}: ${physicalId}`);
|
|
@@ -18183,7 +18315,7 @@ var EC2Provider = class {
|
|
|
18183
18315
|
};
|
|
18184
18316
|
try {
|
|
18185
18317
|
await this.deleteSecurityGroupIngress(logicalId, physicalId, resourceType, previousProperties);
|
|
18186
|
-
const createResult = await this.createSecurityGroupIngress(logicalId, resourceType, properties);
|
|
18318
|
+
const createResult = await this.createSecurityGroupIngress(logicalId, resourceType, properties, (message) => this.logger.warn(message));
|
|
18187
18319
|
return {
|
|
18188
18320
|
physicalId: createResult.physicalId,
|
|
18189
18321
|
wasReplaced: true,
|
|
@@ -18221,11 +18353,11 @@ var EC2Provider = class {
|
|
|
18221
18353
|
throw new ProvisioningError(`Failed to delete SecurityGroupIngress ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
18222
18354
|
}
|
|
18223
18355
|
}
|
|
18224
|
-
async createInstance(logicalId, resourceType, properties) {
|
|
18356
|
+
async createInstance(logicalId, resourceType, properties, context) {
|
|
18225
18357
|
this.logger.debug(`Creating EC2 Instance ${logicalId}`);
|
|
18226
18358
|
const imageId = properties["ImageId"];
|
|
18227
18359
|
if (!imageId) throw new ProvisioningError(`ImageId is required for EC2 Instance ${logicalId}`, resourceType, logicalId);
|
|
18228
|
-
const instanceType = properties["InstanceType"]
|
|
18360
|
+
const instanceType = requireConfigString(properties["InstanceType"], "t3.micro", "AWS::EC2::Instance InstanceType", replayWarn(this.logger, context));
|
|
18229
18361
|
try {
|
|
18230
18362
|
const securityGroupIds = properties["SecurityGroupIds"];
|
|
18231
18363
|
const securityGroups = properties["SecurityGroups"];
|
|
@@ -19878,14 +20010,14 @@ var ApiGatewayProvider = class ApiGatewayProvider {
|
|
|
19878
20010
|
/**
|
|
19879
20011
|
* Create a resource
|
|
19880
20012
|
*/
|
|
19881
|
-
async create(logicalId, resourceType, properties) {
|
|
20013
|
+
async create(logicalId, resourceType, properties, context) {
|
|
19882
20014
|
switch (resourceType) {
|
|
19883
20015
|
case "AWS::ApiGateway::Account": return this.createAccount(logicalId, resourceType, properties);
|
|
19884
20016
|
case "AWS::ApiGateway::Authorizer": return this.createAuthorizer(logicalId, resourceType, properties);
|
|
19885
20017
|
case "AWS::ApiGateway::Resource": return this.createResource(logicalId, resourceType, properties);
|
|
19886
20018
|
case "AWS::ApiGateway::Deployment": return this.createDeployment(logicalId, resourceType, properties);
|
|
19887
20019
|
case "AWS::ApiGateway::Stage": return this.createStage(logicalId, resourceType, properties);
|
|
19888
|
-
case "AWS::ApiGateway::Method": return this.createMethod(logicalId, resourceType, properties);
|
|
20020
|
+
case "AWS::ApiGateway::Method": return this.createMethod(logicalId, resourceType, properties, context);
|
|
19889
20021
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId);
|
|
19890
20022
|
}
|
|
19891
20023
|
}
|
|
@@ -20513,12 +20645,12 @@ var ApiGatewayProvider = class ApiGatewayProvider {
|
|
|
20513
20645
|
* fixed in PR #373; this cleanup makes any future shape of
|
|
20514
20646
|
* post-`PutMethod` failure self-healing on the next redeploy.
|
|
20515
20647
|
*/
|
|
20516
|
-
async createMethod(logicalId, resourceType, properties) {
|
|
20648
|
+
async createMethod(logicalId, resourceType, properties, context) {
|
|
20517
20649
|
this.logger.debug(`Creating API Gateway Method ${logicalId}`);
|
|
20518
20650
|
const restApiId = properties["RestApiId"];
|
|
20519
20651
|
const resourceId = properties["ResourceId"];
|
|
20520
20652
|
const httpMethod = properties["HttpMethod"];
|
|
20521
|
-
const authorizationType = properties["AuthorizationType"]
|
|
20653
|
+
const authorizationType = requireConfigString(properties["AuthorizationType"], "NONE", "AWS::ApiGateway::Method AuthorizationType", replayWarn(this.logger, context));
|
|
20522
20654
|
const authorizerId = properties["AuthorizerId"];
|
|
20523
20655
|
const apiKeyRequired = properties["ApiKeyRequired"];
|
|
20524
20656
|
const operationName = properties["OperationName"];
|
|
@@ -28580,10 +28712,10 @@ var RDSDBProxyTargetGroupProvider = class {
|
|
|
28580
28712
|
if (!this.rdsClient) this.rdsClient = new RDSClient(this.providerRegion ? { region: this.providerRegion } : {});
|
|
28581
28713
|
return this.rdsClient;
|
|
28582
28714
|
}
|
|
28583
|
-
async create(logicalId, resourceType, properties) {
|
|
28715
|
+
async create(logicalId, resourceType, properties, context) {
|
|
28584
28716
|
const dbProxyName = properties["DBProxyName"];
|
|
28585
28717
|
if (!dbProxyName) throw new ProvisioningError(`DBProxyName is required for AWS::RDS::DBProxyTargetGroup ${logicalId}`, resourceType, logicalId);
|
|
28586
|
-
const targetGroupName = properties["TargetGroupName"]
|
|
28718
|
+
const targetGroupName = requireConfigString(properties["TargetGroupName"], "default", "AWS::RDS::DBProxyTargetGroup TargetGroupName", replayWarn(this.logger, context));
|
|
28587
28719
|
const dbClusterIdentifiers = properties["DBClusterIdentifiers"];
|
|
28588
28720
|
const dbInstanceIdentifiers = properties["DBInstanceIdentifiers"];
|
|
28589
28721
|
const connectionPoolConfig = properties["ConnectionPoolConfigurationInfo"];
|
|
@@ -28642,10 +28774,10 @@ var RDSDBProxyTargetGroupProvider = class {
|
|
|
28642
28774
|
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
28643
28775
|
const dbProxyName = properties["DBProxyName"];
|
|
28644
28776
|
if (!dbProxyName) throw new ProvisioningError(`DBProxyName is required for AWS::RDS::DBProxyTargetGroup ${logicalId} update`, resourceType, logicalId, physicalId);
|
|
28645
|
-
const targetGroupName = properties["TargetGroupName"]
|
|
28777
|
+
const targetGroupName = requireConfigString(properties["TargetGroupName"], "default", "AWS::RDS::DBProxyTargetGroup TargetGroupName", { onUnusable: (message) => this.logger.warn(message) });
|
|
28646
28778
|
for (const field of ["DBProxyName", "TargetGroupName"]) {
|
|
28647
28779
|
const oldVal = previousProperties[field];
|
|
28648
|
-
const newVal = properties[field];
|
|
28780
|
+
const newVal = field === "TargetGroupName" ? targetGroupName : properties[field];
|
|
28649
28781
|
const normalize = (v) => field === "TargetGroupName" && (v === void 0 || v === "default") ? "default" : v;
|
|
28650
28782
|
if (JSON.stringify(normalize(oldVal)) !== JSON.stringify(normalize(newVal))) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `${field} is immutable on AWS::RDS::DBProxyTargetGroup — destroy + redeploy to change it`);
|
|
28651
28783
|
}
|
|
@@ -67219,7 +67351,7 @@ function createMigrateCommand() {
|
|
|
67219
67351
|
*/
|
|
67220
67352
|
function buildProgram() {
|
|
67221
67353
|
const program = new Command();
|
|
67222
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.
|
|
67354
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.42");
|
|
67223
67355
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
67224
67356
|
const { profile } = actionCommand.optsWithGlobals();
|
|
67225
67357
|
if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
|