@go-to-k/cdkd 0.280.17 → 0.280.18
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-DQLjoTQ3.js → asg-provider-C6cQkX3h.js} +2 -2
- package/dist/{asg-provider-DQLjoTQ3.js.map → asg-provider-C6cQkX3h.js.map} +1 -1
- package/dist/cli.js +356 -81
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-tCcs8UGn.js → deploy-engine-mvkiu-7h.js} +17 -19
- package/dist/{deploy-engine-tCcs8UGn.js.map → deploy-engine-mvkiu-7h.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as requireConfigString, $t as processStackMessages, A as red, At as runDockerStreaming, B as isTerminationProtectionPropagationError, Bt as resolveSkipPrefix, C as isStatefulRecreateTargetSync, Ct as parseBootstrapMarker, D as cyan, Dn as normalizeAwsError, Dt as formatDockerLoginError, E as bold, Et as buildDockerImage, F as ProviderRegistry, Ft as getDefaultStateBucketName, G as normalizeAwsTagsToCfn, Gt as warnDeprecatedNoPrefixCliFlag, H as cfnRefValueFromPhysicalId, Ht as resolveStateBucketWithDefaultAndSource, I as findActionableSilentDrops, It as getLegacyStateBucketName, J as configStringRefusal, Jt as MIGRATE_TMP_PREFIX, K as resolveExplicitPhysicalId, Kt as CFN_TEMPLATE_BODY_LIMIT, L as CloudControlProvider, Lt as resolveApp, M as IAMRoleProvider, Mt as getDockerImageBySourceHash, N as collectInlinePolicyNamesManagedBySiblings, Nt as Synthesizer, O as gray, On as withErrorHandling, Ot as getDockerCmd, P as clearOnUpdateRemoval, Pt as synthesisStatusMessage, Q as requireConfigObject, Qt as AssemblyReader, R as slowCcOperationTimeoutMs, Rt as resolveAutoAssetStorage, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, Sn as StackTerminationProtectionError, St as getBootstrapMarkerKey, T as formatResourceLine, Tt as validateContainerRepoName, U as refStateLookupFromResource, Ut as resolveUseCdkBootstrapAssets, V as IntrinsicFunctionResolver, Vt as resolveStateBucketWithDefault, W as WAFv2WebACLProvider, Wt as stateBucketExistenceConfirmed, X as replayWarn, Xt as uploadCfnTemplate, Y as readConfigString, Yt as findLargeInlineResources, Z as requireConfigArray, Zt as expectedOwnerParam, _ as createPreDeleteFinalSnapshot, _n as PartialFailureError, _t as loadPublishableAssetManifest, a as DeploymentEventsStore, an as setAwsClients, at as isThrottlingError, b as unsupportedFinalSnapshotError, bn as ResourceUpdateNotSupportedError, bt as BOOTSTRAP_MARKER_PREFIX, c as replayFailedOperations, ct as LockManager, d as IMPLICIT_DELETE_DEPENDENCIES, dn as LocalInvokeBuildError$1, dt as shouldRetainResource, et as applyRoleArnIfSet, f as computeImplicitDeleteEdges, fn as LocalMigrateError, ft as AssetPublisher, g as ccRoutedFinalSnapshotError, gn as NestedStackChildDirectDestroyError, gt as createAssetRedirectResolver, h as buildFinalSnapshotIdentifier, hn as MissingCdkCliError, ht as buildAssetRedirectMap, i as DeploymentEventsReader, in as resetAwsClients, it as isRetryableTransientError, j as yellow, jt as AssetManifestLoader, k as green, kt as runDockerForeground, l as replayRollback, lt as S3StateBackend, m as PRE_DELETE_SNAPSHOT_TYPES, mt as WorkGraph, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as AwsClients, nt as describeTypeWithThrottleRetry, o as planFailedOps, ot as DagBuilder, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as LocalStartServiceError, pt as stringifyValue, q as assertRegionMatch, qt as CFN_TEMPLATE_URL_LIMIT, r as DeployEngine, rn as getAwsClients, rt as withRetry, s as planRollback, sn as CdkdError, st as TemplateParser, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as resolveBucketRegion, tt as DiffCalculator, u as withResourceDeadline, un as DeployCancelledError, ut as rebuildClientForBucketRegion, v as isFinalSnapshotError, vn as ProvisioningError, vt as rewriteTemplateAssetReferences, w as renderStatefulReason, wt as validateAssetBucketName, x as extractDeploymentEventError, xn as StackHasActiveImportsError, xt as ensureAssetStorage, y as refusesFinalSnapshot, yn as ResourceTimeoutError, yt as AssetModeResolver, z as disableInstanceApiTermination, zt as resolveCaptureObservedState } from "./deploy-engine-
|
|
2
|
+
import { $ as requireConfigString, $t as processStackMessages, A as red, At as runDockerStreaming, B as isTerminationProtectionPropagationError, Bt as resolveSkipPrefix, C as isStatefulRecreateTargetSync, Ct as parseBootstrapMarker, D as cyan, Dn as normalizeAwsError, Dt as formatDockerLoginError, E as bold, Et as buildDockerImage, F as ProviderRegistry, Ft as getDefaultStateBucketName, G as normalizeAwsTagsToCfn, Gt as warnDeprecatedNoPrefixCliFlag, H as cfnRefValueFromPhysicalId, Ht as resolveStateBucketWithDefaultAndSource, I as findActionableSilentDrops, It as getLegacyStateBucketName, J as configStringRefusal, Jt as MIGRATE_TMP_PREFIX, K as resolveExplicitPhysicalId, Kt as CFN_TEMPLATE_BODY_LIMIT, L as CloudControlProvider, Lt as resolveApp, M as IAMRoleProvider, Mt as getDockerImageBySourceHash, N as collectInlinePolicyNamesManagedBySiblings, Nt as Synthesizer, O as gray, On as withErrorHandling, Ot as getDockerCmd, P as clearOnUpdateRemoval, Pt as synthesisStatusMessage, Q as requireConfigObject, Qt as AssemblyReader, R as slowCcOperationTimeoutMs, Rt as resolveAutoAssetStorage, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, Sn as StackTerminationProtectionError, St as getBootstrapMarkerKey, T as formatResourceLine, Tt as validateContainerRepoName, U as refStateLookupFromResource, Ut as resolveUseCdkBootstrapAssets, V as IntrinsicFunctionResolver, Vt as resolveStateBucketWithDefault, W as WAFv2WebACLProvider, Wt as stateBucketExistenceConfirmed, X as replayWarn, Xt as uploadCfnTemplate, Y as readConfigString, Yt as findLargeInlineResources, Z as requireConfigArray, Zt as expectedOwnerParam, _ as createPreDeleteFinalSnapshot, _n as PartialFailureError, _t as loadPublishableAssetManifest, a as DeploymentEventsStore, an as setAwsClients, at as isThrottlingError, b as unsupportedFinalSnapshotError, bn as ResourceUpdateNotSupportedError, bt as BOOTSTRAP_MARKER_PREFIX, c as replayFailedOperations, ct as LockManager, d as IMPLICIT_DELETE_DEPENDENCIES, dn as LocalInvokeBuildError$1, dt as shouldRetainResource, et as applyRoleArnIfSet, f as computeImplicitDeleteEdges, fn as LocalMigrateError, ft as AssetPublisher, g as ccRoutedFinalSnapshotError, gn as NestedStackChildDirectDestroyError, gt as createAssetRedirectResolver, h as buildFinalSnapshotIdentifier, hn as MissingCdkCliError, ht as buildAssetRedirectMap, i as DeploymentEventsReader, in as resetAwsClients, it as isRetryableTransientError, j as yellow, jt as AssetManifestLoader, k as green, kt as runDockerForeground, l as replayRollback, lt as S3StateBackend, m as PRE_DELETE_SNAPSHOT_TYPES, mt as WorkGraph, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as AwsClients, nt as describeTypeWithThrottleRetry, o as planFailedOps, ot as DagBuilder, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as LocalStartServiceError, pt as stringifyValue, q as assertRegionMatch, qt as CFN_TEMPLATE_URL_LIMIT, r as DeployEngine, rn as getAwsClients, rt as withRetry, s as planRollback, sn as CdkdError, st as TemplateParser, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as resolveBucketRegion, tt as DiffCalculator, u as withResourceDeadline, un as DeployCancelledError, ut as rebuildClientForBucketRegion, v as isFinalSnapshotError, vn as ProvisioningError, vt as rewriteTemplateAssetReferences, w as renderStatefulReason, wt as validateAssetBucketName, x as extractDeploymentEventError, xn as StackHasActiveImportsError, xt as ensureAssetStorage, y as refusesFinalSnapshot, yn as ResourceTimeoutError, yt as AssetModeResolver, z as disableInstanceApiTermination, zt as resolveCaptureObservedState } from "./deploy-engine-mvkiu-7h.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-C6cQkX3h.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";
|
|
@@ -34664,6 +34664,7 @@ const MUTABLE_GRAPHQL_API_CONFIG_PROPERTIES = [
|
|
|
34664
34664
|
*/
|
|
34665
34665
|
var AppSyncProvider = class {
|
|
34666
34666
|
client;
|
|
34667
|
+
s3Client;
|
|
34667
34668
|
providerRegion = process.env["AWS_REGION"];
|
|
34668
34669
|
logger = getLogger().child("AppSyncProvider");
|
|
34669
34670
|
/**
|
|
@@ -34714,7 +34715,12 @@ var AppSyncProvider = class {
|
|
|
34714
34715
|
"ServiceRoleArn",
|
|
34715
34716
|
"DynamoDBConfig",
|
|
34716
34717
|
"LambdaConfig",
|
|
34717
|
-
"HttpConfig"
|
|
34718
|
+
"HttpConfig",
|
|
34719
|
+
"ElasticsearchConfig",
|
|
34720
|
+
"EventBridgeConfig",
|
|
34721
|
+
"MetricsConfig",
|
|
34722
|
+
"OpenSearchServiceConfig",
|
|
34723
|
+
"RelationalDatabaseConfig"
|
|
34718
34724
|
])],
|
|
34719
34725
|
["AWS::AppSync::Resolver", /* @__PURE__ */ new Set([
|
|
34720
34726
|
"ApiId",
|
|
@@ -34726,7 +34732,14 @@ var AppSyncProvider = class {
|
|
|
34726
34732
|
"Kind",
|
|
34727
34733
|
"PipelineConfig",
|
|
34728
34734
|
"Runtime",
|
|
34729
|
-
"Code"
|
|
34735
|
+
"Code",
|
|
34736
|
+
"CachingConfig",
|
|
34737
|
+
"CodeS3Location",
|
|
34738
|
+
"MaxBatchSize",
|
|
34739
|
+
"MetricsConfig",
|
|
34740
|
+
"RequestMappingTemplateS3Location",
|
|
34741
|
+
"ResponseMappingTemplateS3Location",
|
|
34742
|
+
"SyncConfig"
|
|
34730
34743
|
])],
|
|
34731
34744
|
["AWS::AppSync::ApiKey", /* @__PURE__ */ new Set([
|
|
34732
34745
|
"ApiId",
|
|
@@ -34734,11 +34747,23 @@ var AppSyncProvider = class {
|
|
|
34734
34747
|
"Expires"
|
|
34735
34748
|
])]
|
|
34736
34749
|
]);
|
|
34737
|
-
unhandledByDesign = /* @__PURE__ */ new Map([["AWS::AppSync::DataSource", /* @__PURE__ */ new Map([["ElasticsearchConfig", "Legacy Elasticsearch alias; use OpenSearchServiceConfig (AppSync deprecated the Elasticsearch DataSource type in favor of OpenSearch)"]])]]);
|
|
34738
34750
|
getClient() {
|
|
34739
34751
|
if (!this.client) this.client = new AppSyncClient(this.providerRegion ? { region: this.providerRegion } : {});
|
|
34740
34752
|
return this.client;
|
|
34741
34753
|
}
|
|
34754
|
+
/**
|
|
34755
|
+
* Lazy S3 client for the `*S3Location` properties (Resolver
|
|
34756
|
+
* `CodeS3Location` / `RequestMappingTemplateS3Location` /
|
|
34757
|
+
* `ResponseMappingTemplateS3Location`, GraphQLSchema
|
|
34758
|
+
* `DefinitionS3Location`) — CloudFormation reads the S3 object and inlines
|
|
34759
|
+
* its body, and cdkd mirrors that. Same construction as
|
|
34760
|
+
* `StepFunctionsProvider.getS3Client` (the sibling `DefinitionS3Location`
|
|
34761
|
+
* implementation).
|
|
34762
|
+
*/
|
|
34763
|
+
getS3Client() {
|
|
34764
|
+
if (!this.s3Client) this.s3Client = new S3Client(this.providerRegion ? { region: this.providerRegion } : {});
|
|
34765
|
+
return this.s3Client;
|
|
34766
|
+
}
|
|
34742
34767
|
async create(logicalId, resourceType, properties, context) {
|
|
34743
34768
|
switch (resourceType) {
|
|
34744
34769
|
case "AWS::AppSync::GraphQLApi": return this.createGraphQLApi(logicalId, resourceType, properties, context);
|
|
@@ -34757,11 +34782,16 @@ var AppSyncProvider = class {
|
|
|
34757
34782
|
* `XrayEnabled` / `LogConfig`) + `TagResource` / `UntagResource`
|
|
34758
34783
|
* for `Tags` diff. `Name` is immutable on AWS.
|
|
34759
34784
|
* - `DataSource` → `UpdateDataSourceCommand` (`Description` /
|
|
34760
|
-
* `ServiceRoleArn` /
|
|
34785
|
+
* `ServiceRoleArn` / the per-type configs — `DynamoDBConfig` /
|
|
34786
|
+
* `LambdaConfig` / `HttpConfig` / `ElasticsearchConfig` /
|
|
34787
|
+
* `OpenSearchServiceConfig` / `EventBridgeConfig` /
|
|
34788
|
+
* `RelationalDatabaseConfig` — / `MetricsConfig`).
|
|
34761
34789
|
* `ApiId` / `Name` / `Type` are immutable identity fields.
|
|
34762
34790
|
* - `Resolver` → `UpdateResolverCommand` (`DataSourceName` /
|
|
34763
34791
|
* `RequestMappingTemplate` / `ResponseMappingTemplate` / `Kind` /
|
|
34764
|
-
* `PipelineConfig` / `Runtime` / `Code`
|
|
34792
|
+
* `PipelineConfig` / `Runtime` / `Code` / `CachingConfig` /
|
|
34793
|
+
* `SyncConfig` / `MaxBatchSize` / `MetricsConfig` + the three
|
|
34794
|
+
* `*S3Location` fetch-and-inline pairs). `ApiId` / `TypeName` /
|
|
34765
34795
|
* `FieldName` are immutable identity fields.
|
|
34766
34796
|
* - `ApiKey` → `UpdateApiKeyCommand` (`Description` / `Expires`).
|
|
34767
34797
|
* `ApiId` is immutable; the AWS-generated key id is immutable.
|
|
@@ -34853,7 +34883,23 @@ var AppSyncProvider = class {
|
|
|
34853
34883
|
async updateGraphQLSchema(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
34854
34884
|
const newDef = properties["Definition"];
|
|
34855
34885
|
const oldDef = previousProperties["Definition"];
|
|
34856
|
-
|
|
34886
|
+
const newLoc = properties["DefinitionS3Location"];
|
|
34887
|
+
const oldLoc = previousProperties["DefinitionS3Location"];
|
|
34888
|
+
let definition;
|
|
34889
|
+
if (newDef !== void 0) {
|
|
34890
|
+
if (newLoc !== void 0) this.logger.warn(`${resourceType} ${logicalId}: both Definition and DefinitionS3Location are set — using the inline Definition and ignoring DefinitionS3Location (CFn treats them as alternatives)`);
|
|
34891
|
+
if (newDef === oldDef) return {
|
|
34892
|
+
physicalId,
|
|
34893
|
+
wasReplaced: false
|
|
34894
|
+
};
|
|
34895
|
+
definition = newDef;
|
|
34896
|
+
} else if (newLoc !== void 0) {
|
|
34897
|
+
if (this.deepEqual(newLoc, oldLoc)) return {
|
|
34898
|
+
physicalId,
|
|
34899
|
+
wasReplaced: false
|
|
34900
|
+
};
|
|
34901
|
+
definition = await this.fetchS3LocationBody(newLoc, resourceType, logicalId, "DefinitionS3Location");
|
|
34902
|
+
} else return {
|
|
34857
34903
|
physicalId,
|
|
34858
34904
|
wasReplaced: false
|
|
34859
34905
|
};
|
|
@@ -34861,7 +34907,7 @@ var AppSyncProvider = class {
|
|
|
34861
34907
|
try {
|
|
34862
34908
|
await this.getClient().send(new StartSchemaCreationCommand({
|
|
34863
34909
|
apiId,
|
|
34864
|
-
definition: Buffer.from(
|
|
34910
|
+
definition: Buffer.from(definition, "utf-8")
|
|
34865
34911
|
}));
|
|
34866
34912
|
} catch (error) {
|
|
34867
34913
|
throw this.wrapUpdateError(error, resourceType, logicalId, physicalId, "GraphqlSchema");
|
|
@@ -34884,17 +34930,18 @@ var AppSyncProvider = class {
|
|
|
34884
34930
|
const [apiId, name] = physicalId.split("|");
|
|
34885
34931
|
if (!apiId || !name) throw new ProvisioningError(`Invalid DataSource physical ID format: ${physicalId}`, resourceType, logicalId, physicalId);
|
|
34886
34932
|
const type = properties["Type"] ?? previousProperties["Type"];
|
|
34887
|
-
|
|
34888
|
-
|
|
34889
|
-
|
|
34890
|
-
|
|
34891
|
-
|
|
34892
|
-
|
|
34893
|
-
|
|
34894
|
-
|
|
34895
|
-
|
|
34896
|
-
|
|
34897
|
-
|
|
34933
|
+
if (![
|
|
34934
|
+
"Description",
|
|
34935
|
+
"ServiceRoleArn",
|
|
34936
|
+
"DynamoDBConfig",
|
|
34937
|
+
"LambdaConfig",
|
|
34938
|
+
"HttpConfig",
|
|
34939
|
+
"ElasticsearchConfig",
|
|
34940
|
+
"OpenSearchServiceConfig",
|
|
34941
|
+
"EventBridgeConfig",
|
|
34942
|
+
"RelationalDatabaseConfig",
|
|
34943
|
+
"MetricsConfig"
|
|
34944
|
+
].some((key) => (key in properties || key in previousProperties) && !this.deepEqual(properties[key], previousProperties[key]))) return {
|
|
34898
34945
|
physicalId,
|
|
34899
34946
|
wasReplaced: false
|
|
34900
34947
|
};
|
|
@@ -34903,15 +34950,7 @@ var AppSyncProvider = class {
|
|
|
34903
34950
|
name,
|
|
34904
34951
|
type
|
|
34905
34952
|
};
|
|
34906
|
-
|
|
34907
|
-
if (newRole !== void 0) input.serviceRoleArn = newRole;
|
|
34908
|
-
if (newDDB !== void 0) input.dynamodbConfig = {
|
|
34909
|
-
tableName: newDDB["TableName"],
|
|
34910
|
-
awsRegion: newDDB["AwsRegion"],
|
|
34911
|
-
useCallerCredentials: newDDB["UseCallerCredentials"]
|
|
34912
|
-
};
|
|
34913
|
-
if (newLambda !== void 0) input.lambdaConfig = { lambdaFunctionArn: newLambda["LambdaFunctionArn"] };
|
|
34914
|
-
if (newHttp !== void 0) input.httpConfig = { endpoint: newHttp["Endpoint"] };
|
|
34953
|
+
this.applyDataSourceConfig(input, resourceType, logicalId, properties);
|
|
34915
34954
|
try {
|
|
34916
34955
|
await this.getClient().send(new UpdateDataSourceCommand(input));
|
|
34917
34956
|
} catch (error) {
|
|
@@ -34942,8 +34981,15 @@ var AppSyncProvider = class {
|
|
|
34942
34981
|
"Kind",
|
|
34943
34982
|
"PipelineConfig",
|
|
34944
34983
|
"Runtime",
|
|
34945
|
-
"Code"
|
|
34946
|
-
|
|
34984
|
+
"Code",
|
|
34985
|
+
"CachingConfig",
|
|
34986
|
+
"SyncConfig",
|
|
34987
|
+
"MaxBatchSize",
|
|
34988
|
+
"MetricsConfig",
|
|
34989
|
+
"CodeS3Location",
|
|
34990
|
+
"RequestMappingTemplateS3Location",
|
|
34991
|
+
"ResponseMappingTemplateS3Location"
|
|
34992
|
+
].some((key) => (key in properties || key in previousProperties) && !this.deepEqual(properties[key], previousProperties[key]))) return {
|
|
34947
34993
|
physicalId,
|
|
34948
34994
|
wasReplaced: false
|
|
34949
34995
|
};
|
|
@@ -34952,20 +34998,7 @@ var AppSyncProvider = class {
|
|
|
34952
34998
|
typeName,
|
|
34953
34999
|
fieldName
|
|
34954
35000
|
};
|
|
34955
|
-
|
|
34956
|
-
if (effectiveKind === "UNIT" && properties["DataSourceName"] !== void 0) input.dataSourceName = properties["DataSourceName"];
|
|
34957
|
-
if (properties["RequestMappingTemplate"] !== void 0) input.requestMappingTemplate = properties["RequestMappingTemplate"];
|
|
34958
|
-
if (properties["ResponseMappingTemplate"] !== void 0) input.responseMappingTemplate = properties["ResponseMappingTemplate"];
|
|
34959
|
-
if (properties["Kind"] !== void 0) input.kind = properties["Kind"];
|
|
34960
|
-
if (effectiveKind === "PIPELINE" && properties["PipelineConfig"] !== void 0) input.pipelineConfig = { functions: properties["PipelineConfig"]["Functions"] };
|
|
34961
|
-
if (properties["Runtime"] !== void 0) {
|
|
34962
|
-
const runtime = properties["Runtime"];
|
|
34963
|
-
input.runtime = {
|
|
34964
|
-
name: runtime["Name"],
|
|
34965
|
-
runtimeVersion: runtime["RuntimeVersion"]
|
|
34966
|
-
};
|
|
34967
|
-
}
|
|
34968
|
-
if (properties["Code"] !== void 0) input.code = properties["Code"];
|
|
35001
|
+
await this.applyResolverConfig(input, resourceType, logicalId, properties, previousProperties, true);
|
|
34969
35002
|
try {
|
|
34970
35003
|
await this.getClient().send(new UpdateResolverCommand(input));
|
|
34971
35004
|
} catch (error) {
|
|
@@ -35086,6 +35119,11 @@ var AppSyncProvider = class {
|
|
|
35086
35119
|
*/
|
|
35087
35120
|
getDriftUnknownPaths(resourceType) {
|
|
35088
35121
|
if (resourceType === "AWS::AppSync::GraphQLSchema") return ["DefinitionS3Location"];
|
|
35122
|
+
if (resourceType === "AWS::AppSync::Resolver") return [
|
|
35123
|
+
"CodeS3Location",
|
|
35124
|
+
"RequestMappingTemplateS3Location",
|
|
35125
|
+
"ResponseMappingTemplateS3Location"
|
|
35126
|
+
];
|
|
35089
35127
|
return [];
|
|
35090
35128
|
}
|
|
35091
35129
|
/**
|
|
@@ -35098,15 +35136,15 @@ var AppSyncProvider = class {
|
|
|
35098
35136
|
* possibly-malformed value"). An ABSENT container keeps returning
|
|
35099
35137
|
* `undefined`, which is a legitimate "not configured".
|
|
35100
35138
|
*/
|
|
35101
|
-
asObject(value, path, options) {
|
|
35139
|
+
asObject(value, path, options, resourceType = "AWS::AppSync::GraphQLApi") {
|
|
35102
35140
|
if (value == null) return void 0;
|
|
35103
35141
|
if (typeof value === "object" && !Array.isArray(value)) return value;
|
|
35104
|
-
const message =
|
|
35142
|
+
const message = `${resourceType} ${path} must be an object, got ${Array.isArray(value) ? "array" : typeof value} — cdkd refuses to drop it silently`;
|
|
35105
35143
|
if (options?.onUnusable) {
|
|
35106
35144
|
options.onUnusable(message);
|
|
35107
35145
|
return;
|
|
35108
35146
|
}
|
|
35109
|
-
throw new ProvisioningError(message,
|
|
35147
|
+
throw new ProvisioningError(message, resourceType, options?.logicalId ?? "");
|
|
35110
35148
|
}
|
|
35111
35149
|
/**
|
|
35112
35150
|
* NOTE: `awsRegion` / `defaultAction` are passed through VERBATIM, including
|
|
@@ -35284,6 +35322,211 @@ var AppSyncProvider = class {
|
|
|
35284
35322
|
throw this.wrapUpdateError(error, resourceType, logicalId, apiId, isUpdate ? "GraphqlApi (env vars)" : "GraphqlApi (env vars, post-create)");
|
|
35285
35323
|
}
|
|
35286
35324
|
}
|
|
35325
|
+
/** CFn `CachingConfig` (`Ttl` / `CachingKeys`) -> SDK `cachingConfig`. */
|
|
35326
|
+
toSdkCachingConfig(value, logicalId) {
|
|
35327
|
+
const cfn = this.asObject(value, "CachingConfig", { logicalId }, "AWS::AppSync::Resolver");
|
|
35328
|
+
if (!cfn) return void 0;
|
|
35329
|
+
const out = { ttl: cfn["Ttl"] };
|
|
35330
|
+
if (cfn["CachingKeys"] !== void 0) out.cachingKeys = requireConfigArray(cfn["CachingKeys"], "AWS::AppSync::Resolver CachingConfig.CachingKeys");
|
|
35331
|
+
return out;
|
|
35332
|
+
}
|
|
35333
|
+
/**
|
|
35334
|
+
* CFn `SyncConfig` (`ConflictDetection` / `ConflictHandler` /
|
|
35335
|
+
* `LambdaConflictHandlerConfig.LambdaConflictHandlerArn`) -> SDK
|
|
35336
|
+
* `syncConfig`.
|
|
35337
|
+
*/
|
|
35338
|
+
toSdkSyncConfig(value, logicalId) {
|
|
35339
|
+
const cfn = this.asObject(value, "SyncConfig", { logicalId }, "AWS::AppSync::Resolver");
|
|
35340
|
+
if (!cfn) return void 0;
|
|
35341
|
+
const out = {};
|
|
35342
|
+
if (cfn["ConflictDetection"] !== void 0) out.conflictDetection = cfn["ConflictDetection"];
|
|
35343
|
+
if (cfn["ConflictHandler"] !== void 0) out.conflictHandler = cfn["ConflictHandler"];
|
|
35344
|
+
const lambdaHandler = this.asObject(cfn["LambdaConflictHandlerConfig"], "SyncConfig.LambdaConflictHandlerConfig", { logicalId }, "AWS::AppSync::Resolver");
|
|
35345
|
+
if (lambdaHandler) out.lambdaConflictHandlerConfig = { lambdaConflictHandlerArn: lambdaHandler["LambdaConflictHandlerArn"] };
|
|
35346
|
+
return out;
|
|
35347
|
+
}
|
|
35348
|
+
/**
|
|
35349
|
+
* Parse the `s3://bucket/key` URL the AppSync `*S3Location` string
|
|
35350
|
+
* properties carry.
|
|
35351
|
+
*
|
|
35352
|
+
* CDK's asset bindings (`appsync.Code.fromAsset`, `aws-s3-assets` Asset
|
|
35353
|
+
* `s3ObjectUrl`) emit exactly this form, and the CloudFormation examples
|
|
35354
|
+
* for these properties use it too. Anything else (an `https://` object
|
|
35355
|
+
* URL, a bare bucket, a non-string) is refused with a clear error naming
|
|
35356
|
+
* the property — never silently dropped.
|
|
35357
|
+
*/
|
|
35358
|
+
parseS3LocationUrl(location, resourceType, logicalId, propertyPath) {
|
|
35359
|
+
if (typeof location !== "string") throw new ProvisioningError(`${resourceType} ${propertyPath} must be a string s3://bucket/key URL, got ${Array.isArray(location) ? "array" : typeof location} — check for an unresolved intrinsic`, resourceType, logicalId);
|
|
35360
|
+
const match = /^s3:\/\/([^/]+)\/(.+)$/.exec(location);
|
|
35361
|
+
if (!match || !match[1] || !match[2]) throw new ProvisioningError(`${resourceType} ${propertyPath} must be an s3://bucket/key URL (got '${location}')`, resourceType, logicalId);
|
|
35362
|
+
return {
|
|
35363
|
+
bucket: match[1],
|
|
35364
|
+
key: match[2]
|
|
35365
|
+
};
|
|
35366
|
+
}
|
|
35367
|
+
/**
|
|
35368
|
+
* Fetch an `*S3Location` object body as a UTF-8 string.
|
|
35369
|
+
*
|
|
35370
|
+
* CloudFormation's behavior for these properties is to download the S3
|
|
35371
|
+
* object and pass its CONTENT as the corresponding inline member
|
|
35372
|
+
* (`code` / `requestMappingTemplate` / `responseMappingTemplate` /
|
|
35373
|
+
* `definition`); the URL itself never reaches AppSync. Mirrors
|
|
35374
|
+
* `StepFunctionsProvider.fetchDefinitionFromS3`, including the
|
|
35375
|
+
* empty-body refusal (AWS would reject '' with a generic validation
|
|
35376
|
+
* error naming nothing).
|
|
35377
|
+
*/
|
|
35378
|
+
async fetchS3LocationBody(location, resourceType, logicalId, propertyPath) {
|
|
35379
|
+
const { bucket, key } = this.parseS3LocationUrl(location, resourceType, logicalId, propertyPath);
|
|
35380
|
+
this.logger.debug(`Fetching ${propertyPath} for ${logicalId} from s3://${bucket}/${key}`);
|
|
35381
|
+
let body;
|
|
35382
|
+
try {
|
|
35383
|
+
const resp = await this.getS3Client().send(new GetObjectCommand({
|
|
35384
|
+
Bucket: bucket,
|
|
35385
|
+
Key: key
|
|
35386
|
+
}));
|
|
35387
|
+
if (!resp.Body) throw new Error(`object returned no body`);
|
|
35388
|
+
body = await resp.Body.transformToString();
|
|
35389
|
+
} catch (error) {
|
|
35390
|
+
if (error instanceof ProvisioningError) throw error;
|
|
35391
|
+
throw new ProvisioningError(`Failed to fetch ${propertyPath} s3://${bucket}/${key} for ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
|
|
35392
|
+
}
|
|
35393
|
+
if (body.length === 0) throw new ProvisioningError(`${propertyPath} object s3://${bucket}/${key} returned an empty body`, resourceType, logicalId);
|
|
35394
|
+
return body;
|
|
35395
|
+
}
|
|
35396
|
+
/**
|
|
35397
|
+
* Resolve an inline-or-S3 property pair to the inline SDK value.
|
|
35398
|
+
*
|
|
35399
|
+
* Precedence: the INLINE property wins when both are present, matching
|
|
35400
|
+
* the repo's established S3Location precedent (StepFunctions
|
|
35401
|
+
* `DefinitionString` over `DefinitionS3Location`, AppSync GraphQLSchema
|
|
35402
|
+
* `Definition` over `DefinitionS3Location`) — CFn treats the pair as
|
|
35403
|
+
* alternatives and CDK's bindings only ever emit one, so both-present is
|
|
35404
|
+
* a hand-authored template; it is honored inline-first with a loud
|
|
35405
|
+
* warning rather than refused.
|
|
35406
|
+
*/
|
|
35407
|
+
async resolveInlineOrS3Template(inline, s3Location, inlineKey, s3Key, resourceType, logicalId) {
|
|
35408
|
+
if (inline !== void 0) {
|
|
35409
|
+
if (s3Location !== void 0) this.logger.warn(`${resourceType} ${logicalId}: both ${inlineKey} and ${s3Key} are set — using the inline ${inlineKey} and ignoring ${s3Key} (CFn treats them as alternatives)`);
|
|
35410
|
+
return inline;
|
|
35411
|
+
}
|
|
35412
|
+
if (s3Location !== void 0) return this.fetchS3LocationBody(s3Location, resourceType, logicalId, s3Key);
|
|
35413
|
+
}
|
|
35414
|
+
/**
|
|
35415
|
+
* Fill the mutable members shared by `CreateResolver` and `UpdateResolver`
|
|
35416
|
+
* from the CFn property bag — the single mapper both paths use so they
|
|
35417
|
+
* cannot diverge (the `applyGraphQLApiConfig` pattern).
|
|
35418
|
+
*
|
|
35419
|
+
* REMOVAL semantics: unlike `UpdateGraphqlApi` (where an omitted member is
|
|
35420
|
+
* "no change" and removal needs reset sentinels), `UpdateResolver` is a
|
|
35421
|
+
* FULL-REPLACE write — the desired bag is mapped in its entirety and an
|
|
35422
|
+
* omitted member is cleared server-side, so "absent in template => omitted
|
|
35423
|
+
* from the update input => cleared by AppSync" and no sentinel is needed.
|
|
35424
|
+
* That semantic is pinned live by the integ fixture's REMOVAL phase
|
|
35425
|
+
* (tests/integration/appsync/verify.sh drops the resolver's MetricsConfig
|
|
35426
|
+
* and asserts AWS reset it while a sibling DataSource keeps its own).
|
|
35427
|
+
* MetricsConfig is the one member A/B'd against real AWS; the other
|
|
35428
|
+
* members rest on the same UpdateResolver full-replace API contract, not
|
|
35429
|
+
* on a per-member live probe (the #1160 doctrine's per-member A/B was
|
|
35430
|
+
* deliberately not paid here — recorded in the PR body).
|
|
35431
|
+
*
|
|
35432
|
+
* Resolver shape is `Kind`-discriminated:
|
|
35433
|
+
* - Kind=UNIT -> DataSourceName applies, PipelineConfig is N/A.
|
|
35434
|
+
* - Kind=PIPELINE -> PipelineConfig applies, DataSourceName is N/A
|
|
35435
|
+
* (AWS rejects the call if it's set).
|
|
35436
|
+
* The gate applies ONLY on update (`forUpdate`), where the effective Kind
|
|
35437
|
+
* falls back to the state-recorded previous value and finally AWS's
|
|
35438
|
+
* default 'UNIT' — an update must not re-send the other kind's member on a
|
|
35439
|
+
* live resolver. On CREATE both members forward UNCONDITIONALLY when
|
|
35440
|
+
* present: gating there would silently drop a crossed shape (the very
|
|
35441
|
+
* silent-drop class this batch closes) where CFn parity is AWS's own loud
|
|
35442
|
+
* rejection — the same forward-don't-gate doctrine as
|
|
35443
|
+
* `applyDataSourceConfig`'s per-type sub-configs.
|
|
35444
|
+
*/
|
|
35445
|
+
async applyResolverConfig(input, resourceType, logicalId, properties, previousProperties, forUpdate = false) {
|
|
35446
|
+
const effectiveKind = properties["Kind"] ?? previousProperties?.["Kind"] ?? "UNIT";
|
|
35447
|
+
if ((!forUpdate || effectiveKind === "UNIT") && properties["DataSourceName"] !== void 0) input.dataSourceName = properties["DataSourceName"];
|
|
35448
|
+
if (properties["Kind"] !== void 0) input.kind = properties["Kind"];
|
|
35449
|
+
if ((!forUpdate || effectiveKind === "PIPELINE") && properties["PipelineConfig"] !== void 0) input.pipelineConfig = { functions: properties["PipelineConfig"]["Functions"] };
|
|
35450
|
+
if (properties["Runtime"] !== void 0) {
|
|
35451
|
+
const runtime = properties["Runtime"];
|
|
35452
|
+
input.runtime = {
|
|
35453
|
+
name: runtime["Name"],
|
|
35454
|
+
runtimeVersion: runtime["RuntimeVersion"]
|
|
35455
|
+
};
|
|
35456
|
+
}
|
|
35457
|
+
const requestTemplate = await this.resolveInlineOrS3Template(properties["RequestMappingTemplate"], properties["RequestMappingTemplateS3Location"], "RequestMappingTemplate", "RequestMappingTemplateS3Location", resourceType, logicalId);
|
|
35458
|
+
if (requestTemplate !== void 0) input.requestMappingTemplate = requestTemplate;
|
|
35459
|
+
const responseTemplate = await this.resolveInlineOrS3Template(properties["ResponseMappingTemplate"], properties["ResponseMappingTemplateS3Location"], "ResponseMappingTemplate", "ResponseMappingTemplateS3Location", resourceType, logicalId);
|
|
35460
|
+
if (responseTemplate !== void 0) input.responseMappingTemplate = responseTemplate;
|
|
35461
|
+
const code = await this.resolveInlineOrS3Template(properties["Code"], properties["CodeS3Location"], "Code", "CodeS3Location", resourceType, logicalId);
|
|
35462
|
+
if (code !== void 0) input.code = code;
|
|
35463
|
+
const caching = this.toSdkCachingConfig(properties["CachingConfig"], logicalId);
|
|
35464
|
+
if (caching) input.cachingConfig = caching;
|
|
35465
|
+
const sync = this.toSdkSyncConfig(properties["SyncConfig"], logicalId);
|
|
35466
|
+
if (sync) input.syncConfig = sync;
|
|
35467
|
+
if (properties["MaxBatchSize"] !== void 0) input.maxBatchSize = properties["MaxBatchSize"];
|
|
35468
|
+
if (properties["MetricsConfig"] !== void 0) input.metricsConfig = properties["MetricsConfig"];
|
|
35469
|
+
}
|
|
35470
|
+
/**
|
|
35471
|
+
* Fill the mutable members shared by `CreateDataSource` and
|
|
35472
|
+
* `UpdateDataSource` from the CFn property bag — single mapper for both
|
|
35473
|
+
* paths (the `applyGraphQLApiConfig` pattern).
|
|
35474
|
+
*
|
|
35475
|
+
* REMOVAL semantics: `UpdateDataSource` is a FULL-REPLACE write like
|
|
35476
|
+
* `UpdateResolver` — an omitted member is cleared server-side, so removal
|
|
35477
|
+
* needs no reset sentinel (see `applyResolverConfig`'s note; pinned live
|
|
35478
|
+
* by the integ fixture's REMOVAL phase).
|
|
35479
|
+
*
|
|
35480
|
+
* The per-type sub-configs (`DynamoDBConfig` / `LambdaConfig` /
|
|
35481
|
+
* `HttpConfig` / `ElasticsearchConfig` / `OpenSearchServiceConfig` /
|
|
35482
|
+
* `EventBridgeConfig` / `RelationalDatabaseConfig`) are mutually exclusive
|
|
35483
|
+
* on the `Type` discriminator. The write side deliberately FORWARDS
|
|
35484
|
+
* whichever block the template carries rather than gating on `Type`:
|
|
35485
|
+
* gating would silently drop a mismatched block (the very silent-drop
|
|
35486
|
+
* class this batch closes), while AWS rejects a crossed shape with a loud
|
|
35487
|
+
* validation error. The read side (`readDataSource`) gates on the
|
|
35488
|
+
* response's own discriminator instead.
|
|
35489
|
+
*/
|
|
35490
|
+
applyDataSourceConfig(input, resourceType, logicalId, properties) {
|
|
35491
|
+
if (properties["Description"] !== void 0) input.description = properties["Description"];
|
|
35492
|
+
if (properties["ServiceRoleArn"] !== void 0) input.serviceRoleArn = properties["ServiceRoleArn"];
|
|
35493
|
+
const dynamo = this.asObject(properties["DynamoDBConfig"], "DynamoDBConfig", { logicalId }, resourceType);
|
|
35494
|
+
if (dynamo) input.dynamodbConfig = {
|
|
35495
|
+
tableName: dynamo["TableName"],
|
|
35496
|
+
awsRegion: dynamo["AwsRegion"],
|
|
35497
|
+
...dynamo["UseCallerCredentials"] !== void 0 ? { useCallerCredentials: dynamo["UseCallerCredentials"] } : {}
|
|
35498
|
+
};
|
|
35499
|
+
const lambda = this.asObject(properties["LambdaConfig"], "LambdaConfig", { logicalId }, resourceType);
|
|
35500
|
+
if (lambda) input.lambdaConfig = { lambdaFunctionArn: lambda["LambdaFunctionArn"] };
|
|
35501
|
+
const http = this.asObject(properties["HttpConfig"], "HttpConfig", { logicalId }, resourceType);
|
|
35502
|
+
if (http) input.httpConfig = { endpoint: http["Endpoint"] };
|
|
35503
|
+
const es = this.asObject(properties["ElasticsearchConfig"], "ElasticsearchConfig", { logicalId }, resourceType);
|
|
35504
|
+
if (es) input.elasticsearchConfig = {
|
|
35505
|
+
endpoint: es["Endpoint"],
|
|
35506
|
+
awsRegion: es["AwsRegion"]
|
|
35507
|
+
};
|
|
35508
|
+
const openSearch = this.asObject(properties["OpenSearchServiceConfig"], "OpenSearchServiceConfig", { logicalId }, resourceType);
|
|
35509
|
+
if (openSearch) input.openSearchServiceConfig = {
|
|
35510
|
+
endpoint: openSearch["Endpoint"],
|
|
35511
|
+
awsRegion: openSearch["AwsRegion"]
|
|
35512
|
+
};
|
|
35513
|
+
const eventBridge = this.asObject(properties["EventBridgeConfig"], "EventBridgeConfig", { logicalId }, resourceType);
|
|
35514
|
+
if (eventBridge) input.eventBridgeConfig = { eventBusArn: eventBridge["EventBusArn"] };
|
|
35515
|
+
const relational = this.asObject(properties["RelationalDatabaseConfig"], "RelationalDatabaseConfig", { logicalId }, resourceType);
|
|
35516
|
+
if (relational) {
|
|
35517
|
+
const rdsConfig = { relationalDatabaseSourceType: relational["RelationalDatabaseSourceType"] };
|
|
35518
|
+
const rdsEndpoint = this.asObject(relational["RdsHttpEndpointConfig"], "RelationalDatabaseConfig.RdsHttpEndpointConfig", { logicalId }, resourceType);
|
|
35519
|
+
if (rdsEndpoint) rdsConfig.rdsHttpEndpointConfig = {
|
|
35520
|
+
awsRegion: rdsEndpoint["AwsRegion"],
|
|
35521
|
+
dbClusterIdentifier: rdsEndpoint["DbClusterIdentifier"],
|
|
35522
|
+
...rdsEndpoint["DatabaseName"] !== void 0 ? { databaseName: rdsEndpoint["DatabaseName"] } : {},
|
|
35523
|
+
...rdsEndpoint["Schema"] !== void 0 ? { schema: rdsEndpoint["Schema"] } : {},
|
|
35524
|
+
...rdsEndpoint["AwsSecretStoreArn"] !== void 0 ? { awsSecretStoreArn: rdsEndpoint["AwsSecretStoreArn"] } : {}
|
|
35525
|
+
};
|
|
35526
|
+
input.relationalDatabaseConfig = rdsConfig;
|
|
35527
|
+
}
|
|
35528
|
+
if (properties["MetricsConfig"] !== void 0) input.metricsConfig = properties["MetricsConfig"];
|
|
35529
|
+
}
|
|
35287
35530
|
async createGraphQLApi(logicalId, resourceType, properties, context) {
|
|
35288
35531
|
this.logger.debug(`Creating GraphQL API ${logicalId}`);
|
|
35289
35532
|
const name = properties["Name"];
|
|
@@ -35368,11 +35611,19 @@ var AppSyncProvider = class {
|
|
|
35368
35611
|
const definition = properties["Definition"];
|
|
35369
35612
|
const definitionS3Location = properties["DefinitionS3Location"];
|
|
35370
35613
|
try {
|
|
35371
|
-
if (definition)
|
|
35372
|
-
|
|
35373
|
-
|
|
35374
|
-
|
|
35375
|
-
|
|
35614
|
+
if (definition) {
|
|
35615
|
+
if (definitionS3Location !== void 0) this.logger.warn(`${resourceType} ${logicalId}: both Definition and DefinitionS3Location are set — using the inline Definition and ignoring DefinitionS3Location (CFn treats them as alternatives)`);
|
|
35616
|
+
await this.getClient().send(new StartSchemaCreationCommand({
|
|
35617
|
+
apiId,
|
|
35618
|
+
definition: new TextEncoder().encode(definition)
|
|
35619
|
+
}));
|
|
35620
|
+
} else if (definitionS3Location !== void 0) {
|
|
35621
|
+
const body = await this.fetchS3LocationBody(definitionS3Location, resourceType, logicalId, "DefinitionS3Location");
|
|
35622
|
+
await this.getClient().send(new StartSchemaCreationCommand({
|
|
35623
|
+
apiId,
|
|
35624
|
+
definition: new TextEncoder().encode(body)
|
|
35625
|
+
}));
|
|
35626
|
+
}
|
|
35376
35627
|
this.logger.debug(`Successfully started schema creation for ${logicalId}`);
|
|
35377
35628
|
return {
|
|
35378
35629
|
physicalId: apiId,
|
|
@@ -35395,18 +35646,7 @@ var AppSyncProvider = class {
|
|
|
35395
35646
|
name,
|
|
35396
35647
|
type
|
|
35397
35648
|
};
|
|
35398
|
-
|
|
35399
|
-
if (properties["ServiceRoleArn"]) input.serviceRoleArn = properties["ServiceRoleArn"];
|
|
35400
|
-
if (properties["DynamoDBConfig"]) {
|
|
35401
|
-
const config = properties["DynamoDBConfig"];
|
|
35402
|
-
input.dynamodbConfig = {
|
|
35403
|
-
tableName: config["TableName"],
|
|
35404
|
-
awsRegion: config["AwsRegion"],
|
|
35405
|
-
useCallerCredentials: config["UseCallerCredentials"]
|
|
35406
|
-
};
|
|
35407
|
-
}
|
|
35408
|
-
if (properties["LambdaConfig"]) input.lambdaConfig = { lambdaFunctionArn: properties["LambdaConfig"]["LambdaFunctionArn"] };
|
|
35409
|
-
if (properties["HttpConfig"]) input.httpConfig = { endpoint: properties["HttpConfig"]["Endpoint"] };
|
|
35649
|
+
this.applyDataSourceConfig(input, resourceType, logicalId, properties);
|
|
35410
35650
|
await this.getClient().send(new CreateDataSourceCommand(input));
|
|
35411
35651
|
const physicalId = `${apiId}|${name}`;
|
|
35412
35652
|
this.logger.debug(`Successfully created DataSource ${logicalId}: ${physicalId}`);
|
|
@@ -35457,19 +35697,7 @@ var AppSyncProvider = class {
|
|
|
35457
35697
|
typeName,
|
|
35458
35698
|
fieldName
|
|
35459
35699
|
};
|
|
35460
|
-
|
|
35461
|
-
if (properties["RequestMappingTemplate"]) input.requestMappingTemplate = properties["RequestMappingTemplate"];
|
|
35462
|
-
if (properties["ResponseMappingTemplate"]) input.responseMappingTemplate = properties["ResponseMappingTemplate"];
|
|
35463
|
-
if (properties["Kind"]) input.kind = properties["Kind"];
|
|
35464
|
-
if (properties["PipelineConfig"]) input.pipelineConfig = { functions: properties["PipelineConfig"]["Functions"] };
|
|
35465
|
-
if (properties["Runtime"]) {
|
|
35466
|
-
const runtime = properties["Runtime"];
|
|
35467
|
-
input.runtime = {
|
|
35468
|
-
name: runtime["Name"],
|
|
35469
|
-
runtimeVersion: runtime["RuntimeVersion"]
|
|
35470
|
-
};
|
|
35471
|
-
}
|
|
35472
|
-
if (properties["Code"]) input.code = properties["Code"];
|
|
35700
|
+
await this.applyResolverConfig(input, resourceType, logicalId, properties);
|
|
35473
35701
|
await this.getClient().send(new CreateResolverCommand(input));
|
|
35474
35702
|
const physicalId = `${apiId}|${typeName}|${fieldName}`;
|
|
35475
35703
|
this.logger.debug(`Successfully created Resolver ${logicalId}: ${physicalId}`);
|
|
@@ -35568,10 +35796,13 @@ var AppSyncProvider = class {
|
|
|
35568
35796
|
* CDK's `aws:*` auto-tags are filtered out and the result key is
|
|
35569
35797
|
* omitted when no user tags remain.
|
|
35570
35798
|
* - `DataSource` → `GetDataSource` (Name, Type, Description,
|
|
35571
|
-
* ServiceRoleArn, DynamoDBConfig, LambdaConfig,
|
|
35799
|
+
* ServiceRoleArn, the per-type configs — DynamoDBConfig, LambdaConfig,
|
|
35800
|
+
* HttpConfig, ElasticsearchConfig, OpenSearchServiceConfig,
|
|
35801
|
+
* EventBridgeConfig, RelationalDatabaseConfig — and MetricsConfig). The
|
|
35572
35802
|
* `ApiId` cdkd holds is recovered from the `apiId|name` physicalId.
|
|
35573
35803
|
* - `Resolver` → `GetResolver` (TypeName, FieldName, DataSourceName,
|
|
35574
|
-
* request/response templates, Kind, PipelineConfig, Runtime, Code
|
|
35804
|
+
* request/response templates, Kind, PipelineConfig, Runtime, Code,
|
|
35805
|
+
* CachingConfig, SyncConfig, MaxBatchSize, MetricsConfig).
|
|
35575
35806
|
* - `ApiKey` → `ListApiKeys` filtered by id (no `GetApiKey` SDK call;
|
|
35576
35807
|
* AppSync only exposes list-based access). Surfaces Description and
|
|
35577
35808
|
* Expires.
|
|
@@ -35749,6 +35980,35 @@ var AppSyncProvider = class {
|
|
|
35749
35980
|
}
|
|
35750
35981
|
if (ds.lambdaConfig?.lambdaFunctionArn !== void 0) result["LambdaConfig"] = { LambdaFunctionArn: ds.lambdaConfig.lambdaFunctionArn };
|
|
35751
35982
|
if (ds.httpConfig?.endpoint !== void 0) result["HttpConfig"] = { Endpoint: ds.httpConfig.endpoint };
|
|
35983
|
+
if (ds.elasticsearchConfig) {
|
|
35984
|
+
const es = {};
|
|
35985
|
+
if (ds.elasticsearchConfig.endpoint !== void 0) es["Endpoint"] = ds.elasticsearchConfig.endpoint;
|
|
35986
|
+
if (ds.elasticsearchConfig.awsRegion !== void 0) es["AwsRegion"] = ds.elasticsearchConfig.awsRegion;
|
|
35987
|
+
if (Object.keys(es).length > 0) result["ElasticsearchConfig"] = es;
|
|
35988
|
+
}
|
|
35989
|
+
if (ds.openSearchServiceConfig) {
|
|
35990
|
+
const os = {};
|
|
35991
|
+
if (ds.openSearchServiceConfig.endpoint !== void 0) os["Endpoint"] = ds.openSearchServiceConfig.endpoint;
|
|
35992
|
+
if (ds.openSearchServiceConfig.awsRegion !== void 0) os["AwsRegion"] = ds.openSearchServiceConfig.awsRegion;
|
|
35993
|
+
if (Object.keys(os).length > 0) result["OpenSearchServiceConfig"] = os;
|
|
35994
|
+
}
|
|
35995
|
+
if (ds.eventBridgeConfig?.eventBusArn !== void 0) result["EventBridgeConfig"] = { EventBusArn: ds.eventBridgeConfig.eventBusArn };
|
|
35996
|
+
if (ds.relationalDatabaseConfig) {
|
|
35997
|
+
const rds = {};
|
|
35998
|
+
if (ds.relationalDatabaseConfig.relationalDatabaseSourceType !== void 0) rds["RelationalDatabaseSourceType"] = ds.relationalDatabaseConfig.relationalDatabaseSourceType;
|
|
35999
|
+
const endpoint = ds.relationalDatabaseConfig.rdsHttpEndpointConfig;
|
|
36000
|
+
if (endpoint) {
|
|
36001
|
+
const ep = {};
|
|
36002
|
+
if (endpoint.awsRegion !== void 0) ep["AwsRegion"] = endpoint.awsRegion;
|
|
36003
|
+
if (endpoint.dbClusterIdentifier !== void 0) ep["DbClusterIdentifier"] = endpoint.dbClusterIdentifier;
|
|
36004
|
+
if (endpoint.databaseName !== void 0) ep["DatabaseName"] = endpoint.databaseName;
|
|
36005
|
+
if (endpoint.schema !== void 0) ep["Schema"] = endpoint.schema;
|
|
36006
|
+
if (endpoint.awsSecretStoreArn !== void 0) ep["AwsSecretStoreArn"] = endpoint.awsSecretStoreArn;
|
|
36007
|
+
if (Object.keys(ep).length > 0) rds["RdsHttpEndpointConfig"] = ep;
|
|
36008
|
+
}
|
|
36009
|
+
if (Object.keys(rds).length > 0) result["RelationalDatabaseConfig"] = rds;
|
|
36010
|
+
}
|
|
36011
|
+
if (ds.metricsConfig !== void 0) result["MetricsConfig"] = ds.metricsConfig;
|
|
35752
36012
|
return result;
|
|
35753
36013
|
}
|
|
35754
36014
|
async readResolver(physicalId) {
|
|
@@ -35783,6 +36043,21 @@ var AppSyncProvider = class {
|
|
|
35783
36043
|
result["RequestMappingTemplate"] = resolver.requestMappingTemplate ?? "";
|
|
35784
36044
|
result["ResponseMappingTemplate"] = resolver.responseMappingTemplate ?? "";
|
|
35785
36045
|
}
|
|
36046
|
+
if (resolver.cachingConfig) {
|
|
36047
|
+
const caching = {};
|
|
36048
|
+
if (resolver.cachingConfig.ttl !== void 0) caching["Ttl"] = resolver.cachingConfig.ttl;
|
|
36049
|
+
if (resolver.cachingConfig.cachingKeys !== void 0) caching["CachingKeys"] = [...resolver.cachingConfig.cachingKeys];
|
|
36050
|
+
if (Object.keys(caching).length > 0) result["CachingConfig"] = caching;
|
|
36051
|
+
}
|
|
36052
|
+
if (resolver.syncConfig) {
|
|
36053
|
+
const sync = {};
|
|
36054
|
+
if (resolver.syncConfig.conflictDetection !== void 0) sync["ConflictDetection"] = resolver.syncConfig.conflictDetection;
|
|
36055
|
+
if (resolver.syncConfig.conflictHandler !== void 0) sync["ConflictHandler"] = resolver.syncConfig.conflictHandler;
|
|
36056
|
+
if (resolver.syncConfig.lambdaConflictHandlerConfig?.lambdaConflictHandlerArn !== void 0) sync["LambdaConflictHandlerConfig"] = { LambdaConflictHandlerArn: resolver.syncConfig.lambdaConflictHandlerConfig.lambdaConflictHandlerArn };
|
|
36057
|
+
if (Object.keys(sync).length > 0) result["SyncConfig"] = sync;
|
|
36058
|
+
}
|
|
36059
|
+
if (resolver.maxBatchSize !== void 0) result["MaxBatchSize"] = resolver.maxBatchSize;
|
|
36060
|
+
if (resolver.metricsConfig !== void 0) result["MetricsConfig"] = resolver.metricsConfig;
|
|
35786
36061
|
return result;
|
|
35787
36062
|
}
|
|
35788
36063
|
async readApiKey(physicalId) {
|
|
@@ -69522,7 +69797,7 @@ function createMigrateCommand() {
|
|
|
69522
69797
|
*/
|
|
69523
69798
|
function buildProgram() {
|
|
69524
69799
|
const program = new Command();
|
|
69525
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.280.
|
|
69800
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.280.18");
|
|
69526
69801
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
69527
69802
|
const { profile } = actionCommand.optsWithGlobals();
|
|
69528
69803
|
if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
|