@reventlessdev/rescript-pulumi-aws 3.0.0-alpha.2 → 3.0.0-alpha.20
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 +152 -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 +495 -363
- package/src/AppSync/AppSync_Resolver_Functions.res.mjs +182 -97
- 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 +0 -1
- package/src/Cognito/Cognito_UserPool.res +2 -4
- package/src/DynamoDb/DynamoDb_Table.res +23 -0
- package/src/DynamoDb/DynamoDb_Table.res.mjs +8 -1
- 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/Lambda/FunctionUrl.res +5 -2
- package/src/Lambda/Lambda.res +134 -52
- 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_BucketV2.res +1 -3
- 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 +368 -26
|
@@ -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"
|
package/src/Lambda/Lambda.res
CHANGED
|
@@ -46,54 +46,136 @@ type eventHandlerNoResult<'event> = eventHandler<'event, unit>
|
|
|
46
46
|
@send
|
|
47
47
|
external getRemainingTimeInMillis: context => int = "getRemainingTimeInMillis"
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
49
|
+
/** The outcome of looking for the Reventless layer. `region` is `None` when
|
|
50
|
+
neither the stack nor the environment names one, and the AWS CLI's default
|
|
51
|
+
region was asked. */
|
|
52
|
+
type layerLookup =
|
|
53
|
+
| Found(string)
|
|
54
|
+
| NotFound({parameter: string, region: option<string>})
|
|
55
|
+
| CouldNotLook({parameter: string, region: option<string>, reason: string})
|
|
56
|
+
|
|
57
|
+
let layerParameter = stack => `/reventless/layer-arn/${stack}`
|
|
58
|
+
|
|
59
|
+
let _nonEmpty = value =>
|
|
60
|
+
switch value->Option.map(String.trim) {
|
|
61
|
+
| Some("") | None => None
|
|
62
|
+
| trimmed => trimmed
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let _lookupRegion = () =>
|
|
66
|
+
switch Pulumi.Config.make(Some("aws"))->Pulumi.Config.get("region")->_nonEmpty {
|
|
67
|
+
| Some(_) as region => region
|
|
68
|
+
| None =>
|
|
69
|
+
switch NodeProcess.env->Dict.get("AWS_REGION")->_nonEmpty {
|
|
70
|
+
| Some(_) as region => region
|
|
71
|
+
| None => NodeProcess.env->Dict.get("AWS_DEFAULT_REGION")->_nonEmpty
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
let _firstLine = text =>
|
|
76
|
+
text
|
|
77
|
+
->String.split("\n")
|
|
78
|
+
->Array.map(String.trim)
|
|
79
|
+
->Array.find(line => line !== "")
|
|
80
|
+
->Option.getOr("the AWS CLI exited without saying why")
|
|
81
|
+
|
|
82
|
+
/** Reads the result of `aws ssm get-parameter`: only `ParameterNotFound` means
|
|
83
|
+
there is no layer; a missing CLI or a refused call means nobody could tell. */
|
|
84
|
+
let classifySsmLookup = (
|
|
85
|
+
~parameter,
|
|
86
|
+
~region,
|
|
87
|
+
result: NodeChildProcess.spawnSyncResult,
|
|
88
|
+
): layerLookup => {
|
|
89
|
+
let stderr = result.stderr->Nullable.toOption->Option.getOr("")
|
|
90
|
+
switch (result.error->Nullable.toOption, result.status->Nullable.toOption) {
|
|
91
|
+
| (Some(error), _) =>
|
|
92
|
+
let message = error->JsExn.message->Option.getOr("unknown error")
|
|
93
|
+
CouldNotLook({parameter, region, reason: `the AWS CLI could not be run (${message})`})
|
|
94
|
+
| (None, Some(0)) =>
|
|
95
|
+
switch result.stdout->Nullable.toOption->_nonEmpty {
|
|
96
|
+
| None | Some("None") => NotFound({parameter, region})
|
|
97
|
+
| Some(arn) => Found(arn)
|
|
98
|
+
}
|
|
99
|
+
| (None, _) if stderr->String.includes("ParameterNotFound") => NotFound({parameter, region})
|
|
100
|
+
| (None, _) => CouldNotLook({parameter, region, reason: _firstLine(stderr)})
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let _lookupInSsm = (): layerLookup => {
|
|
105
|
+
let parameter = layerParameter(Pulumi.Pulumi.getStackName())
|
|
106
|
+
let region = _lookupRegion()
|
|
107
|
+
let regionArgs = region->Option.mapOr([], region => ["--region", region])
|
|
108
|
+
NodeChildProcess.spawnSync(
|
|
109
|
+
"aws",
|
|
110
|
+
[
|
|
111
|
+
"ssm",
|
|
112
|
+
"get-parameter",
|
|
113
|
+
"--name",
|
|
114
|
+
parameter,
|
|
115
|
+
"--query",
|
|
116
|
+
"Parameter.Value",
|
|
117
|
+
"--output",
|
|
118
|
+
"text",
|
|
119
|
+
]->Array.concat(regionArgs),
|
|
120
|
+
{encoding: "utf8"},
|
|
121
|
+
)->classifySsmLookup(~parameter, ~region, _)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
let _lookup: ref<option<layerLookup>> = ref(None)
|
|
125
|
+
|
|
126
|
+
/** Looks once per deploy: `REVENTLESS_LAYER_ARN` when set (CI exports it),
|
|
127
|
+
otherwise the stack's SSM parameter through the AWS CLI, in the stack's
|
|
128
|
+
`aws:region` when it sets one. */
|
|
129
|
+
let lookupLayer = (): layerLookup =>
|
|
130
|
+
switch _lookup.contents {
|
|
131
|
+
| Some(lookup) => lookup
|
|
132
|
+
| None =>
|
|
133
|
+
let lookup = switch NodeProcess.env->Dict.get("REVENTLESS_LAYER_ARN")->_nonEmpty {
|
|
134
|
+
| Some(arn) => Found(arn)
|
|
135
|
+
| None => _lookupInSsm()
|
|
77
136
|
}
|
|
137
|
+
_lookup := Some(lookup)
|
|
138
|
+
lookup
|
|
78
139
|
}
|
|
79
140
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
141
|
+
let _regionName = region =>
|
|
142
|
+
region->Option.mapOr("the AWS CLI's default region", region => `region ${region}`)
|
|
143
|
+
|
|
144
|
+
let _publishHint = `Publish the layer and store its ARN in that parameter, or set REVENTLESS_LAYER_ARN: https://docs.reventless.dev/infrastructure/aws/get-started#the-lambda-layer`
|
|
145
|
+
|
|
146
|
+
/** Why a deploy cannot go on without the layer, or `None` when it was found. */
|
|
147
|
+
let missingLayerMessage = lookup =>
|
|
148
|
+
switch lookup {
|
|
149
|
+
| Found(_) => None
|
|
150
|
+
| NotFound({parameter, region}) =>
|
|
151
|
+
Some(
|
|
152
|
+
`No Reventless Lambda layer: the SSM parameter ${parameter} does not exist in ${_regionName(
|
|
153
|
+
region,
|
|
154
|
+
)}. Without the layer every function fails with "Cannot find package" on its first run. ${_publishHint}`,
|
|
155
|
+
)
|
|
156
|
+
| CouldNotLook({parameter, region, reason}) =>
|
|
157
|
+
Some(
|
|
158
|
+
`Could not look up the Reventless Lambda layer in the SSM parameter ${parameter} (${_regionName(
|
|
159
|
+
region,
|
|
160
|
+
)}): ${reason}. ${_publishHint}`,
|
|
161
|
+
)
|
|
95
162
|
}
|
|
96
163
|
|
|
164
|
+
/** The layer's ARN. Throws with `missingLayerMessage` when there is none, so a
|
|
165
|
+
function is never created without the framework code it imports. */
|
|
166
|
+
let reventlessLayerArn = (): string =>
|
|
167
|
+
switch lookupLayer() {
|
|
168
|
+
| Found(arn) => arn
|
|
169
|
+
| lookup =>
|
|
170
|
+
JsError.throwWithMessage(
|
|
171
|
+
missingLayerMessage(lookup)->Option.getOr("No Reventless Lambda layer"),
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** The `layers` argument of every framework function. */
|
|
176
|
+
let reventlessLayers = (): Pulumi.Input.t<array<Pulumi.Input.t<string>>> =>
|
|
177
|
+
[reventlessLayerArn()->Pulumi.Input.make]->Pulumi.Input.make
|
|
178
|
+
|
|
97
179
|
@val
|
|
98
180
|
external environment: option<string> = "process.env.Environment"
|
|
99
181
|
|
|
@@ -151,10 +233,7 @@ module CallbackFunction = {
|
|
|
151
233
|
~memorySize=1024->Pulumi.Input.make,
|
|
152
234
|
~timeout=180->Pulumi.Input.make,
|
|
153
235
|
~runtime=NodeJs22,
|
|
154
|
-
~layers=
|
|
155
|
-
->Option.map(arn => [arn->Pulumi.Input.make])
|
|
156
|
-
->Option.getOr([])
|
|
157
|
-
->Pulumi.Input.make,
|
|
236
|
+
~layers=reventlessLayers(),
|
|
158
237
|
~vpcConfig=?,
|
|
159
238
|
~tags=?,
|
|
160
239
|
~environment={
|
|
@@ -253,14 +332,17 @@ module Function = {
|
|
|
253
332
|
id: Pulumi.Output.t<string>,
|
|
254
333
|
name: Pulumi.Output.t<string>,
|
|
255
334
|
invokeArn: Pulumi.Output.t<string>,
|
|
335
|
+
/** When AWS last wrote the function. Server-computed and different after
|
|
336
|
+
every code update, which is what separates it from the four identifiers
|
|
337
|
+
above: those are equal before and after, so the engine can resolve them
|
|
338
|
+
from existing state without waiting for the update. Depend on this one to
|
|
339
|
+
wait for the new code to actually be live. */
|
|
340
|
+
lastModified: Pulumi.Output.t<string>,
|
|
256
341
|
}
|
|
257
342
|
|
|
258
343
|
@module("@pulumi/aws") @scope("lambda") @new
|
|
259
|
-
external make: (
|
|
260
|
-
|
|
261
|
-
~args: args,
|
|
262
|
-
~opts: Pulumi.CustomResourceOptions.t=?,
|
|
263
|
-
) => t = "Function"
|
|
344
|
+
external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
|
|
345
|
+
"Function"
|
|
264
346
|
|
|
265
347
|
@module("@pulumi/aws") @scope(("lambda", "Function"))
|
|
266
348
|
external get: (
|
|
@@ -1,43 +1,161 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
+
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
3
4
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
|
-
import * as Child_process from "child_process";
|
|
5
5
|
import * as Pulumi from "@pulumi/pulumi";
|
|
6
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
7
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
8
|
+
import * as Nodechild_process from "node:child_process";
|
|
6
9
|
import * as PolicyDocument$PulumiAws from "../IAM/PolicyDocument.res.mjs";
|
|
7
10
|
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
function layerParameter(stack) {
|
|
12
|
+
return `/reventless/layer-arn/` + stack;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function _nonEmpty(value) {
|
|
16
|
+
let trimmed = Stdlib_Option.map(value, prim => prim.trim());
|
|
17
|
+
if (trimmed !== undefined && trimmed !== "") {
|
|
18
|
+
return trimmed;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _lookupRegion() {
|
|
23
|
+
let region = _nonEmpty(new Pulumi.Config("aws").get("region"));
|
|
24
|
+
if (region !== undefined) {
|
|
25
|
+
return region;
|
|
12
26
|
}
|
|
13
|
-
|
|
14
|
-
|
|
27
|
+
let region$1 = _nonEmpty(process.env["AWS_REGION"]);
|
|
28
|
+
if (region$1 !== undefined) {
|
|
29
|
+
return region$1;
|
|
30
|
+
} else {
|
|
31
|
+
return _nonEmpty(process.env["AWS_DEFAULT_REGION"]);
|
|
15
32
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _firstLine(text) {
|
|
36
|
+
return Stdlib_Option.getOr(text.split("\n").map(prim => prim.trim()).find(line => line !== ""), "the AWS CLI exited without saying why");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function classifySsmLookup(parameter, region, result) {
|
|
40
|
+
let stderr = Stdlib_Option.getOr(Primitive_option.fromNullable(result.stderr), "");
|
|
41
|
+
let match = result.error;
|
|
42
|
+
let match$1 = result.status;
|
|
43
|
+
if (match == null) {
|
|
44
|
+
if (!(match$1 == null) && match$1 === 0) {
|
|
45
|
+
let arn = _nonEmpty(Primitive_option.fromNullable(result.stdout));
|
|
46
|
+
if (arn !== undefined && arn !== "None") {
|
|
47
|
+
return {
|
|
48
|
+
TAG: "Found",
|
|
49
|
+
_0: arn
|
|
50
|
+
};
|
|
51
|
+
} else {
|
|
52
|
+
return {
|
|
53
|
+
TAG: "NotFound",
|
|
54
|
+
parameter: parameter,
|
|
55
|
+
region: region
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (stderr.includes("ParameterNotFound")) {
|
|
60
|
+
return {
|
|
61
|
+
TAG: "NotFound",
|
|
62
|
+
parameter: parameter,
|
|
63
|
+
region: region
|
|
64
|
+
};
|
|
24
65
|
} else {
|
|
25
|
-
return
|
|
66
|
+
return {
|
|
67
|
+
TAG: "CouldNotLook",
|
|
68
|
+
parameter: parameter,
|
|
69
|
+
region: region,
|
|
70
|
+
reason: _firstLine(stderr)
|
|
71
|
+
};
|
|
26
72
|
}
|
|
27
|
-
} catch (exn) {
|
|
28
|
-
return;
|
|
29
73
|
}
|
|
74
|
+
let message = Stdlib_Option.getOr(Stdlib_JsExn.message(match), "unknown error");
|
|
75
|
+
return {
|
|
76
|
+
TAG: "CouldNotLook",
|
|
77
|
+
parameter: parameter,
|
|
78
|
+
region: region,
|
|
79
|
+
reason: `the AWS CLI could not be run (` + message + `)`
|
|
80
|
+
};
|
|
30
81
|
}
|
|
31
82
|
|
|
32
|
-
|
|
83
|
+
function _lookupInSsm() {
|
|
84
|
+
let parameter = layerParameter(Pulumi.getStack());
|
|
85
|
+
let region = _lookupRegion();
|
|
86
|
+
let regionArgs = Stdlib_Option.mapOr(region, [], region => [
|
|
87
|
+
"--region",
|
|
88
|
+
region
|
|
89
|
+
]);
|
|
90
|
+
return classifySsmLookup(parameter, region, Nodechild_process.spawnSync("aws", [
|
|
91
|
+
"ssm",
|
|
92
|
+
"get-parameter",
|
|
93
|
+
"--name",
|
|
94
|
+
parameter,
|
|
95
|
+
"--query",
|
|
96
|
+
"Parameter.Value",
|
|
97
|
+
"--output",
|
|
98
|
+
"text"
|
|
99
|
+
].concat(regionArgs), {
|
|
100
|
+
encoding: "utf8"
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
33
103
|
|
|
34
|
-
let
|
|
104
|
+
let _lookup = {
|
|
105
|
+
contents: undefined
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
function lookupLayer() {
|
|
109
|
+
let lookup = _lookup.contents;
|
|
110
|
+
if (lookup !== undefined) {
|
|
111
|
+
return lookup;
|
|
112
|
+
}
|
|
113
|
+
let arn = _nonEmpty(process.env["REVENTLESS_LAYER_ARN"]);
|
|
114
|
+
let lookup$1 = arn !== undefined ? ({
|
|
115
|
+
TAG: "Found",
|
|
116
|
+
_0: arn
|
|
117
|
+
}) : _lookupInSsm();
|
|
118
|
+
_lookup.contents = lookup$1;
|
|
119
|
+
return lookup$1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function _regionName(region) {
|
|
123
|
+
return Stdlib_Option.mapOr(region, "the AWS CLI's default region", region => `region ` + region);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let _publishHint = `Publish the layer and store its ARN in that parameter, or set REVENTLESS_LAYER_ARN: https://docs.reventless.dev/infrastructure/aws/get-started#the-lambda-layer`;
|
|
127
|
+
|
|
128
|
+
function missingLayerMessage(lookup) {
|
|
129
|
+
switch (lookup.TAG) {
|
|
130
|
+
case "Found" :
|
|
131
|
+
return;
|
|
132
|
+
case "NotFound" :
|
|
133
|
+
return `No Reventless Lambda layer: the SSM parameter ` + lookup.parameter + ` does not exist in ` + _regionName(lookup.region) + `. Without the layer every function fails with "Cannot find package" on its first run. ` + _publishHint;
|
|
134
|
+
case "CouldNotLook" :
|
|
135
|
+
return `Could not look up the Reventless Lambda layer in the SSM parameter ` + lookup.parameter + ` (` + _regionName(lookup.region) + `): ` + lookup.reason + `. ` + _publishHint;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function reventlessLayerArn() {
|
|
140
|
+
let arn = lookupLayer();
|
|
141
|
+
switch (arn.TAG) {
|
|
142
|
+
case "Found" :
|
|
143
|
+
return arn._0;
|
|
144
|
+
case "NotFound" :
|
|
145
|
+
case "CouldNotLook" :
|
|
146
|
+
return Stdlib_JsError.throwWithMessage(Stdlib_Option.getOr(missingLayerMessage(arn), "No Reventless Lambda layer"));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function reventlessLayers() {
|
|
151
|
+
return [reventlessLayerArn()];
|
|
152
|
+
}
|
|
35
153
|
|
|
36
154
|
function make(callback, role, policies, deadLetterConfig, tracingConfig, memorySizeOpt, timeoutOpt, runtimeOpt, layersOpt, vpcConfig, tags, environmentOpt) {
|
|
37
155
|
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
38
156
|
let timeout = timeoutOpt !== undefined ? timeoutOpt : 180;
|
|
39
157
|
let runtime = runtimeOpt !== undefined ? runtimeOpt : "nodejs22.x";
|
|
40
|
-
let layers = layersOpt !== undefined ? layersOpt :
|
|
158
|
+
let layers = layersOpt !== undefined ? layersOpt : [reventlessLayerArn()];
|
|
41
159
|
let environment = environmentOpt !== undefined ? environmentOpt : ({
|
|
42
160
|
variables: Object.fromEntries([[
|
|
43
161
|
"Environment",
|
|
@@ -86,12 +204,23 @@ let defaultLoggingPolicyDocument = PolicyDocument$PulumiAws.make(undefined, unde
|
|
|
86
204
|
}]);
|
|
87
205
|
|
|
88
206
|
export {
|
|
89
|
-
|
|
207
|
+
layerParameter,
|
|
208
|
+
_nonEmpty,
|
|
209
|
+
_lookupRegion,
|
|
210
|
+
_firstLine,
|
|
211
|
+
classifySsmLookup,
|
|
212
|
+
_lookupInSsm,
|
|
213
|
+
_lookup,
|
|
214
|
+
lookupLayer,
|
|
215
|
+
_regionName,
|
|
216
|
+
_publishHint,
|
|
217
|
+
missingLayerMessage,
|
|
90
218
|
reventlessLayerArn,
|
|
219
|
+
reventlessLayers,
|
|
91
220
|
CallbackFunction,
|
|
92
221
|
$$Function,
|
|
93
222
|
Permission,
|
|
94
223
|
Invocation,
|
|
95
224
|
defaultLoggingPolicyDocument,
|
|
96
225
|
}
|
|
97
|
-
/*
|
|
226
|
+
/* defaultLoggingPolicyDocument Not a pure module */
|
package/src/Rds/Rds_Cluster.res
CHANGED
package/src/Rds/Rds_Instance.res
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @pulumi/aws/rds/instance
|
|
2
2
|
see: https://www.pulumi.com/registry/packages/aws/api-docs/rds/instance
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
4
|
/** One entry of `masterUserSecrets`, populated when `manageMasterUserPassword`
|
|
6
5
|
is true — RDS creates and rotates the master password in Secrets Manager and
|
|
7
6
|
reports the secret ARN here. */
|
package/src/Rds/Rds_Proxy.res
CHANGED
|
@@ -34,5 +34,4 @@ type args = {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
@module("@pulumi/aws") @scope("rds") @new
|
|
37
|
-
external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
|
|
38
|
-
"Proxy"
|
|
37
|
+
external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t = "Proxy"
|
package/src/S3/S3_BucketV2.res
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Compile-only smoke for the EventBridge bindings: a rule that matches CloudWatch
|
|
2
|
+
// alarm state changes by pattern, and an SNS target that rewrites the matched event
|
|
3
|
+
// into a plain-text body rather than forwarding the raw JSON. Not executed at deploy
|
|
4
|
+
// time — it keeps `eventPattern` and `inputTransformer` type-checked together.
|
|
5
|
+
|
|
6
|
+
let alarmMailTopic = SNS.Topic.make(~name="example-alarm-mail")
|
|
7
|
+
|
|
8
|
+
let alarmStateChanges = Cloudwatch.EventRule.make(
|
|
9
|
+
~name="example-alarm-state-changes",
|
|
10
|
+
~args={
|
|
11
|
+
description: "CloudWatch alarm state changes, ALARM and OK only"->Pulumi.Input.make,
|
|
12
|
+
eventPattern: `{"source":["aws.cloudwatch"],"detail-type":["CloudWatch Alarm State Change"],"detail":{"state":{"value":["ALARM","OK"]}}}`->Pulumi.Input.make,
|
|
13
|
+
},
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
// A template that is not JSON has to arrive quoted — the surrounding double quotes are
|
|
17
|
+
// part of the value, not ReScript syntax.
|
|
18
|
+
let mailBody: Cloudwatch.EventTarget.inputTransformer = {
|
|
19
|
+
inputPaths: Dict.fromArray([
|
|
20
|
+
("name", "$.detail.alarmName"),
|
|
21
|
+
("state", "$.detail.state.value"),
|
|
22
|
+
("reason", "$.detail.state.reason"),
|
|
23
|
+
]),
|
|
24
|
+
inputTemplate: `"<state>: <name> — <reason>"`->Pulumi.Input.make,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let _ = Cloudwatch.EventTarget.make(
|
|
28
|
+
~name="example-alarm-mail-target",
|
|
29
|
+
~args={
|
|
30
|
+
rule: Cloudwatch.EventTarget.Rule.ofEventRule(alarmStateChanges),
|
|
31
|
+
arn: alarmMailTopic.arn->Pulumi.Output.asInput,
|
|
32
|
+
inputTransformer: mailBody->Pulumi.Input.make,
|
|
33
|
+
},
|
|
34
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Aws from "@pulumi/aws";
|
|
4
|
+
import * as Cloudwatch_EventTarget$PulumiAws from "../Cloudwatch/Cloudwatch_EventTarget.res.mjs";
|
|
5
|
+
|
|
6
|
+
let alarmMailTopic = new (Aws.sns.Topic)("example-alarm-mail");
|
|
7
|
+
|
|
8
|
+
let alarmStateChanges = new (Aws.cloudwatch.EventRule)("example-alarm-state-changes", {
|
|
9
|
+
description: "CloudWatch alarm state changes, ALARM and OK only",
|
|
10
|
+
eventPattern: `{"source":["aws.cloudwatch"],"detail-type":["CloudWatch Alarm State Change"],"detail":{"state":{"value":["ALARM","OK"]}}}`
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
let mailBody_inputPaths = Object.fromEntries([
|
|
14
|
+
[
|
|
15
|
+
"name",
|
|
16
|
+
"$.detail.alarmName"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"state",
|
|
20
|
+
"$.detail.state.value"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"reason",
|
|
24
|
+
"$.detail.state.reason"
|
|
25
|
+
]
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
let mailBody = {
|
|
29
|
+
inputPaths: mailBody_inputPaths,
|
|
30
|
+
inputTemplate: `"<state>: <name> — <reason>"`
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
new (Aws.cloudwatch.EventTarget)("example-alarm-mail-target", {
|
|
34
|
+
rule: Cloudwatch_EventTarget$PulumiAws.Rule.ofEventRule(alarmStateChanges),
|
|
35
|
+
arn: alarmMailTopic.arn,
|
|
36
|
+
inputTransformer: mailBody
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
alarmMailTopic,
|
|
41
|
+
alarmStateChanges,
|
|
42
|
+
mailBody,
|
|
43
|
+
}
|
|
44
|
+
/* alarmMailTopic Not a pure module */
|
|
@@ -18,9 +18,8 @@ let cert = Acm.Certificate.make(
|
|
|
18
18
|
~opts={provider: usEast1},
|
|
19
19
|
)
|
|
20
20
|
|
|
21
|
-
let firstValidationOption =
|
|
22
|
-
opts->Array.getUnsafe(0)
|
|
23
|
-
)
|
|
21
|
+
let firstValidationOption =
|
|
22
|
+
cert.domainValidationOptions->Pulumi.Output.apply(opts => opts->Array.getUnsafe(0))
|
|
24
23
|
|
|
25
24
|
let validationRecord = Route53.Record.make(
|
|
26
25
|
~name="example-cert-validation",
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
let mergedExecRole = IAM.Role.make(
|
|
9
9
|
~name="example-merged-exec-role",
|
|
10
10
|
~args={
|
|
11
|
-
assumeRolePolicy: Pulumi.Input.make(
|
|
12
|
-
`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"appsync.amazonaws.com"},"Action":"sts:AssumeRole"}]}`,
|
|
13
|
-
),
|
|
11
|
+
assumeRolePolicy: Pulumi.Input.make(`{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"appsync.amazonaws.com"},"Action":"sts:AssumeRole"}]}`),
|
|
14
12
|
},
|
|
15
13
|
)
|
|
16
14
|
|