@aws-amplify/graphql-model-transformer 2.3.0-rds-5.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/lib/graphql-model-transformer.d.ts +2 -1
  3. package/lib/graphql-model-transformer.d.ts.map +1 -1
  4. package/lib/graphql-model-transformer.js +54 -47
  5. package/lib/graphql-model-transformer.js.map +1 -1
  6. package/lib/rds-lambda.zip +0 -0
  7. package/lib/rds-notification-lambda.zip +0 -0
  8. package/lib/rds-patching-lambda.zip +0 -0
  9. package/lib/resolvers/rds/resolver.d.ts +2 -2
  10. package/lib/resolvers/rds/resolver.d.ts.map +1 -1
  11. package/lib/resolvers/rds/resolver.js +54 -44
  12. package/lib/resolvers/rds/resolver.js.map +1 -1
  13. package/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts +13 -0
  14. package/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -0
  15. package/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +172 -0
  16. package/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -0
  17. package/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +42 -0
  18. package/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -0
  19. package/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +244 -0
  20. package/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -0
  21. package/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts +12 -0
  22. package/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts.map +1 -0
  23. package/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +703 -0
  24. package/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js.map +1 -0
  25. package/lib/resources/dynamo-model-resource-generator.d.ts +5 -2
  26. package/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
  27. package/lib/resources/dynamo-model-resource-generator.js +47 -60
  28. package/lib/resources/dynamo-model-resource-generator.js.map +1 -1
  29. package/lib/resources/rds-model-resource-generator.d.ts +1 -1
  30. package/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
  31. package/lib/resources/rds-model-resource-generator.js +15 -15
  32. package/lib/resources/rds-model-resource-generator.js.map +1 -1
  33. package/package.json +12 -10
@@ -0,0 +1,244 @@
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, _b, _c;
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
+ allowDestructiveGraphqlSchemaUpdates: (_b = props.allowDestructiveGraphqlSchemaUpdates) !== null && _b !== void 0 ? _b : false,
54
+ replaceTableUponGsiUpdate: (_c = props.replaceTableUponGsiUpdate) !== null && _c !== void 0 ? _c : false,
55
+ },
56
+ removalPolicy: props.removalPolicy,
57
+ });
58
+ this.encryptionKey = encryptionKey;
59
+ this.tableArn = this.table.getAttString('TableArn');
60
+ this.tableStreamArn = streamSpecification ? this.table.getAttString('TableStreamArn') : undefined;
61
+ this.tableFromAttr = aws_dynamodb_1.Table.fromTableAttributes(scope, `CustomTable${id}`, {
62
+ tableArn: this.tableArn,
63
+ tableStreamArn: this.tableStreamArn,
64
+ });
65
+ this.addKey(props.partitionKey, HASH_KEY_TYPE);
66
+ this.tablePartitionKey = props.partitionKey;
67
+ if (props.sortKey) {
68
+ this.addKey(props.sortKey, RANGE_KEY_TYPE);
69
+ this.tableSortKey = props.sortKey;
70
+ }
71
+ this.node.addValidation({ validate: () => this.validateTable() });
72
+ }
73
+ addGlobalSecondaryIndex(props) {
74
+ this.validateProvisioning(props);
75
+ this.validateIndexName(props.indexName);
76
+ const gsiKeySchema = this.buildIndexKeySchema(props.partitionKey, props.sortKey);
77
+ const gsiProjection = this.buildIndexProjection(props);
78
+ this.globalSecondaryIndexes.push({
79
+ indexName: props.indexName,
80
+ keySchema: gsiKeySchema,
81
+ projection: gsiProjection,
82
+ provisionedThroughput: this.billingMode === aws_dynamodb_1.BillingMode.PAY_PER_REQUEST
83
+ ? undefined
84
+ : {
85
+ readCapacityUnits: props.readCapacity || 5,
86
+ writeCapacityUnits: props.writeCapacity || 5,
87
+ },
88
+ });
89
+ this.secondaryIndexSchemas.set(props.indexName, {
90
+ partitionKey: props.partitionKey,
91
+ sortKey: props.sortKey,
92
+ });
93
+ }
94
+ addLocalSecondaryIndex(props) {
95
+ if (this.localSecondaryIndexes.length >= MAX_LOCAL_SECONDARY_INDEX_COUNT) {
96
+ throw new RangeError(`a maximum number of local secondary index per table is ${MAX_LOCAL_SECONDARY_INDEX_COUNT}`);
97
+ }
98
+ this.validateIndexName(props.indexName);
99
+ const lsiKeySchema = this.buildIndexKeySchema(this.tablePartitionKey, props.sortKey);
100
+ const lsiProjection = this.buildIndexProjection(props);
101
+ this.localSecondaryIndexes.push({
102
+ indexName: props.indexName,
103
+ keySchema: lsiKeySchema,
104
+ projection: lsiProjection,
105
+ });
106
+ this.secondaryIndexSchemas.set(props.indexName, {
107
+ partitionKey: this.tablePartitionKey,
108
+ sortKey: props.sortKey,
109
+ });
110
+ }
111
+ schema(indexName) {
112
+ if (!indexName) {
113
+ return {
114
+ partitionKey: this.tablePartitionKey,
115
+ sortKey: this.tableSortKey,
116
+ };
117
+ }
118
+ let schema = this.secondaryIndexSchemas.get(indexName);
119
+ if (!schema) {
120
+ throw new Error(`Cannot find schema for index: ${indexName}. Use 'addGlobalSecondaryIndex' or 'addLocalSecondaryIndex' to add index`);
121
+ }
122
+ return schema;
123
+ }
124
+ addKey(attribute, keyType) {
125
+ const existingProp = this.findKey(keyType);
126
+ if (existingProp) {
127
+ throw new Error(`Unable to set ${attribute.name} as a ${keyType} key, because ${existingProp.attributeName} is a ${keyType} key`);
128
+ }
129
+ this.registerAttribute(attribute);
130
+ this.keySchema.push({
131
+ attributeName: attribute.name,
132
+ keyType,
133
+ });
134
+ return this;
135
+ }
136
+ findKey(keyType) {
137
+ return this.keySchema.find((prop) => prop.keyType === keyType);
138
+ }
139
+ registerAttribute(attribute) {
140
+ const { name, type } = attribute;
141
+ const existingDef = this.attributeDefinitions.find((def) => def.attributeName === name);
142
+ if (existingDef && existingDef.attributeType !== type) {
143
+ throw new Error(`Unable to specify ${name} as ${type} because it was already defined as ${existingDef.attributeType}`);
144
+ }
145
+ if (!existingDef) {
146
+ this.attributeDefinitions.push({
147
+ attributeName: name,
148
+ attributeType: type,
149
+ });
150
+ }
151
+ }
152
+ validateTable() {
153
+ const errors = new Array();
154
+ if (!this.tablePartitionKey) {
155
+ errors.push('a partition key must be specified');
156
+ }
157
+ if (this.localSecondaryIndexes.length > 0 && !this.tableSortKey) {
158
+ errors.push('a sort key of the table must be specified to add local secondary indexes');
159
+ }
160
+ return errors;
161
+ }
162
+ parseEncryption(props) {
163
+ var _a;
164
+ let encryptionType = props.encryption;
165
+ if (encryptionType === undefined) {
166
+ encryptionType =
167
+ props.encryptionKey != null
168
+ ?
169
+ aws_dynamodb_1.TableEncryption.CUSTOMER_MANAGED
170
+ :
171
+ aws_dynamodb_1.TableEncryption.AWS_MANAGED;
172
+ }
173
+ if (encryptionType !== aws_dynamodb_1.TableEncryption.CUSTOMER_MANAGED && props.encryptionKey) {
174
+ throw new Error('`encryptionKey cannot be specified unless encryption is set to TableEncryption.CUSTOMER_MANAGED (it was set to ${encryptionType})`');
175
+ }
176
+ if (encryptionType === aws_dynamodb_1.TableEncryption.CUSTOMER_MANAGED && props.replicationRegions) {
177
+ throw new Error('TableEncryption.CUSTOMER_MANAGED is not supported by DynamoDB Global Tables (where replicationRegions was set)');
178
+ }
179
+ switch (encryptionType) {
180
+ case aws_dynamodb_1.TableEncryption.CUSTOMER_MANAGED:
181
+ const encryptionKey = (_a = props.encryptionKey) !== null && _a !== void 0 ? _a : new aws_cdk_lib_1.aws_kms.Key(this, 'Key', {
182
+ description: `Customer-managed key auto-created for encrypting DynamoDB table at ${this.node.path}`,
183
+ enableKeyRotation: true,
184
+ });
185
+ return {
186
+ sseSpecification: { sseEnabled: true, kmsMasterKeyId: encryptionKey.keyArn, sseType: 'KMS' },
187
+ encryptionKey,
188
+ };
189
+ case aws_dynamodb_1.TableEncryption.AWS_MANAGED:
190
+ return { sseSpecification: { sseEnabled: true } };
191
+ case aws_dynamodb_1.TableEncryption.DEFAULT:
192
+ return { sseSpecification: { sseEnabled: false } };
193
+ case undefined:
194
+ return { sseSpecification: undefined };
195
+ default:
196
+ throw new Error(`Unexpected 'encryptionType': ${encryptionType}`);
197
+ }
198
+ }
199
+ validateProvisioning(props) {
200
+ if (this.billingMode === aws_dynamodb_1.BillingMode.PAY_PER_REQUEST) {
201
+ if (props.readCapacity !== undefined || props.writeCapacity !== undefined) {
202
+ throw new Error('you cannot provision read and write capacity for a table with PAY_PER_REQUEST billing mode');
203
+ }
204
+ }
205
+ }
206
+ validateIndexName(indexName) {
207
+ if (this.secondaryIndexSchemas.has(indexName)) {
208
+ throw new Error(`a duplicate index name, ${indexName}, is not allowed`);
209
+ }
210
+ }
211
+ validateNonKeyAttributes(nonKeyAttributes) {
212
+ if (this.nonKeyAttributes.size + nonKeyAttributes.length > 100) {
213
+ throw new RangeError('a maximum number of nonKeyAttributes across all of secondary indexes is 100');
214
+ }
215
+ nonKeyAttributes.forEach((att) => this.nonKeyAttributes.add(att));
216
+ }
217
+ buildIndexKeySchema(partitionKey, sortKey) {
218
+ this.registerAttribute(partitionKey);
219
+ const indexKeySchema = [{ attributeName: partitionKey.name, keyType: HASH_KEY_TYPE }];
220
+ if (sortKey) {
221
+ this.registerAttribute(sortKey);
222
+ indexKeySchema.push({ attributeName: sortKey.name, keyType: RANGE_KEY_TYPE });
223
+ }
224
+ return indexKeySchema;
225
+ }
226
+ buildIndexProjection(props) {
227
+ var _a, _b;
228
+ if (props.projectionType === aws_dynamodb_1.ProjectionType.INCLUDE && !props.nonKeyAttributes) {
229
+ throw new Error(`non-key attributes should be specified when using ${aws_dynamodb_1.ProjectionType.INCLUDE} projection type`);
230
+ }
231
+ if (props.projectionType !== aws_dynamodb_1.ProjectionType.INCLUDE && props.nonKeyAttributes) {
232
+ throw new Error(`non-key attributes should not be specified when not using ${aws_dynamodb_1.ProjectionType.INCLUDE} projection type`);
233
+ }
234
+ if (props.nonKeyAttributes) {
235
+ this.validateNonKeyAttributes(props.nonKeyAttributes);
236
+ }
237
+ return {
238
+ projectionType: (_a = props.projectionType) !== null && _a !== void 0 ? _a : aws_dynamodb_1.ProjectionType.ALL,
239
+ nonKeyAttributes: (_b = props.nonKeyAttributes) !== null && _b !== void 0 ? _b : undefined,
240
+ };
241
+ }
242
+ }
243
+ exports.AmplifyDynamoDBTable = AmplifyDynamoDBTable;
244
+ //# 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;AAOlE,MAAa,o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I,6BAAc,CAAC,GAAG;YAC1D,gBAAgB,EAAE,MAAA,KAAK,CAAC,gBAAgB,mCAAI,SAAS;SACtD,CAAC;IACJ,CAAC;CACF;AA/VD,oDA+VC"}
@@ -0,0 +1,12 @@
1
+ import { ContinuousBackupsDescription, CreateTableCommandInput, TableDescription, TimeToLiveDescription, UpdateContinuousBackupsCommandInput, UpdateTableCommandInput, UpdateTimeToLiveCommandInput } from '@aws-sdk/client-dynamodb';
2
+ export declare const onEvent: (event: AWSCDKAsyncCustomResource.OnEventRequest) => Promise<AWSCDKAsyncCustomResource.OnEventResponse>;
3
+ export declare const isComplete: (event: AWSCDKAsyncCustomResource.IsCompleteRequest) => Promise<AWSCDKAsyncCustomResource.IsCompleteResponse>;
4
+ export declare const getNextAtomicUpdate: (currentState: TableDescription, endState: CustomDDB.Input) => UpdateTableCommandInput | undefined;
5
+ export declare const getStreamUpdate: (currentState: TableDescription, endState: CustomDDB.Input) => Promise<UpdateTableCommandInput | undefined>;
6
+ export declare const getSseUpdate: (currentState: TableDescription, endState: CustomDDB.Input) => UpdateTableCommandInput | undefined;
7
+ export declare const getDeletionProtectionUpdate: (currentState: TableDescription, endState: CustomDDB.Input) => UpdateTableCommandInput | undefined;
8
+ export declare const getTtlUpdate: (currentTTL: TimeToLiveDescription | undefined, endState: CustomDDB.Input) => UpdateTimeToLiveCommandInput | undefined;
9
+ export declare const getPointInTimeRecoveryUpdate: (currentPointInTime: ContinuousBackupsDescription | undefined, endState: CustomDDB.Input) => UpdateContinuousBackupsCommandInput | undefined;
10
+ export declare const extractTableInputFromEvent: (event: AWSCDKAsyncCustomResource.OnEventRequest | AWSCDKAsyncCustomResource.IsCompleteRequest) => CustomDDB.Input;
11
+ export declare const toCreateTableInput: (props: CustomDDB.Input) => CreateTableCommandInput;
12
+ //# 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,EAGL,4BAA4B,EAE5B,uBAAuB,EAIvB,gBAAgB,EAChB,qBAAqB,EACrB,mCAAmC,EACnC,uBAAuB,EACvB,4BAA4B,EAE7B,MAAM,0BAA0B,CAAC;AA4BlC,eAAO,MAAM,OAAO,UAAiB,0BAA0B,cAAc,KAAG,QAAQ,0BAA0B,eAAe,CA6KhI,CAAC;AAQF,eAAO,MAAM,UAAU,UACd,0BAA0B,iBAAiB,KACjD,QAAQ,0BAA0B,kBAAkB,CA8DtD,CAAC;AAiDF,eAAO,MAAM,mBAAmB,iBAAkB,gBAAgB,YAAY,UAAU,KAAK,KAAG,uBAAuB,GAAG,SA6CzH,CAAC;AA6HF,eAAO,MAAM,eAAe,iBACZ,gBAAgB,YACpB,UAAU,KAAK,KACxB,QAAQ,uBAAuB,GAAG,SAAS,CAiC7C,CAAC;AAQF,eAAO,MAAM,YAAY,iBAAkB,gBAAgB,YAAY,UAAU,KAAK,KAAG,uBAAuB,GAAG,SAqClH,CAAC;AAQF,eAAO,MAAM,2BAA2B,iBACxB,gBAAgB,YACpB,UAAU,KAAK,KACxB,uBAAuB,GAAG,SAe5B,CAAC;AAQF,eAAO,MAAM,YAAY,eACX,qBAAqB,GAAG,SAAS,YACnC,UAAU,KAAK,KACxB,4BAA4B,GAAG,SAqCjC,CAAC;AAQF,eAAO,MAAM,4BAA4B,uBACnB,4BAA4B,GAAG,SAAS,YAClD,UAAU,KAAK,KACxB,mCAAmC,GAAG,SA0BxC,CAAC;AAiBF,eAAO,MAAM,0BAA0B,UAC9B,0BAA0B,cAAc,GAAG,0BAA0B,iBAAiB,KAC5F,UAAU,KAQZ,CAAC;AAiGF,eAAO,MAAM,kBAAkB,UAAW,UAAU,KAAK,KAAG,uBAkB3D,CAAC"}