@reventlessdev/rescript-pulumi-aws 3.0.0-alpha.4 → 3.0.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +300 -0
- package/package.json +8 -7
- package/rescript.json +2 -1
- package/src/AppSync/AppSync_ResolverRuntime.res +4 -5
- package/src/AppSync/AppSync_Resolver_Functions.res +281 -169
- package/src/AppSync/AppSync_Resolver_Functions.res.mjs +116 -72
- package/src/AppSync/AppSync_SourceApiAssociation.res +1 -3
- package/src/AwsNative/AppSync/AwsNative_AppSync_Api.res +2 -3
- package/src/AwsNative/AppSync/AwsNative_AppSync_ChannelNamespace.res +2 -6
- package/src/AwsNative/AppSync/AwsNative_AppSync_Resolver.res +2 -5
- package/src/Cloudwatch/Cloudwatch_EventRule.res +4 -0
- package/src/Cloudwatch/Cloudwatch_EventTarget.res +11 -0
- package/src/Cloudwatch/Cloudwatch_LogMetricFilter.res +0 -1
- package/src/Cloudwatch/Cloudwatch_MetricAlarm.res +1 -2
- package/src/Cognito/Cognito_UserPool.res +2 -4
- package/src/IAM/IAM.res +1 -1
- package/src/IAM/PolicyDocument.res +2 -2
- package/src/IAM/PolicyDocument.res.mjs +3 -3
- package/src/Kinesis/Kinesis_Stream.res +3 -6
- package/src/Kms/Kms.res +5 -0
- package/src/Kms/Kms.res.mjs +12 -0
- package/src/Kms/Kms_Alias.res +16 -0
- package/src/Kms/Kms_Alias.res.mjs +2 -0
- package/src/Kms/Kms_Key.res +23 -0
- package/src/Kms/Kms_Key.res.mjs +2 -0
- package/src/Lambda/FunctionUrl.res +5 -2
- package/src/Lambda/Lambda.res +139 -53
- package/src/Lambda/Lambda.res.mjs +152 -23
- package/src/Rds/Rds_Cluster.res +0 -1
- package/src/Rds/Rds_Instance.res +0 -1
- package/src/Rds/Rds_Proxy.res +1 -2
- package/src/S3/S3_Bucket.res +1 -1
- package/src/S3/S3_BucketV2.res +1 -3
- package/src/SNS/SNS_Topic.res +9 -9
- package/src/Scheduler/Scheduler.res +4 -0
- package/src/Scheduler/Scheduler.res.mjs +9 -0
- package/src/Scheduler/Scheduler_ScheduleGroup.res +14 -0
- package/src/Scheduler/Scheduler_ScheduleGroup.res.mjs +2 -0
- package/src/SecretsManager/GetSecretVersion.res +1 -1
- package/src/example/AlarmMailExample.res +34 -0
- package/src/example/AlarmMailExample.res.mjs +44 -0
- package/src/example/CustomDomainExample.res +2 -3
- package/src/example/MergedApiExample.res +1 -3
- package/tests/AppSync_Resolver_FunctionsTest.mjs +141 -23
|
@@ -43,6 +43,18 @@ function exemptPreamble(elevatedGroups) {
|
|
|
43
43
|
const _exempt = _sub == null || _groups.some(g => _elevated.indexOf(g) >= 0);`;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
function rowChangeField(field, elevatedGroups) {
|
|
47
|
+
return `import { util, runtime } from '@aws-appsync/utils';
|
|
48
|
+
export function request(ctx) {` + exemptPreamble(elevatedGroups) + `
|
|
49
|
+
const _row = ctx.source;
|
|
50
|
+
return runtime.earlyReturn(_exempt && _row != null && _row['` + field + `'] != null ? _row['` + field + `'] : null);
|
|
51
|
+
}
|
|
52
|
+
export function response(ctx) {
|
|
53
|
+
return ctx.result;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
|
|
46
58
|
function retiredGuardPreamble(retiredField, retiredValues, elevatedGroups, ownerScoped) {
|
|
47
59
|
if (retiredField === undefined) {
|
|
48
60
|
return "";
|
|
@@ -389,9 +401,13 @@ export function request(ctx) {
|
|
|
389
401
|
}
|
|
390
402
|
|
|
391
403
|
function pageWindowBudget(filtered) {
|
|
392
|
-
return `(` + filtered + ` ? (_first > 1000 ? _first : 1000) : _first + _from)`;
|
|
404
|
+
return `(` + filtered + ` ? (_first > 1000 ? _first : 1000) : _first + _from + 1)`;
|
|
393
405
|
}
|
|
394
406
|
|
|
407
|
+
let need = "(_backward ? _upTo : _first + _from + 1)";
|
|
408
|
+
|
|
409
|
+
let listPageWindowBudget = `(parts.length > 0 ? (` + need + ` > 1000 ? ` + need + ` : 1000) : ` + need + `)`;
|
|
410
|
+
|
|
395
411
|
function cursorDecode(args) {
|
|
396
412
|
return `
|
|
397
413
|
let _window = null;
|
|
@@ -410,13 +426,42 @@ let cursorPathGuard = `
|
|
|
410
426
|
util.error('This cursor belongs to a different read of this list; restart from the first page.', 'CursorPathMismatch');
|
|
411
427
|
}`;
|
|
412
428
|
|
|
413
|
-
|
|
414
|
-
let tag = pathExpr !== undefined ? `, p: ` + pathExpr : "";
|
|
415
|
-
return `
|
|
429
|
+
let listCursorPreamble = `
|
|
416
430
|
const _first = ctx.args.first ?? 50;
|
|
431
|
+
let _window = null;
|
|
432
|
+
let _from = 0;
|
|
433
|
+
let _cursorPath = null;
|
|
434
|
+
let _backward = false;
|
|
435
|
+
let _upTo = -1;
|
|
436
|
+
if (ctx.args.before != null && ctx.args.before !== '') {
|
|
437
|
+
const _c = JSON.parse(util.base64Decode(ctx.args.before));
|
|
438
|
+
_window = (_c.t !== undefined ? _c.t : _c.token) ?? null;
|
|
439
|
+
_cursorPath = _c.p ?? 's';
|
|
440
|
+
_backward = true;
|
|
441
|
+
_upTo = _c.n !== undefined ? _c.n : 0;
|
|
442
|
+
_from = (_upTo - _first) > 0 ? (_upTo - _first) : 0;
|
|
443
|
+
} else if (ctx.args.after != null && ctx.args.after !== '') {
|
|
444
|
+
const _c = JSON.parse(util.base64Decode(ctx.args.after));
|
|
445
|
+
_window = (_c.t !== undefined ? _c.t : _c.token) ?? null;
|
|
446
|
+
_from = _c.n !== undefined ? _c.n + 1 : 0;
|
|
447
|
+
_cursorPath = _c.p ?? 's';
|
|
448
|
+
}`;
|
|
449
|
+
|
|
450
|
+
function connectionPageResponse(pathExpr, bidirectionalOpt) {
|
|
451
|
+
let bidirectional = bidirectionalOpt !== undefined ? bidirectionalOpt : false;
|
|
452
|
+
let tag = pathExpr !== undefined ? `, p: ` + pathExpr : "";
|
|
453
|
+
let firstDecl = bidirectional ? "" : "\n const _first = ctx.args.first ?? 50;";
|
|
454
|
+
let slice = bidirectional ? `
|
|
455
|
+
const _rest = _backward ? items.slice(_from, _upTo) : items.slice(_from);
|
|
456
|
+
const _page = _backward ? _rest : _rest.slice(0, _first);
|
|
457
|
+
// A backward page was cut from ahead, so a next page provably exists — the one
|
|
458
|
+
// the caller came from — whatever this window's tail looks like.
|
|
459
|
+
const _more = _backward ? true : _rest.length > _first;` : `
|
|
417
460
|
const _rest = items.slice(_from);
|
|
418
461
|
const _page = _rest.slice(0, _first);
|
|
419
|
-
const _more = _rest.length > _first
|
|
462
|
+
const _more = _rest.length > _first;`;
|
|
463
|
+
let hasPrevious = bidirectional ? "_from > 0" : "!!ctx.args.after";
|
|
464
|
+
return firstDecl + slice + `
|
|
420
465
|
const _next = ctx.result?.nextToken ?? null;
|
|
421
466
|
const _lastIndex = _page.length - 1;
|
|
422
467
|
// A row's cursor names its own position. The last row of a page that closes its
|
|
@@ -437,7 +482,7 @@ function connectionPageResponse(pathExpr) {
|
|
|
437
482
|
edges,
|
|
438
483
|
pageInfo: {
|
|
439
484
|
hasNextPage: _more || !!_next,
|
|
440
|
-
hasPreviousPage:
|
|
485
|
+
hasPreviousPage: ` + hasPrevious + `,
|
|
441
486
|
startCursor: edges.length > 0 ? edges[0].cursor : _boundary,
|
|
442
487
|
endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : _boundary,
|
|
443
488
|
},
|
|
@@ -447,7 +492,7 @@ function connectionPageResponse(pathExpr) {
|
|
|
447
492
|
let indexConnectionResponseCode = `
|
|
448
493
|
export function response(ctx) {
|
|
449
494
|
if (ctx.error) util.error(ctx.error.message, ctx.error.type);
|
|
450
|
-
const items = ctx.result?.items ?? [];` + cursorDecode("ctx.args") + connectionPageResponse(undefined) + `
|
|
495
|
+
const items = ctx.result?.items ?? [];` + cursorDecode("ctx.args") + connectionPageResponse(undefined, undefined) + `
|
|
451
496
|
}`;
|
|
452
497
|
|
|
453
498
|
let indexBackwardPagingGuard = `
|
|
@@ -495,7 +540,7 @@ export function request(ctx) {
|
|
|
495
540
|
operation: 'Query',
|
|
496
541
|
query,
|
|
497
542
|
index: '` + index + `',
|
|
498
|
-
limit: ` + (`(` + "expression" + ` ? (_first > 1000 ? _first : 1000) : _first + _from)`) + `,
|
|
543
|
+
limit: ` + (`(` + "expression" + ` ? (_first > 1000 ? _first : 1000) : _first + _from + 1)`) + `,
|
|
499
544
|
nextToken: _window,
|
|
500
545
|
scanIndexForward: (args.forward ?? true)
|
|
501
546
|
};
|
|
@@ -552,7 +597,7 @@ export function request(ctx) {
|
|
|
552
597
|
operation: 'Query',
|
|
553
598
|
query,
|
|
554
599
|
index: '` + index + `',
|
|
555
|
-
limit: ` + (`(` + "expression" + ` ? (_first > 1000 ? _first : 1000) : _first + _from)`) + `,
|
|
600
|
+
limit: ` + (`(` + "expression" + ` ? (_first > 1000 ? _first : 1000) : _first + _from + 1)`) + `,
|
|
556
601
|
nextToken: _window,
|
|
557
602
|
scanIndexForward: (args.forward ?? true)
|
|
558
603
|
};
|
|
@@ -686,7 +731,7 @@ function listAllItemsConnection(labelField, filterFieldsOpt, rangeFieldsOpt, sor
|
|
|
686
731
|
const req = _exempt
|
|
687
732
|
? {
|
|
688
733
|
operation: 'Scan',
|
|
689
|
-
limit: ` +
|
|
734
|
+
limit: ` + listPageWindowBudget + `,
|
|
690
735
|
nextToken: _window,
|
|
691
736
|
}
|
|
692
737
|
: {
|
|
@@ -697,33 +742,35 @@ function listAllItemsConnection(labelField, filterFieldsOpt, rangeFieldsOpt, sor
|
|
|
697
742
|
expressionNames: { '#owner': '` + ownerField + `' },
|
|
698
743
|
expressionValues: { ':owner': util.dynamodb.toDynamoDB(_sub) },
|
|
699
744
|
},
|
|
700
|
-
limit: ` +
|
|
745
|
+
limit: ` + listPageWindowBudget + `,
|
|
701
746
|
nextToken: _window,
|
|
702
747
|
scanIndexForward: !(_indexOrdered && ctx.args.orderBy.direction === 'DESC'),
|
|
703
748
|
};` : `
|
|
704
749
|
const req = {
|
|
705
750
|
operation: 'Scan',
|
|
706
|
-
limit: ` +
|
|
751
|
+
limit: ` + listPageWindowBudget + `,
|
|
707
752
|
nextToken: _window,
|
|
708
753
|
};`
|
|
709
754
|
) : `
|
|
710
755
|
const req = {
|
|
711
756
|
operation: 'Scan',
|
|
712
|
-
limit: ` +
|
|
757
|
+
limit: ` + listPageWindowBudget + `,
|
|
713
758
|
nextToken: _window,
|
|
714
759
|
};`;
|
|
715
760
|
let requestPathGuard = Stdlib_Option.isSome(ownerIndex$1) ? cursorPathGuard : "";
|
|
716
761
|
let responsePathPreamble = ownerIndex$1 !== undefined ? ownerIdentityPreamble + `
|
|
717
762
|
const _path = _exempt ? 's' : 'q';
|
|
718
763
|
const _indexOrdered = ` + indexOrderedExpr + `;` : "";
|
|
719
|
-
let pageResponse = ownerIndex$1 !== undefined ? connectionPageResponse("_path") : connectionPageResponse(undefined);
|
|
764
|
+
let pageResponse = ownerIndex$1 !== undefined ? connectionPageResponse("_path", true) : connectionPageResponse(undefined, true);
|
|
720
765
|
return importUtil + `
|
|
721
766
|
export function request(ctx) {
|
|
722
|
-
//
|
|
723
|
-
//
|
|
724
|
-
//
|
|
725
|
-
|
|
726
|
-
|
|
767
|
+
// 'before' IS served — the page is cut backward out of the window the cursor
|
|
768
|
+
// names. 'last' is not: "the last N rows of the list" needs the end of the
|
|
769
|
+
// list, which a forward-only Scan cursor cannot reach. The ordered
|
|
770
|
+
// {single}Items connection (queryItemsWithSortConditions) has a real keyset
|
|
771
|
+
// cursor and honours both — direct callers who need 'last' there.
|
|
772
|
+
if (ctx.args.last != null) {
|
|
773
|
+
util.error('last is not supported on full-list connections; page backward with first and before.', 'UnsupportedPagination');
|
|
727
774
|
}
|
|
728
775
|
const filter = ctx.args.filter ?? {};
|
|
729
776
|
const names = {};
|
|
@@ -748,8 +795,14 @@ export function request(ctx) {
|
|
|
748
795
|
});
|
|
749
796
|
parts.push('#id IN (' + placeholders.join(', ') + ')');
|
|
750
797
|
}` + filterClauses + rangeClauses + requireAttributeClause + ownerClause + retiredClause + `
|
|
751
|
-
` +
|
|
752
|
-
|
|
798
|
+
` + listCursorPreamble + requestPathGuard + `
|
|
799
|
+
// The one page a cursor cannot reach: it begins in an earlier window, and a
|
|
800
|
+
// continuation token cannot name the one before it. Refused by itself rather
|
|
801
|
+
// than folded into the 'last' guard, because the two are different limits and a
|
|
802
|
+
// caller can act on this one (page forward from the start).
|
|
803
|
+
if (_backward && _upTo <= 0 && _window !== null) {
|
|
804
|
+
util.error('The previous page begins in an earlier read window, which this cursor cannot name; page forward from the start.', 'UnsupportedPagination');
|
|
805
|
+
}` + requestOperation + `
|
|
753
806
|
if (parts.length > 0) {
|
|
754
807
|
req.filter = {
|
|
755
808
|
expression: parts.join(' AND '),
|
|
@@ -761,7 +814,7 @@ export function request(ctx) {
|
|
|
761
814
|
}
|
|
762
815
|
export function response(ctx) {
|
|
763
816
|
if (ctx.error) util.error(ctx.error.message, ctx.error.type);
|
|
764
|
-
let items = ctx.result?.items ?? [];` + responsePathPreamble + sortBlock +
|
|
817
|
+
let items = ctx.result?.items ?? [];` + responsePathPreamble + sortBlock + listCursorPreamble + pageResponse + `
|
|
765
818
|
}
|
|
766
819
|
`;
|
|
767
820
|
}
|
|
@@ -936,9 +989,9 @@ export function request(ctx) {
|
|
|
936
989
|
`;
|
|
937
990
|
}
|
|
938
991
|
|
|
939
|
-
function resolveIds(idsField, sortField, ownerField, retiredField, retiredValues,
|
|
992
|
+
function resolveIds(idsField, sortField, ownerField, retiredField, retiredValues, elevatedGroupsOpt) {
|
|
993
|
+
let elevatedGroups = elevatedGroupsOpt !== undefined ? elevatedGroupsOpt : [];
|
|
940
994
|
return tableName => {
|
|
941
|
-
let elevatedGroups = $staropt$star !== undefined ? $staropt$star : [];
|
|
942
995
|
let keysCode = sortField !== undefined ? `id => ({ id: util.dynamodb.toString(id.id), ` + sortField + `: util.dynamodb.toString(id.` + sortField + `) })` : `id => ({ id: util.dynamodb.toString(id) })`;
|
|
943
996
|
return importUtil + `
|
|
944
997
|
import { runtime } from '@aws-appsync/utils';
|
|
@@ -970,10 +1023,9 @@ export function response(ctx) {
|
|
|
970
1023
|
};
|
|
971
1024
|
}
|
|
972
1025
|
|
|
973
|
-
function batchGetItemsByIds(ownerField, retiredField, retiredValues,
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
return importUtil + `
|
|
1026
|
+
function batchGetItemsByIds(ownerField, retiredField, retiredValues, elevatedGroupsOpt) {
|
|
1027
|
+
let elevatedGroups = elevatedGroupsOpt !== undefined ? elevatedGroupsOpt : [];
|
|
1028
|
+
return tableName => importUtil + `
|
|
977
1029
|
import { runtime } from '@aws-appsync/utils';
|
|
978
1030
|
export function request(ctx) {
|
|
979
1031
|
const ids = ctx.args.ids ?? [];
|
|
@@ -998,22 +1050,21 @@ export function response(ctx) {
|
|
|
998
1050
|
// caller does not own is dropped rather than refused, for the reason the
|
|
999
1051
|
// single-key door answers null: distinguishing "not yours" from "not there"
|
|
1000
1052
|
// would make this door an oracle for which ids exist.` + (
|
|
1001
|
-
|
|
1002
|
-
|
|
1053
|
+
ownerField !== undefined ? ownerGuardPreamble(ownerField, elevatedGroups) : ""
|
|
1054
|
+
) + retiredGuardPreamble(retiredField, retiredValues, elevatedGroups, Stdlib_Option.isSome(ownerField)) + `
|
|
1003
1055
|
return (ctx.result?.data?.['` + tableName + `'] ?? []).filter(item =>
|
|
1004
1056
|
item !== null` + (
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1057
|
+
Stdlib_Option.isSome(ownerField) ? " && _owns(item)" : ""
|
|
1058
|
+
) + (
|
|
1059
|
+
Stdlib_Option.isSome(retiredField) ? " && _live(item)" : ""
|
|
1060
|
+
) + `);
|
|
1009
1061
|
}
|
|
1010
1062
|
`;
|
|
1011
|
-
};
|
|
1012
1063
|
}
|
|
1013
1064
|
|
|
1014
|
-
function refsByIds(labelField, retiredField, retiredValues, namedWhenRetired, ownerField,
|
|
1065
|
+
function refsByIds(labelField, retiredField, retiredValues, namedWhenRetired, imageExpr, ownerField, elevatedGroupsOpt) {
|
|
1066
|
+
let elevatedGroups = elevatedGroupsOpt !== undefined ? elevatedGroupsOpt : [];
|
|
1015
1067
|
return tableName => {
|
|
1016
|
-
let elevatedGroups = $staropt$star !== undefined ? $staropt$star : [];
|
|
1017
1068
|
let ownerGuard = ownerField !== undefined ? ownerGuardPreamble(ownerField, elevatedGroups) : "\n const _owns = (row) => true;";
|
|
1018
1069
|
let retiredExpr;
|
|
1019
1070
|
if (retiredField !== undefined) {
|
|
@@ -1054,6 +1105,7 @@ export function response(ctx) {
|
|
|
1054
1105
|
.map(row => ({
|
|
1055
1106
|
id: row.id,
|
|
1056
1107
|
label: row['` + labelField + `'] ?? row.id,
|
|
1108
|
+
image: ` + Stdlib_Option.getOr(imageExpr, "null") + `,
|
|
1057
1109
|
retired: _retired(row),
|
|
1058
1110
|
retiredState: ` + stateExpr + `,
|
|
1059
1111
|
}));
|
|
@@ -1100,22 +1152,7 @@ export function request(ctx) {
|
|
|
1100
1152
|
` + resultResponseCode + `
|
|
1101
1153
|
`;
|
|
1102
1154
|
|
|
1103
|
-
|
|
1104
|
-
return importUtil + `
|
|
1105
|
-
export function request(ctx) {
|
|
1106
|
-
const id = ctx.identity;
|
|
1107
|
-
const isCognito = id != null && id.sub != null;
|
|
1108
|
-
return {
|
|
1109
|
-
operation: 'Invoke',
|
|
1110
|
-
payload: {
|
|
1111
|
-
command: '` + command + `',
|
|
1112
|
-
arguments: ctx.args,
|
|
1113
|
-
meta: {
|
|
1114
|
-
ip: id?.sourceIp ?? null,
|
|
1115
|
-
user: id?.username ?? null,
|
|
1116
|
-
info: ctx.info.parentTypeName + '.' + ctx.info.fieldName
|
|
1117
|
-
},
|
|
1118
|
-
identity: isCognito
|
|
1155
|
+
let callerIdentity = `identity: isCognito
|
|
1119
1156
|
? {
|
|
1120
1157
|
userId: id.sub,
|
|
1121
1158
|
username: id.username,
|
|
@@ -1130,7 +1167,23 @@ export function request(ctx) {
|
|
|
1130
1167
|
username: id.username ?? null,
|
|
1131
1168
|
provider: 'IAM'
|
|
1132
1169
|
}
|
|
1133
|
-
: null
|
|
1170
|
+
: null`;
|
|
1171
|
+
|
|
1172
|
+
function invokeCommandGenerator(command) {
|
|
1173
|
+
return importUtil + `
|
|
1174
|
+
export function request(ctx) {
|
|
1175
|
+
const id = ctx.identity;
|
|
1176
|
+
const isCognito = id != null && id.sub != null;
|
|
1177
|
+
return {
|
|
1178
|
+
operation: 'Invoke',
|
|
1179
|
+
payload: {
|
|
1180
|
+
command: '` + command + `',
|
|
1181
|
+
arguments: ctx.args,
|
|
1182
|
+
meta: {
|
|
1183
|
+
user: id?.username ?? null,
|
|
1184
|
+
info: ctx.info.parentTypeName + '.' + ctx.info.fieldName
|
|
1185
|
+
},
|
|
1186
|
+
` + callerIdentity + `
|
|
1134
1187
|
}
|
|
1135
1188
|
};
|
|
1136
1189
|
}
|
|
@@ -1149,26 +1202,10 @@ export function request(ctx) {
|
|
|
1149
1202
|
command: '` + tag + `',
|
|
1150
1203
|
arguments: ctx.args,
|
|
1151
1204
|
meta: {
|
|
1152
|
-
ip: id?.sourceIp ?? null,
|
|
1153
1205
|
user: id?.username ?? null,
|
|
1154
1206
|
info: ctx.info.parentTypeName + '.' + ctx.info.fieldName
|
|
1155
1207
|
},
|
|
1156
|
-
|
|
1157
|
-
? {
|
|
1158
|
-
userId: id.sub,
|
|
1159
|
-
username: id.username,
|
|
1160
|
-
groups: id.claims?.['cognito:groups'] ?? [],
|
|
1161
|
-
claims: id.claims,
|
|
1162
|
-
provider: 'Cognito'
|
|
1163
|
-
}
|
|
1164
|
-
: id != null
|
|
1165
|
-
? {
|
|
1166
|
-
userArn: id.userArn ?? null,
|
|
1167
|
-
accountId: id.accountId ?? null,
|
|
1168
|
-
username: id.username ?? null,
|
|
1169
|
-
provider: 'IAM'
|
|
1170
|
-
}
|
|
1171
|
-
: null
|
|
1208
|
+
` + callerIdentity + `
|
|
1172
1209
|
}
|
|
1173
1210
|
};
|
|
1174
1211
|
}
|
|
@@ -1179,12 +1216,15 @@ export function request(ctx) {
|
|
|
1179
1216
|
function invokeInboundTranslation(fieldName) {
|
|
1180
1217
|
return importUtil + `
|
|
1181
1218
|
export function request(ctx) {
|
|
1219
|
+
const id = ctx.identity;
|
|
1220
|
+
const isCognito = id != null && id.sub != null;
|
|
1182
1221
|
return {
|
|
1183
1222
|
operation: 'Invoke',
|
|
1184
1223
|
payload: {
|
|
1185
1224
|
__inboundTranslation: true,
|
|
1186
1225
|
fieldName: '` + fieldName + `',
|
|
1187
|
-
arguments: ctx.args
|
|
1226
|
+
arguments: ctx.args,
|
|
1227
|
+
` + callerIdentity + `
|
|
1188
1228
|
}
|
|
1189
1229
|
};
|
|
1190
1230
|
}
|
|
@@ -1273,6 +1313,7 @@ export {
|
|
|
1273
1313
|
importUtil,
|
|
1274
1314
|
ownerGuardPreamble,
|
|
1275
1315
|
exemptPreamble,
|
|
1316
|
+
rowChangeField,
|
|
1276
1317
|
retiredGuardPreamble,
|
|
1277
1318
|
ownerFilterClause,
|
|
1278
1319
|
retiredFilterClause,
|
|
@@ -1289,8 +1330,10 @@ export {
|
|
|
1289
1330
|
queryByIndexDeletable,
|
|
1290
1331
|
queryByIndexSort,
|
|
1291
1332
|
pageWindowBudget,
|
|
1333
|
+
listPageWindowBudget,
|
|
1292
1334
|
cursorDecode,
|
|
1293
1335
|
cursorPathGuard,
|
|
1336
|
+
listCursorPreamble,
|
|
1294
1337
|
connectionPageResponse,
|
|
1295
1338
|
indexConnectionResponseCode,
|
|
1296
1339
|
indexBackwardPagingGuard,
|
|
@@ -1313,6 +1356,7 @@ export {
|
|
|
1313
1356
|
putItem,
|
|
1314
1357
|
addItemToList,
|
|
1315
1358
|
deleteItem,
|
|
1359
|
+
callerIdentity,
|
|
1316
1360
|
invokeCommandGenerator,
|
|
1317
1361
|
invokeDcbMutation,
|
|
1318
1362
|
invokeInboundTranslation,
|
|
@@ -28,9 +28,7 @@ type args = {
|
|
|
28
28
|
mergedApiArn?: Pulumi.Input.t<string>,
|
|
29
29
|
sourceApiId?: Pulumi.Input.t<string>,
|
|
30
30
|
sourceApiArn?: Pulumi.Input.t<string>,
|
|
31
|
-
sourceApiAssociationConfigs?: Pulumi.Input.t<
|
|
32
|
-
array<Pulumi.Input.t<sourceApiAssociationConfig>>,
|
|
33
|
-
>,
|
|
31
|
+
sourceApiAssociationConfigs?: Pulumi.Input.t<array<Pulumi.Input.t<sourceApiAssociationConfig>>>,
|
|
34
32
|
description?: Pulumi.Input.t<string>,
|
|
35
33
|
}
|
|
36
34
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
// ── Auth types ────────────────────────────────────────────────────────────────
|
|
2
|
+
|
|
1
3
|
/** @pulumi/aws-native/appsync/Api — AppSync Events (Pub/Sub) API.
|
|
2
4
|
Distinct from AppSync GraphQL API (`aws.appsync.GraphQLApi`).
|
|
3
5
|
Used for real-time server-to-client event push via AppSync Events channels.
|
|
4
6
|
See: https://www.pulumi.com/registry/packages/aws-native/api-docs/appsync/api
|
|
5
7
|
*/
|
|
6
|
-
|
|
7
|
-
// ── Auth types ────────────────────────────────────────────────────────────────
|
|
8
|
-
|
|
9
8
|
/** Authentication mode for connections / publish / subscribe. */
|
|
10
9
|
type authMode = {
|
|
11
10
|
/** Auth type string — use the `authType` constants below. */
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Channels within the namespace are addressed as `/default/{channelName}`.
|
|
5
5
|
See: https://www.pulumi.com/registry/packages/aws-native/api-docs/appsync/channelnamespace
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
type authMode = {
|
|
9
8
|
authType?: Pulumi.Input.t<string>,
|
|
10
9
|
}
|
|
@@ -74,8 +73,5 @@ type args = {
|
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
@module("@pulumi/aws-native") @scope("appsync") @new
|
|
77
|
-
external make: (
|
|
78
|
-
|
|
79
|
-
~args: args,
|
|
80
|
-
~opts: option<Pulumi.CustomResourceOptions.t>=?,
|
|
81
|
-
) => t = "ChannelNamespace"
|
|
76
|
+
external make: (~name: string, ~args: args, ~opts: option<Pulumi.CustomResourceOptions.t>=?) => t =
|
|
77
|
+
"ChannelNamespace"
|
|
@@ -32,8 +32,5 @@ type args = {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
@module("@pulumi/aws-native") @scope("appsync") @new
|
|
35
|
-
external make: (
|
|
36
|
-
|
|
37
|
-
~args: args,
|
|
38
|
-
~opts: option<Pulumi.CustomResourceOptions.t>=?,
|
|
39
|
-
) => t = "Resolver"
|
|
35
|
+
external make: (~name: string, ~args: args, ~opts: option<Pulumi.CustomResourceOptions.t>=?) => t =
|
|
36
|
+
"Resolver"
|
|
@@ -44,6 +44,10 @@ module ScheduleExpression: {
|
|
|
44
44
|
type args = {
|
|
45
45
|
description?: Pulumi.Input.t<string>,
|
|
46
46
|
scheduleExpression?: ScheduleExpression.t,
|
|
47
|
+
/** JSON event pattern the rule matches on. A rule fires on a schedule or on a
|
|
48
|
+
pattern — set exactly one of the two.
|
|
49
|
+
see: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html */
|
|
50
|
+
eventPattern?: Pulumi.Input.t<string>,
|
|
47
51
|
roleArn?: Pulumi.Input.t<string>,
|
|
48
52
|
tags?: Pulumi.Input.t<Aws.tags>,
|
|
49
53
|
}
|
|
@@ -17,10 +17,21 @@ module Rule: {
|
|
|
17
17
|
let ofEventRule = (rule: Cloudwatch_EventRule.t) => rule.name->Pulumi.Output.asInput
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/** Rewrites a matched event before it reaches the target. `inputPaths` binds names to
|
|
21
|
+
JSON paths in the event; `inputTemplate` substitutes them where it writes `<name>`.
|
|
22
|
+
A template that is not JSON arrives as plain text — an SNS email body, say.
|
|
23
|
+
see: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html */
|
|
24
|
+
type inputTransformer = {
|
|
25
|
+
inputPaths?: dict<string>,
|
|
26
|
+
inputTemplate: Pulumi.Input.t<string>,
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
type args = {
|
|
21
30
|
rule: Rule.t,
|
|
22
31
|
arn: Pulumi.Input.t<string>,
|
|
32
|
+
/** A fixed payload, sent verbatim. Mutually exclusive with `inputTransformer`. */
|
|
23
33
|
input?: Pulumi.Input.t<string>,
|
|
34
|
+
inputTransformer?: Pulumi.Input.t<inputTransformer>,
|
|
24
35
|
}
|
|
25
36
|
|
|
26
37
|
@module("@pulumi/aws") @scope("cloudwatch") @new
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @pulumi/aws/cloudwatch/logmetricfilter
|
|
2
2
|
see: https://www.pulumi.com/registry/packages/aws/api-docs/cloudwatch/logmetricfilter/
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
4
|
/** How matched log events are turned into a CloudWatch metric data point.
|
|
6
5
|
`value`/`dimensions` use metric-filter JSON selectors (e.g. `"$.value"`). */
|
|
7
6
|
type metricTransformation = {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @pulumi/aws/cloudwatch/metricalarm
|
|
2
2
|
see: https://www.pulumi.com/registry/packages/aws/api-docs/cloudwatch/metricalarm/
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
4
|
type t = {arn: Pulumi.Output.t<string>, id: Pulumi.Output.t<string>}
|
|
6
5
|
|
|
7
6
|
/** Single-metric alarm args. `comparisonOperator` uses CloudWatch's operator
|
|
@@ -15,7 +14,7 @@ type args = {
|
|
|
15
14
|
evaluationPeriods: Pulumi.Input.t<int>,
|
|
16
15
|
/** How many of the last `evaluationPeriods` datapoints must breach to alarm
|
|
17
16
|
("M out of N"). Defaults to `evaluationPeriods` when omitted, which is the
|
|
18
|
-
all-or-nothing
|
|
17
|
+
all-or-nothing behavior. Setting it below `evaluationPeriods` is how an
|
|
19
18
|
alarm rides out an isolated blip without going blind to a sustained one. */
|
|
20
19
|
datapointsToAlarm?: Pulumi.Input.t<int>,
|
|
21
20
|
metricName: Pulumi.Input.t<string>,
|
|
@@ -119,7 +119,5 @@ type getResult = {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
@module("@pulumi/aws") @scope("cognito") @val
|
|
122
|
-
external getUserPoolOutput: (
|
|
123
|
-
|
|
124
|
-
~opts: InvokeOptions.t=?,
|
|
125
|
-
) => Output.t<getResult> = "getUserPoolOutput"
|
|
122
|
+
external getUserPoolOutput: (~args: getArgs, ~opts: InvokeOptions.t=?) => Output.t<getResult> =
|
|
123
|
+
"getUserPoolOutput"
|
package/src/IAM/IAM.res
CHANGED
|
@@ -124,12 +124,12 @@ type t = policy
|
|
|
124
124
|
|
|
125
125
|
let toJsonString: t => string = t => {
|
|
126
126
|
t
|
|
127
|
-
->S.
|
|
127
|
+
->S.convertOrThrow(~from=policySchema, ~to=S.json)
|
|
128
128
|
->JSON.stringify(~space=1)
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
let fromJsonString: string => t = (policyString: string) =>
|
|
132
|
-
policyString->S.
|
|
132
|
+
S.JsonString(policyString)->S.convertOrThrow(~from=S.jsonString, ~to=policySchema)
|
|
133
133
|
|
|
134
134
|
let make = (~version=Version2012, ~id=?, ~statements) => {
|
|
135
135
|
version,
|
|
@@ -48,7 +48,7 @@ let conditionEntrySchema = Sury.union([
|
|
|
48
48
|
Sury.$schema(s => (s.m(Sury.array(Sury.string))))
|
|
49
49
|
]);
|
|
50
50
|
|
|
51
|
-
let conditionMapSchema = Sury.
|
|
51
|
+
let conditionMapSchema = Sury.record(conditionEntrySchema);
|
|
52
52
|
|
|
53
53
|
let conditionSchema = Sury.$schema(s => ({
|
|
54
54
|
StringEquals: s.m(Sury.$option(conditionMapSchema)),
|
|
@@ -121,11 +121,11 @@ let policySchema = Sury.$schema(s => ({
|
|
|
121
121
|
}));
|
|
122
122
|
|
|
123
123
|
function toJsonString(t) {
|
|
124
|
-
return JSON.stringify(S.
|
|
124
|
+
return JSON.stringify(S.convertOrThrow(t, policySchema, undefined, Sury.json), undefined, 1);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
function fromJsonString(policyString) {
|
|
128
|
-
return S.
|
|
128
|
+
return S.convertOrThrow(policyString, Sury.jsonString, undefined, policySchema);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
function make(versionOpt, id, statements) {
|
|
@@ -54,11 +54,8 @@ module EventSubscription = {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
@module("@pulumi/aws") @scope("kinesis") @new
|
|
57
|
-
external make: (
|
|
58
|
-
|
|
59
|
-
~args: args=?,
|
|
60
|
-
~opts: Pulumi.CustomResourceOptions.t=?
|
|
61
|
-
) => stream = "Stream"
|
|
57
|
+
external make: (~name: string, ~args: args=?, ~opts: Pulumi.CustomResourceOptions.t=?) => stream =
|
|
58
|
+
"Stream"
|
|
62
59
|
|
|
63
60
|
@send
|
|
64
61
|
external onEvent: (
|
|
@@ -66,5 +63,5 @@ external onEvent: (
|
|
|
66
63
|
~name: string,
|
|
67
64
|
~handler: Lambda.eventHandlerNoResult<event>,
|
|
68
65
|
~args: subscriptionArgs=?,
|
|
69
|
-
~opts: Pulumi.CustomResourceOptions.t
|
|
66
|
+
~opts: Pulumi.CustomResourceOptions.t=?,
|
|
70
67
|
) => EventSubscription.t = "onEvent"
|
package/src/Kms/Kms.res
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @pulumi/aws/kms/alias
|
|
2
|
+
see: https://www.pulumi.com/registry/packages/aws/api-docs/kms/alias
|
|
3
|
+
*/
|
|
4
|
+
type t = {
|
|
5
|
+
arn: Pulumi.Output.t<string>,
|
|
6
|
+
name: Pulumi.Output.t<string>,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type args = {
|
|
10
|
+
/** Must start with `alias/`. */
|
|
11
|
+
name?: Pulumi.Input.t<string>,
|
|
12
|
+
targetKeyId: Pulumi.Input.t<string>,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@module("@pulumi/aws") @scope("kms") @new
|
|
16
|
+
external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t = "Alias"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @pulumi/aws/kms/key
|
|
2
|
+
see: https://www.pulumi.com/registry/packages/aws/api-docs/kms/key
|
|
3
|
+
*/
|
|
4
|
+
type t = {
|
|
5
|
+
arn: Pulumi.Output.t<string>,
|
|
6
|
+
id: Pulumi.Output.t<string>,
|
|
7
|
+
keyId: Pulumi.Output.t<string>,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type args = {
|
|
11
|
+
description?: Pulumi.Input.t<string>,
|
|
12
|
+
/** Days a scheduled deletion waits, 7 to 30. */
|
|
13
|
+
deletionWindowInDays?: Pulumi.Input.t<int>,
|
|
14
|
+
enableKeyRotation?: Pulumi.Input.t<bool>,
|
|
15
|
+
/** `ENCRYPT_DECRYPT` (the default) for a symmetric key. */
|
|
16
|
+
keyUsage?: Pulumi.Input.t<string>,
|
|
17
|
+
/** A JSON key policy; absent, the account's default policy applies. */
|
|
18
|
+
policy?: Pulumi.Input.t<string>,
|
|
19
|
+
tags?: Pulumi.Input.t<Aws.tags>,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@module("@pulumi/aws") @scope("kms") @new
|
|
23
|
+
external make: (~name: string, ~args: args=?, ~opts: Pulumi.CustomResourceOptions.t=?) => t = "Key"
|
|
@@ -37,5 +37,8 @@ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.
|
|
|
37
37
|
"FunctionUrl"
|
|
38
38
|
|
|
39
39
|
@module("@pulumi/aws") @scope(("lambda", "FunctionUrl"))
|
|
40
|
-
external get: (
|
|
41
|
-
|
|
40
|
+
external get: (
|
|
41
|
+
~name: string,
|
|
42
|
+
~id: Pulumi.Input.t<string>,
|
|
43
|
+
~opts: Pulumi.CustomResourceOptions.t=?,
|
|
44
|
+
) => t = "get"
|