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

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amplify-dynamo-model-resource-generator.js","sourceRoot":"","sources":["../../../src/resources/amplify-dynamodb-table/amplify-dynamo-model-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B,EAAE,KAAK,EAAE,IAAI,EAAE,0BAA0B,CAAC,CAAC;IAC9G,CAAC;CACF;AA9KD,kFA8KC"}
@@ -0,0 +1,40 @@
1
+ import { aws_kms as kms, Resource } from 'aws-cdk-lib';
2
+ import { GlobalSecondaryIndexProps, ITable, LocalSecondaryIndexProps, SchemaOptions, TableProps } from 'aws-cdk-lib/aws-dynamodb';
3
+ import { Construct } from 'constructs';
4
+ export declare const CUSTOM_DDB_CFN_TYPE = "Custom::AmplifyDynamoDBTable";
5
+ export interface AmplifyDynamoDBTableProps extends TableProps {
6
+ customResourceServiceToken: string;
7
+ }
8
+ export declare class AmplifyDynamoDBTable extends Resource {
9
+ readonly encryptionKey?: kms.IKey;
10
+ readonly tableArn: string;
11
+ readonly tableName: string;
12
+ readonly tableStreamArn: string | undefined;
13
+ readonly tableFromAttr: ITable;
14
+ private readonly customResourceServiceToken;
15
+ private readonly table;
16
+ private readonly keySchema;
17
+ private readonly attributeDefinitions;
18
+ private readonly globalSecondaryIndexes;
19
+ private readonly localSecondaryIndexes;
20
+ private readonly secondaryIndexSchemas;
21
+ private readonly nonKeyAttributes;
22
+ private readonly tablePartitionKey;
23
+ private readonly tableSortKey?;
24
+ private readonly billingMode;
25
+ constructor(scope: Construct, id: string, props: AmplifyDynamoDBTableProps);
26
+ addGlobalSecondaryIndex(props: GlobalSecondaryIndexProps): void;
27
+ addLocalSecondaryIndex(props: LocalSecondaryIndexProps): void;
28
+ schema(indexName?: string): SchemaOptions;
29
+ private addKey;
30
+ private findKey;
31
+ private registerAttribute;
32
+ private validateTable;
33
+ private parseEncryption;
34
+ private validateProvisioning;
35
+ private validateIndexName;
36
+ private validateNonKeyAttributes;
37
+ private buildIndexKeySchema;
38
+ private buildIndexProjection;
39
+ }
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.ts"],"names":[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AAE,yBAAyB;IAgCxD,sBAAsB,CAAC,KAAK,EAAE,wBAAwB;IA6BtD,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,aAAa;IAchD,OAAO,CAAC,MAAM;IAad,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,eAAe;IAyDvB,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,oBAAoB;CAoB7B"}
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AmplifyDynamoDBTable = exports.CUSTOM_DDB_CFN_TYPE = void 0;
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_dynamodb_1 = require("aws-cdk-lib/aws-dynamodb");
6
+ const HASH_KEY_TYPE = 'HASH';
7
+ const RANGE_KEY_TYPE = 'RANGE';
8
+ const MAX_LOCAL_SECONDARY_INDEX_COUNT = 5;
9
+ exports.CUSTOM_DDB_CFN_TYPE = 'Custom::AmplifyDynamoDBTable';
10
+ class AmplifyDynamoDBTable extends aws_cdk_lib_1.Resource {
11
+ constructor(scope, id, props) {
12
+ var _a;
13
+ super(scope, id, {
14
+ physicalName: props.tableName,
15
+ });
16
+ this.keySchema = new Array();
17
+ this.attributeDefinitions = new Array();
18
+ this.globalSecondaryIndexes = new Array();
19
+ this.localSecondaryIndexes = new Array();
20
+ this.secondaryIndexSchemas = new Map();
21
+ this.nonKeyAttributes = new Set();
22
+ this.customResourceServiceToken = props.customResourceServiceToken;
23
+ this.tableName = this.physicalName;
24
+ const { sseSpecification, encryptionKey } = this.parseEncryption(props);
25
+ let streamSpecification;
26
+ this.billingMode = (_a = props.billingMode) !== null && _a !== void 0 ? _a : aws_dynamodb_1.BillingMode.PROVISIONED;
27
+ if (props.stream) {
28
+ streamSpecification = { streamViewType: props.stream };
29
+ }
30
+ this.validateProvisioning(props);
31
+ this.table = new aws_cdk_lib_1.CustomResource(this, 'Default', {
32
+ serviceToken: this.customResourceServiceToken,
33
+ resourceType: exports.CUSTOM_DDB_CFN_TYPE,
34
+ properties: {
35
+ tableName: this.tableName,
36
+ attributeDefinitions: this.attributeDefinitions,
37
+ keySchema: this.keySchema,
38
+ globalSecondaryIndexes: aws_cdk_lib_1.Lazy.any({ produce: () => this.globalSecondaryIndexes }, { omitEmptyArray: true }),
39
+ localSecondaryIndexes: aws_cdk_lib_1.Lazy.any({ produce: () => this.localSecondaryIndexes }, { omitEmptyArray: true }),
40
+ pointInTimeRecoverySpecification: props.pointInTimeRecovery != null ? { pointInTimeRecoveryEnabled: props.pointInTimeRecovery } : undefined,
41
+ billingMode: this.billingMode === aws_dynamodb_1.BillingMode.PAY_PER_REQUEST ? this.billingMode : undefined,
42
+ provisionedThroughput: this.billingMode === aws_dynamodb_1.BillingMode.PAY_PER_REQUEST
43
+ ? undefined
44
+ : {
45
+ readCapacityUnits: props.readCapacity || 5,
46
+ writeCapacityUnits: props.writeCapacity || 5,
47
+ },
48
+ sseSpecification: sseSpecification,
49
+ streamSpecification: streamSpecification,
50
+ tableClass: props.tableClass,
51
+ timeToLiveSpecification: props.timeToLiveAttribute ? { attributeName: props.timeToLiveAttribute, enabled: true } : undefined,
52
+ deletionProtectionEnabled: props.deletionProtection,
53
+ },
54
+ removalPolicy: props.removalPolicy,
55
+ });
56
+ this.encryptionKey = encryptionKey;
57
+ this.tableArn = this.table.getAttString('TableArn');
58
+ this.tableStreamArn = streamSpecification ? this.table.getAttString('TableStreamArn') : undefined;
59
+ this.tableFromAttr = aws_dynamodb_1.Table.fromTableAttributes(scope, `CustomTable${id}`, {
60
+ tableArn: this.tableArn,
61
+ tableStreamArn: this.tableStreamArn,
62
+ });
63
+ this.addKey(props.partitionKey, HASH_KEY_TYPE);
64
+ this.tablePartitionKey = props.partitionKey;
65
+ if (props.sortKey) {
66
+ this.addKey(props.sortKey, RANGE_KEY_TYPE);
67
+ this.tableSortKey = props.sortKey;
68
+ }
69
+ this.node.addValidation({ validate: () => this.validateTable() });
70
+ }
71
+ addGlobalSecondaryIndex(props) {
72
+ this.validateProvisioning(props);
73
+ this.validateIndexName(props.indexName);
74
+ const gsiKeySchema = this.buildIndexKeySchema(props.partitionKey, props.sortKey);
75
+ const gsiProjection = this.buildIndexProjection(props);
76
+ this.globalSecondaryIndexes.push({
77
+ indexName: props.indexName,
78
+ keySchema: gsiKeySchema,
79
+ projection: gsiProjection,
80
+ provisionedThroughput: this.billingMode === aws_dynamodb_1.BillingMode.PAY_PER_REQUEST
81
+ ? undefined
82
+ : {
83
+ readCapacityUnits: props.readCapacity || 5,
84
+ writeCapacityUnits: props.writeCapacity || 5,
85
+ },
86
+ });
87
+ this.secondaryIndexSchemas.set(props.indexName, {
88
+ partitionKey: props.partitionKey,
89
+ sortKey: props.sortKey,
90
+ });
91
+ }
92
+ addLocalSecondaryIndex(props) {
93
+ if (this.localSecondaryIndexes.length >= MAX_LOCAL_SECONDARY_INDEX_COUNT) {
94
+ throw new RangeError(`a maximum number of local secondary index per table is ${MAX_LOCAL_SECONDARY_INDEX_COUNT}`);
95
+ }
96
+ this.validateIndexName(props.indexName);
97
+ const lsiKeySchema = this.buildIndexKeySchema(this.tablePartitionKey, props.sortKey);
98
+ const lsiProjection = this.buildIndexProjection(props);
99
+ this.localSecondaryIndexes.push({
100
+ indexName: props.indexName,
101
+ keySchema: lsiKeySchema,
102
+ projection: lsiProjection,
103
+ });
104
+ this.secondaryIndexSchemas.set(props.indexName, {
105
+ partitionKey: this.tablePartitionKey,
106
+ sortKey: props.sortKey,
107
+ });
108
+ }
109
+ schema(indexName) {
110
+ if (!indexName) {
111
+ return {
112
+ partitionKey: this.tablePartitionKey,
113
+ sortKey: this.tableSortKey,
114
+ };
115
+ }
116
+ let schema = this.secondaryIndexSchemas.get(indexName);
117
+ if (!schema) {
118
+ throw new Error(`Cannot find schema for index: ${indexName}. Use 'addGlobalSecondaryIndex' or 'addLocalSecondaryIndex' to add index`);
119
+ }
120
+ return schema;
121
+ }
122
+ addKey(attribute, keyType) {
123
+ const existingProp = this.findKey(keyType);
124
+ if (existingProp) {
125
+ throw new Error(`Unable to set ${attribute.name} as a ${keyType} key, because ${existingProp.attributeName} is a ${keyType} key`);
126
+ }
127
+ this.registerAttribute(attribute);
128
+ this.keySchema.push({
129
+ attributeName: attribute.name,
130
+ keyType,
131
+ });
132
+ return this;
133
+ }
134
+ findKey(keyType) {
135
+ return this.keySchema.find((prop) => prop.keyType === keyType);
136
+ }
137
+ registerAttribute(attribute) {
138
+ const { name, type } = attribute;
139
+ const existingDef = this.attributeDefinitions.find((def) => def.attributeName === name);
140
+ if (existingDef && existingDef.attributeType !== type) {
141
+ throw new Error(`Unable to specify ${name} as ${type} because it was already defined as ${existingDef.attributeType}`);
142
+ }
143
+ if (!existingDef) {
144
+ this.attributeDefinitions.push({
145
+ attributeName: name,
146
+ attributeType: type,
147
+ });
148
+ }
149
+ }
150
+ validateTable() {
151
+ const errors = new Array();
152
+ if (!this.tablePartitionKey) {
153
+ errors.push('a partition key must be specified');
154
+ }
155
+ if (this.localSecondaryIndexes.length > 0 && !this.tableSortKey) {
156
+ errors.push('a sort key of the table must be specified to add local secondary indexes');
157
+ }
158
+ return errors;
159
+ }
160
+ parseEncryption(props) {
161
+ var _a;
162
+ let encryptionType = props.encryption;
163
+ if (encryptionType === undefined) {
164
+ encryptionType =
165
+ props.encryptionKey != null
166
+ ?
167
+ aws_dynamodb_1.TableEncryption.CUSTOMER_MANAGED
168
+ :
169
+ aws_dynamodb_1.TableEncryption.AWS_MANAGED;
170
+ }
171
+ if (encryptionType !== aws_dynamodb_1.TableEncryption.CUSTOMER_MANAGED && props.encryptionKey) {
172
+ throw new Error('`encryptionKey cannot be specified unless encryption is set to TableEncryption.CUSTOMER_MANAGED (it was set to ${encryptionType})`');
173
+ }
174
+ if (encryptionType === aws_dynamodb_1.TableEncryption.CUSTOMER_MANAGED && props.replicationRegions) {
175
+ throw new Error('TableEncryption.CUSTOMER_MANAGED is not supported by DynamoDB Global Tables (where replicationRegions was set)');
176
+ }
177
+ switch (encryptionType) {
178
+ case aws_dynamodb_1.TableEncryption.CUSTOMER_MANAGED:
179
+ const encryptionKey = (_a = props.encryptionKey) !== null && _a !== void 0 ? _a : new aws_cdk_lib_1.aws_kms.Key(this, 'Key', {
180
+ description: `Customer-managed key auto-created for encrypting DynamoDB table at ${this.node.path}`,
181
+ enableKeyRotation: true,
182
+ });
183
+ return {
184
+ sseSpecification: { sseEnabled: true, kmsMasterKeyId: encryptionKey.keyArn, sseType: 'KMS' },
185
+ encryptionKey,
186
+ };
187
+ case aws_dynamodb_1.TableEncryption.AWS_MANAGED:
188
+ return { sseSpecification: { sseEnabled: true } };
189
+ case aws_dynamodb_1.TableEncryption.DEFAULT:
190
+ return { sseSpecification: { sseEnabled: false } };
191
+ case undefined:
192
+ return { sseSpecification: undefined };
193
+ default:
194
+ throw new Error(`Unexpected 'encryptionType': ${encryptionType}`);
195
+ }
196
+ }
197
+ validateProvisioning(props) {
198
+ if (this.billingMode === aws_dynamodb_1.BillingMode.PAY_PER_REQUEST) {
199
+ if (props.readCapacity !== undefined || props.writeCapacity !== undefined) {
200
+ throw new Error('you cannot provision read and write capacity for a table with PAY_PER_REQUEST billing mode');
201
+ }
202
+ }
203
+ }
204
+ validateIndexName(indexName) {
205
+ if (this.secondaryIndexSchemas.has(indexName)) {
206
+ throw new Error(`a duplicate index name, ${indexName}, is not allowed`);
207
+ }
208
+ }
209
+ validateNonKeyAttributes(nonKeyAttributes) {
210
+ if (this.nonKeyAttributes.size + nonKeyAttributes.length > 100) {
211
+ throw new RangeError('a maximum number of nonKeyAttributes across all of secondary indexes is 100');
212
+ }
213
+ nonKeyAttributes.forEach((att) => this.nonKeyAttributes.add(att));
214
+ }
215
+ buildIndexKeySchema(partitionKey, sortKey) {
216
+ this.registerAttribute(partitionKey);
217
+ const indexKeySchema = [{ attributeName: partitionKey.name, keyType: HASH_KEY_TYPE }];
218
+ if (sortKey) {
219
+ this.registerAttribute(sortKey);
220
+ indexKeySchema.push({ attributeName: sortKey.name, keyType: RANGE_KEY_TYPE });
221
+ }
222
+ return indexKeySchema;
223
+ }
224
+ buildIndexProjection(props) {
225
+ var _a, _b;
226
+ if (props.projectionType === aws_dynamodb_1.ProjectionType.INCLUDE && !props.nonKeyAttributes) {
227
+ throw new Error(`non-key attributes should be specified when using ${aws_dynamodb_1.ProjectionType.INCLUDE} projection type`);
228
+ }
229
+ if (props.projectionType !== aws_dynamodb_1.ProjectionType.INCLUDE && props.nonKeyAttributes) {
230
+ throw new Error(`non-key attributes should not be specified when not using ${aws_dynamodb_1.ProjectionType.INCLUDE} projection type`);
231
+ }
232
+ if (props.nonKeyAttributes) {
233
+ this.validateNonKeyAttributes(props.nonKeyAttributes);
234
+ }
235
+ return {
236
+ projectionType: (_a = props.projectionType) !== null && _a !== void 0 ? _a : aws_dynamodb_1.ProjectionType.ALL,
237
+ nonKeyAttributes: (_b = props.nonKeyAttributes) !== null && _b !== void 0 ? _b : undefined,
238
+ };
239
+ }
240
+ }
241
+ exports.AmplifyDynamoDBTable = AmplifyDynamoDBTable;
242
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.ts"],"names":[],"mappings":";;;AAAA,6CAA6E;AAC7E,2DAckC;AAGlC,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,cAAc,GAAG,OAAO,CAAC;AAG/B,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAE7B,QAAA,mBAAmB,GAAG,8BAA8B,CAAC;AAKlE,MAAa,oBAAqB,SAAQ,sBAAQ;IAsBhD,YAAY,KAAgB,EAAE,EAAU,EAAE,KAAgC;;QACxE,KAAK,CAAC,KAAK,EAAE,EAAE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put, UpdateContinuousBackupsInput } from 'aws-sdk/clients/dynamodb';
3
+ export declare const onEvent: (event: AWSCDKAsyncCustomResource.OnEventRequest) => Promise<AWSCDKAsyncCustomResource.OnEventResponse>;
4
+ export declare const isComplete: (event: AWSCDKAsyncCustomResource.IsCompleteRequest) => Promise<AWSCDKAsyncCustomResource.IsCompleteResponse>;
5
+ export declare const getNextGSIUpdate: (currentState: TableDescription, endState: CustomDDB.Input) => UpdateTableInput | undefined;
6
+ export declare const getStreamUpdate: (currentState: TableDescription, endState: CustomDDB.Input) => Promise<UpdateTableInput | undefined>;
7
+ export declare const getSseUpdate: (currentState: TableDescription, endState: CustomDDB.Input) => UpdateTableInput | undefined;
8
+ export declare const getDeletionProtectionUpdate: (currentState: TableDescription, endState: CustomDDB.Input) => UpdateTableInput | undefined;
9
+ export declare const getTtlUpdate: (currentTTL: DynamoDB.TimeToLiveDescription | undefined, endState: CustomDDB.Input) => UpdateTimeToLiveInput | undefined;
10
+ export declare const getPointInTimeRecoveryUpdate: (currentPointInTime: DynamoDB.ContinuousBackupsDescription | undefined, endState: CustomDDB.Input) => UpdateContinuousBackupsInput | undefined;
11
+ export declare const extractTableInputFromEvent: (event: AWSCDKAsyncCustomResource.OnEventRequest | AWSCDKAsyncCustomResource.IsCompleteRequest) => CustomDDB.Input;
12
+ export declare const toCreateTableInput: (props: CustomDDB.Input) => CreateTableInput;
13
+ //# sourceMappingURL=amplify-table-manager-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amplify-table-manager-handler.d.ts","sourceRoot":"","sources":["../../../../src/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EACV,gBAAgB,EAGhB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AA4BlC,eAAO,MAAM,OAAO,UAAiB,0BAA0B,cAAc,KAAG,QAAQ,0BAA0B,eAAe,CAmLhI,CAAC;AAQF,eAAO,MAAM,UAAU,UACd,0BAA0B,iBAAiB,KACjD,QAAQ,0BAA0B,kBAAkB,CA8DtD,CAAC;AAQF,eAAO,MAAM,gBAAgB,iBAAkB,gBAAgB,YAAY,UAAU,KAAK,KAAG,gBAAgB,GAAG,SAsJ/G,CAAC;AASF,eAAO,MAAM,eAAe,iBAAwB,gBAAgB,YAAY,UAAU,KAAK,KAAG,QAAQ,gBAAgB,GAAG,SAAS,CAmCrI,CAAC;AAQF,eAAO,MAAM,YAAY,iBAAkB,gBAAgB,YAAY,UAAU,KAAK,KAAG,gBAAgB,GAAG,SAqC3G,CAAC;AAQF,eAAO,MAAM,2BAA2B,iBAAkB,gBAAgB,YAAY,UAAU,KAAK,KAAG,gBAAgB,GAAG,SAe1H,CAAC;AAQF,eAAO,MAAM,YAAY,eACX,SAAS,qBAAqB,GAAG,SAAS,YAC5C,UAAU,KAAK,KACxB,qBAAqB,GAAG,SAqC1B,CAAC;AAQF,eAAO,MAAM,4BAA4B,uBACnB,SAAS,4BAA4B,GAAG,SAAS,YAC3D,UAAU,KAAK,KACxB,4BAA4B,GAAG,SA0BjC,CAAC;AAiBF,eAAO,MAAM,0BAA0B,UAC9B,0BAA0B,cAAc,GAAG,0BAA0B,iBAAiB,KAC5F,UAAU,KAQZ,CAAC;AAwFF,eAAO,MAAM,kBAAkB,UAAW,UAAU,KAAK,KAAG,gBAiB3D,CAAC"}