@aws-amplify/graphql-api-construct 1.5.7-rds-5.0 → 1.6.0-secrets-manager.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +146 -35
- package/API.md +13 -1
- package/CHANGELOG.md +3 -5
- package/README.md +75 -17
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.js +1 -1
- package/lib/amplify-graphql-definition.js +1 -1
- package/lib/internal/data-source-config.js +37 -4
- package/lib/model-datasource-strategy-types.d.ts +25 -1
- package/lib/model-datasource-strategy-types.js +1 -1
- package/lib/sql-model-datasource-strategy.d.ts +13 -1
- package/lib/sql-model-datasource-strategy.js +26 -4
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +1 -7
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js +3 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js +2 -3
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +12 -12
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +10 -10
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +4 -5
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts +5 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js +71 -26
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js +21 -7
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +3 -5
- package/node_modules/@aws-amplify/graphql-transformer/package.json +16 -16
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +1 -5
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +27 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts +12 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js +22 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +3 -2
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts +76 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
- package/node_modules/graphql-transformer-common/API.md +0 -14
- package/node_modules/graphql-transformer-common/CHANGELOG.md +0 -10
- package/node_modules/graphql-transformer-common/lib/index.d.ts +0 -1
- package/node_modules/graphql-transformer-common/lib/index.d.ts.map +1 -1
- package/node_modules/graphql-transformer-common/lib/index.js +0 -1
- package/node_modules/graphql-transformer-common/lib/index.js.map +1 -1
- package/node_modules/graphql-transformer-common/package.json +2 -3
- package/package.json +18 -18
- package/src/internal/data-source-config.ts +42 -9
- package/src/model-datasource-strategy-types.ts +33 -1
- package/src/sql-model-datasource-strategy.ts +32 -1
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.d.ts +0 -13
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.d.ts.map +0 -1
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.js +0 -16
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.js.map +0 -1
- /package/node_modules/{graphql-transformer-common → @aws-amplify/graphql-transformer-interfaces}/LICENSE +0 -0
@@ -500,20 +500,6 @@ export function toUpper(word: string): string;
|
|
500
500
|
// @public (undocumented)
|
501
501
|
export const transformedArgsRef: ReferenceNode;
|
502
502
|
|
503
|
-
// @public (undocumented)
|
504
|
-
export const TYPESCRIPT_DATA_SCHEMA_CONSTANTS: {
|
505
|
-
SCHEMA_PACKAGE: string;
|
506
|
-
MODEL_METHOD: string;
|
507
|
-
SCHEMA_METHOD: string;
|
508
|
-
IDENTIFIER_METHOD: string;
|
509
|
-
ARRAY_METHOD: string;
|
510
|
-
REQUIRED_METHOD: string;
|
511
|
-
STRING_METHOD: string;
|
512
|
-
ENUM_METHOD: string;
|
513
|
-
REFERENCE_A: string;
|
514
|
-
EXPORT_VARIABLE_NAME: string;
|
515
|
-
};
|
516
|
-
|
517
503
|
// @public (undocumented)
|
518
504
|
export function unwrapNonNull(type: TypeNode): any;
|
519
505
|
|
@@ -3,16 +3,6 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [4.28.1-rds-5.0](https://github.com/aws-amplify/amplify-category-api/compare/graphql-transformer-common@4.28.0...graphql-transformer-common@4.28.1-rds-5.0) (2024-02-09)
|
7
|
-
|
8
|
-
**Note:** Version bump only for package graphql-transformer-common
|
9
|
-
|
10
|
-
# [4.28.0](https://github.com/aws-amplify/amplify-category-api/compare/graphql-transformer-common@4.27.1...graphql-transformer-common@4.28.0) (2024-02-05)
|
11
|
-
|
12
|
-
### Features
|
13
|
-
|
14
|
-
- **api:** generate typescript data schema from sql schema internal representation ([#2225](https://github.com/aws-amplify/amplify-category-api/issues/2225)) ([460b077](https://github.com/aws-amplify/amplify-category-api/commit/460b0776af82932d2b42a2b7720b49b91fdbd45c))
|
15
|
-
|
16
6
|
## [4.27.1](https://github.com/aws-amplify/amplify-category-api/compare/graphql-transformer-common@4.27.0...graphql-transformer-common@4.27.1) (2023-12-18)
|
17
7
|
|
18
8
|
**Note:** Version bump only for package graphql-transformer-common
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC"}
|
@@ -28,5 +28,4 @@ __exportStar(require("./dynamodbUtils"), exports);
|
|
28
28
|
__exportStar(require("./SyncResourceIDs"), exports);
|
29
29
|
__exportStar(require("./PredictionsResourceIDs"), exports);
|
30
30
|
__exportStar(require("./transformedArgs"), exports);
|
31
|
-
__exportStar(require("./TypescriptSchemaConstants"), exports);
|
32
31
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,+CAA6B;AAC7B,yCAAuB;AACvB,wDAAsC;AACtC,qDAAmC;AACnC,0DAAwC;AACxC,8CAA4B;AAC5B,oDAAkC;AAClC,wDAAsC;AACtC,oDAAkC;AAClC,kDAAgC;AAChC,oDAAkC;AAClC,2DAAyC;AACzC,oDAAkC
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,+CAA6B;AAC7B,yCAAuB;AACvB,wDAAsC;AACtC,qDAAmC;AACnC,0DAAwC;AACxC,8CAA4B;AAC5B,oDAAkC;AAClC,wDAAsC;AACtC,oDAAkC;AAClC,kDAAgC;AAChC,oDAAkC;AAClC,2DAAyC;AACzC,oDAAkC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "graphql-transformer-common",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.27.1",
|
4
4
|
"description": "Common code and constants for AppSync Transformers",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -59,6 +59,5 @@
|
|
59
59
|
"json",
|
60
60
|
"node"
|
61
61
|
]
|
62
|
-
}
|
63
|
-
"gitHead": "553dbfa03d3329121143749cbb04db3f44987b5e"
|
62
|
+
}
|
64
63
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-api-construct",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.6.0-secrets-manager.0",
|
4
4
|
"description": "AppSync GraphQL Api Construct using Amplify GraphQL Transformer.",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -75,20 +75,20 @@
|
|
75
75
|
"dependencies": {
|
76
76
|
"@aws-amplify/backend-output-schemas": "^0.4.0",
|
77
77
|
"@aws-amplify/backend-output-storage": "^0.2.2",
|
78
|
-
"@aws-amplify/graphql-auth-transformer": "3.3.
|
79
|
-
"@aws-amplify/graphql-default-value-transformer": "2.2.
|
80
|
-
"@aws-amplify/graphql-function-transformer": "2.1.
|
81
|
-
"@aws-amplify/graphql-http-transformer": "2.1.
|
82
|
-
"@aws-amplify/graphql-index-transformer": "2.3.
|
83
|
-
"@aws-amplify/graphql-maps-to-transformer": "3.4.
|
84
|
-
"@aws-amplify/graphql-model-transformer": "2.
|
85
|
-
"@aws-amplify/graphql-predictions-transformer": "2.1.
|
86
|
-
"@aws-amplify/graphql-relational-transformer": "2.3.
|
87
|
-
"@aws-amplify/graphql-searchable-transformer": "2.5.
|
88
|
-
"@aws-amplify/graphql-sql-transformer": "0.2.
|
89
|
-
"@aws-amplify/graphql-transformer": "1.
|
90
|
-
"@aws-amplify/graphql-transformer-core": "2.4.
|
91
|
-
"@aws-amplify/graphql-transformer-interfaces": "3.
|
78
|
+
"@aws-amplify/graphql-auth-transformer": "3.3.6-secrets-manager.0",
|
79
|
+
"@aws-amplify/graphql-default-value-transformer": "2.2.5-secrets-manager.0",
|
80
|
+
"@aws-amplify/graphql-function-transformer": "2.1.17-secrets-manager.0",
|
81
|
+
"@aws-amplify/graphql-http-transformer": "2.1.17-secrets-manager.0",
|
82
|
+
"@aws-amplify/graphql-index-transformer": "2.3.5-secrets-manager.0",
|
83
|
+
"@aws-amplify/graphql-maps-to-transformer": "3.4.6-secrets-manager.0",
|
84
|
+
"@aws-amplify/graphql-model-transformer": "2.5.0-secrets-manager.0",
|
85
|
+
"@aws-amplify/graphql-predictions-transformer": "2.1.17-secrets-manager.0",
|
86
|
+
"@aws-amplify/graphql-relational-transformer": "2.3.6-secrets-manager.0",
|
87
|
+
"@aws-amplify/graphql-searchable-transformer": "2.5.2-secrets-manager.0",
|
88
|
+
"@aws-amplify/graphql-sql-transformer": "0.2.5-secrets-manager.0",
|
89
|
+
"@aws-amplify/graphql-transformer": "1.4.0-secrets-manager.0",
|
90
|
+
"@aws-amplify/graphql-transformer-core": "2.4.5-secrets-manager.0",
|
91
|
+
"@aws-amplify/graphql-transformer-interfaces": "3.4.0-secrets-manager.0",
|
92
92
|
"@aws-amplify/platform-core": "^0.2.0",
|
93
93
|
"@aws-amplify/plugin-types": "^0.4.1",
|
94
94
|
"charenc": "^0.0.2",
|
@@ -97,7 +97,7 @@
|
|
97
97
|
"graceful-fs": "^4.2.11",
|
98
98
|
"graphql": "^15.5.0",
|
99
99
|
"graphql-mapping-template": "4.20.14",
|
100
|
-
"graphql-transformer-common": "4.
|
100
|
+
"graphql-transformer-common": "4.27.1",
|
101
101
|
"hjson": "^3.2.2",
|
102
102
|
"immer": "^9.0.12",
|
103
103
|
"is-buffer": "^2.0.5",
|
@@ -112,7 +112,7 @@
|
|
112
112
|
"zod": "^3.22.3"
|
113
113
|
},
|
114
114
|
"devDependencies": {
|
115
|
-
"@aws-amplify/graphql-transformer-test-utils": "0.4.
|
115
|
+
"@aws-amplify/graphql-transformer-test-utils": "0.4.5-secrets-manager.0",
|
116
116
|
"@types/fs-extra": "^8.0.1",
|
117
117
|
"@types/node": "^12.12.6",
|
118
118
|
"aws-cdk-lib": "2.80.0",
|
@@ -171,5 +171,5 @@
|
|
171
171
|
],
|
172
172
|
"testEnvironment": "../../FixJestEnvironment.js"
|
173
173
|
},
|
174
|
-
"gitHead": "
|
174
|
+
"gitHead": "1b45d39e2064522f7bce51bd8bf5135742d4ce14"
|
175
175
|
}
|
@@ -6,7 +6,12 @@ import {
|
|
6
6
|
isMutationNode,
|
7
7
|
fieldsWithSqlDirective,
|
8
8
|
} from '@aws-amplify/graphql-transformer-core';
|
9
|
-
import {
|
9
|
+
import {
|
10
|
+
DataSourceStrategiesProvider,
|
11
|
+
isSqlModelDataSourceSsmDbConnectionConfig,
|
12
|
+
isSqlModelDataSourceSecretsManagerDbConnectionConfig,
|
13
|
+
} from '@aws-amplify/graphql-transformer-interfaces';
|
14
|
+
import { Token, Arn, ArnFormat } from 'aws-cdk-lib';
|
10
15
|
import {
|
11
16
|
CustomSqlDataSourceStrategy as ConstructCustomSqlDataSourceStrategy,
|
12
17
|
ModelDataSourceStrategy as ConstructModelDataSourceStrategy,
|
@@ -184,19 +189,47 @@ export const schemaByMergingDefinitions = (definitions: IAmplifyGraphqlDefinitio
|
|
184
189
|
* @param strategy user provided model data source strategy
|
185
190
|
* @returns validates and throws an error if the strategy is invalid
|
186
191
|
*/
|
187
|
-
export const validateDataSourceStrategy = (strategy: ConstructModelDataSourceStrategy) => {
|
192
|
+
export const validateDataSourceStrategy = (strategy: ConstructModelDataSourceStrategy): void => {
|
188
193
|
if (!isSqlStrategy(strategy)) {
|
189
194
|
return;
|
190
195
|
}
|
191
196
|
|
192
197
|
const dbConnectionConfig = strategy.dbConnectionConfig;
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
strategy
|
198
|
-
|
199
|
-
|
198
|
+
if (isSqlModelDataSourceSsmDbConnectionConfig(dbConnectionConfig)) {
|
199
|
+
const invalidSSMPaths = Object.values(dbConnectionConfig).filter((value) => typeof value === 'string' && !isValidSSMPath(value));
|
200
|
+
if (invalidSSMPaths.length > 0) {
|
201
|
+
throw new Error(
|
202
|
+
`Invalid data source strategy "${
|
203
|
+
strategy.name
|
204
|
+
}". Following SSM paths must start with '/' in dbConnectionConfig: ${invalidSSMPaths.join(', ')}.`,
|
205
|
+
);
|
206
|
+
}
|
207
|
+
} else if (isSqlModelDataSourceSecretsManagerDbConnectionConfig(dbConnectionConfig)) {
|
208
|
+
if (!Token.isUnresolved(dbConnectionConfig.secretArn)) {
|
209
|
+
try {
|
210
|
+
const arnComponents = Arn.split(dbConnectionConfig.secretArn, ArnFormat.COLON_RESOURCE_NAME);
|
211
|
+
if (arnComponents.service !== 'secretsmanager' || arnComponents.resource !== 'secret') {
|
212
|
+
// error message does not matter because it inside try/catch
|
213
|
+
throw new Error();
|
214
|
+
}
|
215
|
+
} catch {
|
216
|
+
throw new Error(`Invalid data source strategy "${strategy.name}". The value of secretArn is not a valid Secrets Manager ARN.`);
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
if (dbConnectionConfig.keyArn && !Token.isUnresolved(dbConnectionConfig.keyArn)) {
|
221
|
+
try {
|
222
|
+
const arnComponents = Arn.split(dbConnectionConfig.keyArn, ArnFormat.SLASH_RESOURCE_NAME);
|
223
|
+
if (arnComponents.service !== 'kms' || arnComponents.resource !== 'key') {
|
224
|
+
// error message does not matter because it inside try/catch
|
225
|
+
throw new Error();
|
226
|
+
}
|
227
|
+
} catch {
|
228
|
+
throw new Error(`Invalid data source strategy "${strategy.name}". The value of keyArn is not a valid KMS ARN.`);
|
229
|
+
}
|
230
|
+
}
|
231
|
+
} else {
|
232
|
+
throw new Error(`Invalid data source strategy "${strategy.name}". dbConnectionConfig does not include SSM paths or Secret ARN.`);
|
200
233
|
}
|
201
234
|
};
|
202
235
|
|
@@ -116,12 +116,44 @@ export interface SubnetAvailabilityZone {
|
|
116
116
|
readonly availabilityZone: string;
|
117
117
|
}
|
118
118
|
|
119
|
+
/**
|
120
|
+
* The credentials the lambda data source will use to connect to the database.
|
121
|
+
*
|
122
|
+
* @experimental
|
123
|
+
*/
|
124
|
+
export type SqlModelDataSourceDbConnectionConfig =
|
125
|
+
| SqlModelDataSourceSecretsManagerDbConnectionConfig
|
126
|
+
| SqlModelDataSourceSsmDbConnectionConfig;
|
127
|
+
|
128
|
+
/**
|
129
|
+
* The credentials stored in Secrets Manager that the lambda data source will use to connect to the database.
|
130
|
+
*
|
131
|
+
* The managed secret should be in the same region as the lambda.
|
132
|
+
* @experimental
|
133
|
+
*/
|
134
|
+
export interface SqlModelDataSourceSecretsManagerDbConnectionConfig {
|
135
|
+
/** The ARN of the managed secret with username, password, and hostname to use when connecting to the database. **/
|
136
|
+
readonly secretArn: string;
|
137
|
+
|
138
|
+
/** The ARN of the customer managed encryption key for the secret. If not supplied, the secret is expected to be encrypted with the default AWS-managed key. **/
|
139
|
+
readonly keyArn?: string;
|
140
|
+
|
141
|
+
/** The port number of the database proxy, cluster, or instance. */
|
142
|
+
readonly port: number;
|
143
|
+
|
144
|
+
/** The database name. */
|
145
|
+
readonly databaseName: string;
|
146
|
+
|
147
|
+
/** The hostame of the database. */
|
148
|
+
readonly hostname: string;
|
149
|
+
}
|
150
|
+
|
119
151
|
/**
|
120
152
|
* The Secure Systems Manager parameter paths the Lambda data source will use to connect to the database.
|
121
153
|
*
|
122
154
|
* These parameters are retrieved from Secure Systems Manager in the same region as the Lambda.
|
123
155
|
*/
|
124
|
-
export interface
|
156
|
+
export interface SqlModelDataSourceSsmDbConnectionConfig {
|
125
157
|
/** The Secure Systems Manager parameter containing the hostname of the database. For RDS-based SQL data sources, this can be the hostname
|
126
158
|
* of a database proxy, cluster, or instance.
|
127
159
|
*/
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import * as fs from 'fs';
|
2
2
|
import * as path from 'path';
|
3
3
|
import { isSqlDbType } from '@aws-amplify/graphql-transformer-core';
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
SQLLambdaModelDataSourceStrategy,
|
6
|
+
SqlModelDataSourceDbConnectionConfig,
|
7
|
+
SqlModelDataSourceSsmDbConnectionConfig,
|
8
|
+
SqlModelDataSourceSecretsManagerDbConnectionConfig,
|
9
|
+
} from './model-datasource-strategy-types';
|
5
10
|
|
6
11
|
/**
|
7
12
|
* Type predicate that returns true if the object is a SQLLambdaModelDataSourceStrategy.
|
@@ -24,6 +29,15 @@ export const isSQLLambdaModelDataSourceStrategy = (obj: any): obj is SQLLambdaMo
|
|
24
29
|
* @returns true if the object is shaped like a SqlModelDataSourceDbConnectionConfig
|
25
30
|
*/
|
26
31
|
export const isSqlModelDataSourceDbConnectionConfig = (obj: any): obj is SqlModelDataSourceDbConnectionConfig => {
|
32
|
+
return isSqlModelDataSourceSsmDbConnectionConfig(obj) || isSqlModelDataSourceSecretsManagerDbConnectionConfig(obj);
|
33
|
+
};
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Type predicate that returns true if the object is a SqlModelDataSourceSsmDbConnectionConfig.
|
37
|
+
* @param obj the object to inspect
|
38
|
+
* @returns true if the object is shaped like a SqlModelDataSourceSsmDbConnectionConfig
|
39
|
+
*/
|
40
|
+
export const isSqlModelDataSourceSsmDbConnectionConfig = (obj: any): obj is SqlModelDataSourceSsmDbConnectionConfig => {
|
27
41
|
return (
|
28
42
|
(typeof obj === 'object' || typeof obj === 'function') &&
|
29
43
|
typeof obj.hostnameSsmPath === 'string' &&
|
@@ -34,6 +48,23 @@ export const isSqlModelDataSourceDbConnectionConfig = (obj: any): obj is SqlMode
|
|
34
48
|
);
|
35
49
|
};
|
36
50
|
|
51
|
+
/**
|
52
|
+
* Type predicate that returns true if the object is a SqlModelDataSourceSecretsManagerDbConnectionConfig.
|
53
|
+
* @param obj the object to inspect
|
54
|
+
* @returns true if the object is shaped like a SqlModelDataSourceSecretsManagerDbConnectionConfig
|
55
|
+
*/
|
56
|
+
export const isSqlModelDataSourceSecretsManagerDbConnectionConfig = (
|
57
|
+
obj: any,
|
58
|
+
): obj is SqlModelDataSourceSecretsManagerDbConnectionConfig => {
|
59
|
+
return (
|
60
|
+
(typeof obj === 'object' || typeof obj === 'function') &&
|
61
|
+
typeof obj.secretArn === 'string' &&
|
62
|
+
typeof obj.port === 'number' &&
|
63
|
+
typeof obj.databaseName === 'string' &&
|
64
|
+
typeof obj.hostname == 'string'
|
65
|
+
);
|
66
|
+
};
|
67
|
+
|
37
68
|
/**
|
38
69
|
* Class exposing utilities to produce SQLLambdaModelDataSourceStrategy objects given various inputs.
|
39
70
|
*/
|
@@ -1,13 +0,0 @@
|
|
1
|
-
export declare const TYPESCRIPT_DATA_SCHEMA_CONSTANTS: {
|
2
|
-
SCHEMA_PACKAGE: string;
|
3
|
-
MODEL_METHOD: string;
|
4
|
-
SCHEMA_METHOD: string;
|
5
|
-
IDENTIFIER_METHOD: string;
|
6
|
-
ARRAY_METHOD: string;
|
7
|
-
REQUIRED_METHOD: string;
|
8
|
-
STRING_METHOD: string;
|
9
|
-
ENUM_METHOD: string;
|
10
|
-
REFERENCE_A: string;
|
11
|
-
EXPORT_VARIABLE_NAME: string;
|
12
|
-
};
|
13
|
-
//# sourceMappingURL=TypescriptSchemaConstants.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TypescriptSchemaConstants.d.ts","sourceRoot":"","sources":["../src/TypescriptSchemaConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC;;;;;;;;;;;CAW5C,CAAC"}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.TYPESCRIPT_DATA_SCHEMA_CONSTANTS = void 0;
|
4
|
-
exports.TYPESCRIPT_DATA_SCHEMA_CONSTANTS = {
|
5
|
-
SCHEMA_PACKAGE: '@aws-amplify/data-schema',
|
6
|
-
MODEL_METHOD: 'model',
|
7
|
-
SCHEMA_METHOD: 'schema',
|
8
|
-
IDENTIFIER_METHOD: 'identifier',
|
9
|
-
ARRAY_METHOD: 'array',
|
10
|
-
REQUIRED_METHOD: 'required',
|
11
|
-
STRING_METHOD: 'string',
|
12
|
-
ENUM_METHOD: 'enum',
|
13
|
-
REFERENCE_A: 'a',
|
14
|
-
EXPORT_VARIABLE_NAME: 'schema',
|
15
|
-
};
|
16
|
-
//# sourceMappingURL=TypescriptSchemaConstants.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TypescriptSchemaConstants.js","sourceRoot":"","sources":["../src/TypescriptSchemaConstants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gCAAgC,GAAG;IAC9C,cAAc,EAAE,0BAA0B;IAC1C,YAAY,EAAE,OAAO;IACrB,aAAa,EAAE,QAAQ;IACvB,iBAAiB,EAAE,YAAY;IAC/B,YAAY,EAAE,OAAO;IACrB,eAAe,EAAE,UAAU;IAC3B,aAAa,EAAE,QAAQ;IACvB,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,GAAG;IAChB,oBAAoB,EAAE,QAAQ;CAC/B,CAAC"}
|
File without changes
|