@aws-amplify/graphql-api-construct 1.1.3 → 1.2.0-amplify-table-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/.jsii +153 -100
  2. package/API.md +4 -0
  3. package/CHANGELOG.md +16 -0
  4. package/README.md +9 -3
  5. package/lib/amplify-graphql-api.d.ts +9 -3
  6. package/lib/amplify-graphql-api.js +11 -5
  7. package/lib/amplify-graphql-definition.js +1 -1
  8. package/lib/internal/codegen-assets.js +6 -1
  9. package/lib/internal/construct-exports.js +7 -1
  10. package/lib/internal/default-parameters.js +2 -1
  11. package/lib/types.d.ts +15 -4
  12. package/lib/types.js +1 -1
  13. package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +8 -0
  14. package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +10 -10
  15. package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +8 -0
  16. package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +7 -7
  17. package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +8 -0
  18. package/node_modules/@aws-amplify/graphql-function-transformer/package.json +6 -6
  19. package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +8 -0
  20. package/node_modules/@aws-amplify/graphql-http-transformer/package.json +6 -6
  21. package/node_modules/@aws-amplify/graphql-index-transformer/API.md +3 -0
  22. package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +11 -0
  23. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.d.ts +1 -1
  24. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.d.ts.map +1 -1
  25. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.js +2 -1
  26. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.js.map +1 -1
  27. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts +1 -0
  28. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts.map +1 -1
  29. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +26 -7
  30. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js.map +1 -1
  31. package/node_modules/@aws-amplify/graphql-index-transformer/package.json +7 -7
  32. package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +8 -0
  33. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
  34. package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +10 -10
  35. package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +12 -0
  36. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts.map +1 -1
  37. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js +4 -0
  38. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
  39. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
  40. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
  41. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
  42. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts +13 -0
  43. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -0
  44. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +167 -0
  45. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -0
  46. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +40 -0
  47. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -0
  48. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +242 -0
  49. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -0
  50. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts +13 -0
  51. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts.map +1 -0
  52. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +665 -0
  53. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js.map +1 -0
  54. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts +5 -2
  55. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
  56. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js +46 -60
  57. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js.map +1 -1
  58. package/node_modules/@aws-amplify/graphql-model-transformer/package.json +7 -6
  59. package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +8 -0
  60. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
  61. package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +6 -6
  62. package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +11 -0
  63. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts.map +1 -1
  64. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js +3 -10
  65. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js.map +1 -1
  66. package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +8 -8
  67. package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +8 -0
  68. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
  69. package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +7 -7
  70. package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +10 -0
  71. package/node_modules/@aws-amplify/graphql-transformer/package.json +14 -14
  72. package/node_modules/@aws-amplify/graphql-transformer-core/API.md +1 -0
  73. package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +12 -0
  74. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/output.d.ts +8 -1
  75. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/output.d.ts.map +1 -1
  76. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/output.js +60 -23
  77. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/output.js.map +1 -1
  78. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.d.ts.map +1 -1
  79. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.js +1 -0
  80. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.js.map +1 -1
  81. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/defaultSchema.d.ts +4 -1
  82. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/defaultSchema.d.ts.map +1 -1
  83. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/defaultSchema.js +35 -36
  84. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/defaultSchema.js.map +1 -1
  85. package/node_modules/@aws-amplify/graphql-transformer-core/package.json +4 -4
  86. package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +1 -0
  87. package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +6 -0
  88. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transform-parameters.d.ts +1 -0
  89. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transform-parameters.d.ts.map +1 -1
  90. package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +2 -2
  91. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transform-parameters.ts +1 -0
  92. package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
  93. package/node_modules/graphql-transformer-common/API.md +3 -0
  94. package/node_modules/graphql-transformer-common/CHANGELOG.md +6 -0
  95. package/node_modules/graphql-transformer-common/LICENSE +201 -0
  96. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts +3 -0
  97. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts.map +1 -1
  98. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js +3 -0
  99. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js.map +1 -1
  100. package/node_modules/graphql-transformer-common/package.json +3 -2
  101. package/node_modules/zod/README.md +215 -120
  102. package/node_modules/zod/lib/ZodError.js +8 -0
  103. package/node_modules/zod/lib/helpers/parseUtil.js +3 -2
  104. package/node_modules/zod/lib/helpers/util.js +4 -4
  105. package/node_modules/zod/lib/index.mjs +121 -57
  106. package/node_modules/zod/lib/index.umd.js +121 -56
  107. package/node_modules/zod/lib/types.d.ts +55 -10
  108. package/node_modules/zod/lib/types.js +301 -58
  109. package/node_modules/zod/package.json +29 -15
  110. package/package.json +17 -17
  111. package/src/amplify-graphql-api.ts +9 -3
  112. package/src/internal/codegen-assets.ts +5 -0
  113. package/src/internal/construct-exports.ts +6 -0
  114. package/src/internal/default-parameters.ts +1 -0
  115. package/src/types.ts +18 -4
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod",
3
- "version": "3.21.4",
3
+ "version": "3.22.4",
4
4
  "author": "Colin McDonnell <colin@colinhacks.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,12 +9,18 @@
9
9
  "main": "./lib/index.js",
10
10
  "module": "./lib/index.mjs",
11
11
  "devDependencies": {
12
+ "@babel/core": "^7.22.5",
13
+ "@babel/preset-env": "^7.22.5",
14
+ "@babel/preset-typescript": "^7.22.5",
12
15
  "@rollup/plugin-typescript": "^8.2.0",
16
+ "@swc/core": "^1.3.66",
17
+ "@swc/jest": "^0.2.26",
13
18
  "@types/benchmark": "^2.1.0",
14
19
  "@types/jest": "^29.2.2",
15
20
  "@types/node": "14",
16
21
  "@typescript-eslint/eslint-plugin": "^5.15.0",
17
22
  "@typescript-eslint/parser": "^5.15.0",
23
+ "babel-jest": "^29.5.0",
18
24
  "benchmark": "^2.1.4",
19
25
  "dependency-cruiser": "^9.19.0",
20
26
  "eslint": "^8.11.0",
@@ -30,18 +36,19 @@
30
36
  "prettier": "^2.6.0",
31
37
  "pretty-quick": "^3.1.3",
32
38
  "rollup": "^2.70.1",
33
- "ts-jest": "^29.0.3",
39
+ "ts-jest": "^29.1.0",
34
40
  "ts-morph": "^14.0.0",
35
41
  "ts-node": "^10.9.1",
36
42
  "tslib": "^2.3.1",
37
43
  "tsx": "^3.8.0",
38
- "typescript": "~4.5.0"
44
+ "typescript": "~4.5.0",
45
+ "vitest": "^0.32.2"
39
46
  },
40
47
  "exports": {
41
48
  ".": {
49
+ "types": "./index.d.ts",
42
50
  "require": "./lib/index.js",
43
- "import": "./lib/index.mjs",
44
- "types": "./index.d.ts"
51
+ "import": "./lib/index.mjs"
45
52
  },
46
53
  "./package.json": "./package.json",
47
54
  "./locales/*": "./lib/locales/*"
@@ -68,25 +75,32 @@
68
75
  "src/*.ts": [
69
76
  "eslint --cache --fix",
70
77
  "prettier --ignore-unknown --write"
78
+ ],
79
+ "*.md": [
80
+ "prettier --ignore-unknown --write"
71
81
  ]
72
82
  },
73
83
  "scripts": {
74
- "prettier:check": "prettier --check src/**/*.ts deno/lib/**/*.ts --no-error-on-unmatched-pattern",
75
- "prettier:fix": "prettier --write src/**/*.ts deno/lib/**/*.ts --ignore-unknown --no-error-on-unmatched-pattern",
84
+ "prettier:check": "prettier --check src/**/*.ts deno/lib/**/*.ts *.md --no-error-on-unmatched-pattern",
85
+ "prettier:fix": "prettier --write src/**/*.ts deno/lib/**/*.ts *.md --ignore-unknown --no-error-on-unmatched-pattern",
76
86
  "lint:check": "eslint --cache --ext .ts ./src",
77
87
  "lint:fix": "eslint --cache --fix --ext .ts ./src",
78
88
  "check": "yarn lint:check && yarn prettier:check",
79
89
  "fix": "yarn lint:fix && yarn prettier:fix",
80
90
  "clean": "rm -rf lib/* deno/lib/*",
81
91
  "build": "yarn run clean && npm run build:cjs && npm run build:esm && npm run build:deno",
82
- "build:deno": "node ./deno/build.mjs && cp ./README.md ./deno/lib",
83
- "build:esm": "rollup --config rollup.config.js",
84
- "build:cjs": "tsc -p tsconfig.cjs.json",
85
- "build:types": "tsc -p tsconfig.types.json",
86
- "build:test": "tsc -p tsconfig.test.json",
87
- "rollup": "rollup --config rollup.config.js",
88
- "test:watch": "jest --watch",
89
- "test": "jest --coverage",
92
+ "build:deno": "node ./deno-build.mjs && cp ./README.md ./deno/lib",
93
+ "build:esm": "rollup --config ./configs/rollup.config.js",
94
+ "build:cjs": "tsc -p ./configs/tsconfig.cjs.json",
95
+ "build:types": "tsc -p ./configs/tsconfig.types.json",
96
+ "build:test": "tsc -p ./configs/tsconfig.test.json",
97
+ "test:watch": "yarn test:ts-jest --watch",
98
+ "test": "yarn test:ts-jest",
99
+ "test:babel": "jest --coverage --config ./configs/babel-jest.config.json",
100
+ "test:bun": "bun test",
101
+ "test:vitest": "npx vitest --config ./configs/vitest.config.ts",
102
+ "test:ts-jest": "npx jest --config ./configs/ts-jest.config.json",
103
+ "test:swc": "npx jest --config ./configs/swc-jest.config.json",
90
104
  "test:deno": "cd deno && deno test",
91
105
  "prepublishOnly": "npm run test && npm run build && npm run build:deno",
92
106
  "play": "nodemon -e ts -w . -x tsx playground.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/graphql-api-construct",
3
- "version": "1.1.3",
3
+ "version": "1.2.0-amplify-table-preview.0",
4
4
  "description": "AppSync GraphQL Api Construct using Amplify GraphQL Transformer.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -76,26 +76,26 @@
76
76
  "dependencies": {
77
77
  "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.6",
78
78
  "@aws-amplify/backend-output-storage": "^0.1.1-alpha.2",
79
- "@aws-amplify/graphql-auth-transformer": "3.1.7",
80
- "@aws-amplify/graphql-default-value-transformer": "2.1.6",
81
- "@aws-amplify/graphql-function-transformer": "2.1.5",
82
- "@aws-amplify/graphql-http-transformer": "2.1.5",
83
- "@aws-amplify/graphql-index-transformer": "2.1.6",
84
- "@aws-amplify/graphql-maps-to-transformer": "3.2.3",
85
- "@aws-amplify/graphql-model-transformer": "2.2.2",
86
- "@aws-amplify/graphql-predictions-transformer": "2.1.5",
87
- "@aws-amplify/graphql-relational-transformer": "2.1.6",
88
- "@aws-amplify/graphql-searchable-transformer": "2.2.2",
89
- "@aws-amplify/graphql-transformer": "1.2.3",
90
- "@aws-amplify/graphql-transformer-core": "2.2.2",
91
- "@aws-amplify/graphql-transformer-interfaces": "3.2.1",
79
+ "@aws-amplify/graphql-auth-transformer": "3.1.9-amplify-table-preview.0",
80
+ "@aws-amplify/graphql-default-value-transformer": "2.1.8-amplify-table-preview.0",
81
+ "@aws-amplify/graphql-function-transformer": "2.1.7-amplify-table-preview.0",
82
+ "@aws-amplify/graphql-http-transformer": "2.1.7-amplify-table-preview.0",
83
+ "@aws-amplify/graphql-index-transformer": "2.2.0-amplify-table-preview.0",
84
+ "@aws-amplify/graphql-maps-to-transformer": "3.2.5-amplify-table-preview.0",
85
+ "@aws-amplify/graphql-model-transformer": "2.3.0-amplify-table-preview.0",
86
+ "@aws-amplify/graphql-predictions-transformer": "2.1.7-amplify-table-preview.0",
87
+ "@aws-amplify/graphql-relational-transformer": "2.2.0-amplify-table-preview.0",
88
+ "@aws-amplify/graphql-searchable-transformer": "2.2.4-amplify-table-preview.0",
89
+ "@aws-amplify/graphql-transformer": "1.3.0-amplify-table-preview.0",
90
+ "@aws-amplify/graphql-transformer-core": "2.3.0-amplify-table-preview.0",
91
+ "@aws-amplify/graphql-transformer-interfaces": "3.3.0-amplify-table-preview.0",
92
92
  "charenc": "^0.0.2",
93
93
  "crypt": "^0.0.2",
94
94
  "fs-extra": "^8.1.0",
95
95
  "graceful-fs": "^4.2.11",
96
96
  "graphql": "^15.5.0",
97
97
  "graphql-mapping-template": "4.20.12",
98
- "graphql-transformer-common": "4.25.1",
98
+ "graphql-transformer-common": "4.26.0-amplify-table-preview.0",
99
99
  "hjson": "^3.2.2",
100
100
  "immer": "^9.0.12",
101
101
  "is-buffer": "^2.0.5",
@@ -107,7 +107,7 @@
107
107
  "pluralize": "^8.0.0",
108
108
  "ts-dedent": "^2.0.0",
109
109
  "universalify": "^2.0.0",
110
- "zod": "^3.21.4"
110
+ "zod": "^3.22.3"
111
111
  },
112
112
  "devDependencies": {
113
113
  "@types/fs-extra": "^8.0.1",
@@ -162,5 +162,5 @@
162
162
  }
163
163
  }
164
164
  },
165
- "gitHead": "58c67c5534f7838371ef64b5ee23f2f406817f70"
165
+ "gitHead": "7d153ff268ff8e8fab43105b5e9ea6611adfc2dd"
166
166
  }
@@ -64,12 +64,18 @@ import {
64
64
  *
65
65
  * For a full reference of the supported custom graphql directives - https://docs.amplify.aws/cli/graphql/directives-reference/
66
66
  *
67
- * The output of this construct is a mapping of L1 resources generated by the transformer, which generally follow the access pattern
67
+ * The output of this construct is a mapping of L2 or L1 resources generated by the transformer, which generally follow the access pattern
68
68
  *
69
69
  * ```typescript
70
70
  * const api = new AmplifyGraphQlApi(this, 'api', { <params> });
71
- * api.resources.api.xrayEnabled = true;
72
- * Object.values(api.resources.tables).forEach(table => table.pointInTimeRecoverySpecification = { pointInTimeRecoveryEnabled: false });
71
+ * // Access L2 resources under `.resources`
72
+ * api.resources.tables["Todo"].tableArn;
73
+ *
74
+ * // Access L1 resources under `.resources.cfnResources`
75
+ * api.resources.cfnResources.cfnGraphqlApi.xrayEnabled = true;
76
+ * Object.values(api.resources.cfnResources.cfnTables).forEach(table => {
77
+ * table.pointInTimeRecoverySpecification = { pointInTimeRecoveryEnabled: false };
78
+ * });
73
79
  * ```
74
80
  * `resources.<ResourceType>.<ResourceName>` - you can then perform any CDK action on these resulting resoureces.
75
81
  */
@@ -35,6 +35,11 @@ export class CodegenAssets extends Construct {
35
35
  new BucketDeployment(this, `${id}Deployment`, {
36
36
  destinationBucket: bucket,
37
37
  sources: [Source.data(MODEL_SCHEMA_KEY, props.modelSchema)],
38
+ // Bucket deployment uses a Lambda that runs AWS S3 CLI to transfer assets to destination bucket.
39
+ // That Lambda requires higher memory setting to run fast even when processing small assets (less than 1kB).
40
+ // This setting has been established experimentally. Benchmark can be found in pull request description that established it.
41
+ // The value has been chosen to prefer the lowest cost (run time * memory demand) while providing reasonable performance.
42
+ memoryLimit: 1536,
38
43
  });
39
44
 
40
45
  this.modelSchemaS3Uri = getS3UriForBucketAndKey(bucket, MODEL_SCHEMA_KEY);
@@ -33,6 +33,7 @@ export const getGeneratedResources = (scope: Construct): AmplifyGraphqlApiResour
33
33
  const cfnDataSources: Record<string, CfnDataSource> = {};
34
34
  const tables: Record<string, Table> = {};
35
35
  const cfnTables: Record<string, CfnTable> = {};
36
+ const cfnAmplifyTables: Record<string, CfnResource> = {};
36
37
  const roles: Record<string, Role> = {};
37
38
  const cfnRoles: Record<string, CfnRole> = {};
38
39
  const functions: Record<string, LambdaFunction> = {};
@@ -77,6 +78,10 @@ export const getGeneratedResources = (scope: Construct): AmplifyGraphqlApiResour
77
78
  cfnTables[resourceName] = currentScope;
78
79
  return;
79
80
  }
81
+ if (currentScope instanceof CfnResource && currentScope.cfnResourceType === 'Custom::AmplifyDynamoDBTable') {
82
+ cfnAmplifyTables[resourceName] = currentScope;
83
+ return;
84
+ }
80
85
  if (currentScope instanceof Role) {
81
86
  roles[resourceName] = currentScope;
82
87
  return;
@@ -132,6 +137,7 @@ export const getGeneratedResources = (scope: Construct): AmplifyGraphqlApiResour
132
137
  cfnFunctionConfigurations,
133
138
  cfnDataSources,
134
139
  cfnTables,
140
+ cfnAmplifyTables,
135
141
  cfnRoles,
136
142
  cfnFunctions,
137
143
  additionalCfnResources,
@@ -16,5 +16,6 @@ export const defaultTranslationBehavior: TranslationBehavior = {
16
16
  enableAutoIndexQueryNames: true,
17
17
  respectPrimaryKeyAttributesOnConnectionField: true,
18
18
  enableSearchNodeToNodeEncryption: false,
19
+ useAmplifyManagedTableResources: false, // TODO: flip to true once all implementations are finished
19
20
  enableTransformerCfnOutputs: false,
20
21
  };
package/src/types.ts CHANGED
@@ -393,12 +393,14 @@ export interface TranslationBehavior {
393
393
  readonly respectPrimaryKeyAttributesOnConnectionField: boolean;
394
394
 
395
395
  /**
396
- * If enabled, set nodeToNodeEncryption on the searchable domain (if one exists). Not recommended for use, prefer
397
- * to use `Object.values(resources.additionalResources['AWS::Elasticsearch::Domain']).forEach((domain: CfnDomain) => {
398
- * domain.NodeToNodeEncryptionOptions = { Enabled: True };
399
- * });
396
+ * Used for AmplifyGrapqhlApi construct ONLY
397
+ * If enabled, the table resources will be generated under custom resource provider,
398
+ * which enables the multiple GSI updates within one deployment phase
400
399
  * @default false
400
+ * @experimental
401
401
  */
402
+ readonly useAmplifyManagedTableResources: boolean;
403
+
402
404
  readonly enableSearchNodeToNodeEncryption: boolean;
403
405
 
404
406
  /**
@@ -484,6 +486,13 @@ export interface PartialTranslationBehavior {
484
486
  * @default false
485
487
  */
486
488
  readonly enableTransformerCfnOutputs?: boolean;
489
+
490
+ /**
491
+ * When enabled, amplify DynamoDB table will be generated instead of CFN pre-defined DynamoDB table
492
+ * @default false
493
+ * @experimental
494
+ */
495
+ readonly useAmplifyManagedTableResources?: boolean;
487
496
  }
488
497
 
489
498
  /**
@@ -647,6 +656,11 @@ export interface AmplifyGraphqlApiCfnResources {
647
656
  */
648
657
  readonly cfnTables: Record<string, CfnTable>;
649
658
 
659
+ /**
660
+ * The Generated Amplify DynamoDB Table L1 Resources, keyed by model name.
661
+ */
662
+ readonly cfnAmplifyTables: Record<string, CfnResource>;
663
+
650
664
  /**
651
665
  * The Generated IAM Role L1 Resources, keyed by logicalId.
652
666
  */