cdk-serverless 2.11.22 → 2.11.24
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/README.md +39 -0
- package/docs/constructs/assets/highlight.css +12 -12
- package/docs/constructs/classes/AssetCdn.html +31 -7
- package/docs/constructs/classes/BaseApi.html +4 -0
- package/docs/constructs/classes/CognitoAuthentication.html +35 -9
- package/docs/constructs/classes/GraphQlApi.html +47 -11
- package/docs/constructs/classes/LambdaFunction.html +34 -12
- package/docs/constructs/classes/RestApi.html +47 -11
- package/docs/constructs/classes/SingleTableDatastore.html +26 -5
- package/docs/constructs/classes/Workflow.html +34 -7
- package/docs/constructs/index.html +13 -0
- package/docs/constructs/interfaces/AssetCdnProps.html +4 -0
- package/docs/constructs/interfaces/BaseApiProps.html +7 -7
- package/docs/constructs/interfaces/CognitoAuthenticationProps.html +3 -3
- package/docs/constructs/interfaces/GraphQlApiProps.html +7 -7
- package/docs/constructs/interfaces/JsResolverOptions.html +2 -2
- package/docs/constructs/interfaces/LambdaFunctionProps.html +2 -2
- package/docs/constructs/interfaces/LambdaTracingOptions.html +1 -1
- package/docs/constructs/interfaces/RestApiProps.html +8 -8
- package/docs/constructs/interfaces/SingleTableDatastoreProps.html +1 -1
- package/docs/constructs/interfaces/SingleTableDesign.html +1 -1
- package/docs/constructs/interfaces/VtlResolverOptions.html +1 -1
- package/docs/lambda/assets/highlight.css +35 -0
- package/docs/lambda/classes/errors.BadRequestError.html +15 -3
- package/docs/lambda/classes/errors.ForbiddenError.html +15 -3
- package/docs/lambda/classes/errors.HttpError.html +18 -4
- package/docs/lambda/classes/errors.NotFoundError.html +15 -3
- package/docs/lambda/classes/errors.UnauthenticatedError.html +15 -3
- package/docs/lambda/index.html +13 -0
- package/docs/projen/assets/highlight.css +19 -12
- package/docs/projen/classes/Datastore.html +9 -0
- package/docs/projen/classes/GraphQlApi.html +9 -0
- package/docs/projen/classes/RestApi.html +79 -19
- package/docs/projen/classes/ServerlessProject.html +16 -2
- package/docs/projen/classes/Workflow.html +46 -10
- package/docs/projen/index.html +13 -0
- package/docs/projen/interfaces/ServerlessProjectOptions.html +74 -74
- package/lib/constructs/asset-cdn.d.ts +24 -0
- package/lib/constructs/asset-cdn.js +13 -1
- package/lib/constructs/authentication.d.ts +26 -0
- package/lib/constructs/authentication.js +12 -1
- package/lib/constructs/base-api.d.ts +3 -0
- package/lib/constructs/base-api.js +4 -1
- package/lib/constructs/func.d.ts +31 -0
- package/lib/constructs/func.js +32 -1
- package/lib/constructs/graphql.d.ts +41 -0
- package/lib/constructs/graphql.js +33 -1
- package/lib/constructs/rest-api.d.ts +41 -0
- package/lib/constructs/rest-api.js +36 -1
- package/lib/constructs/table.d.ts +40 -0
- package/lib/constructs/table.js +38 -1
- package/lib/constructs/workflow.d.ts +46 -0
- package/lib/constructs/workflow.js +38 -1
- package/lib/lambda/errors.d.ts +41 -0
- package/lib/lambda/errors.js +42 -1
- package/lib/projen/core.d.ts +19 -0
- package/lib/projen/core.js +20 -1
- package/lib/projen/datastore.d.ts +11 -0
- package/lib/projen/datastore.js +12 -1
- package/lib/projen/graphql.d.ts +11 -0
- package/lib/projen/graphql.js +12 -1
- package/lib/projen/rest-api.d.ts +52 -0
- package/lib/projen/rest-api.js +53 -1
- package/lib/projen/workflow.d.ts +34 -0
- package/lib/projen/workflow.js +35 -1
- package/package.json +5 -6
|
@@ -14,14 +14,29 @@
|
|
|
14
14
|
<ul class="tsd-breadcrumb">
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="RestApi.html">RestApi</a></li></ul>
|
|
17
|
-
<h1>Class RestApi<PATHS, OPS></h1></div>
|
|
17
|
+
<h1>Class RestApi<PATHS, OPS></h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>The RestApi construct sets up an AWS API Gateway REST API using OpenAPI specification.
|
|
20
|
+
This construct facilitates the creation of a REST API with various configurations, including custom domain, CORS support, and integration with Lambda functions.
|
|
21
|
+
It allows auto-generating routes based on the provided OpenAPI definition and provides methods to dynamically add custom routes and manage Lambda function integrations.</p>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="tsd-comment tsd-typography">
|
|
24
|
+
<h4>Example</h4><pre><code class="language-ts"><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">api</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">RestApi</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'MyRestApi'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">apiName:</span><span class="hl-1"> </span><span class="hl-2">'MyAPI'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">stageName:</span><span class="hl-1"> </span><span class="hl-2">'dev'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">definitionFileName:</span><span class="hl-1"> </span><span class="hl-2">'openapi.yaml'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">authentication:</span><span class="hl-1"> </span><span class="hl-4">myCognitoAuth</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">singleTableDatastore:</span><span class="hl-1"> </span><span class="hl-4">myDynamoDBTable</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">autoGenerateRoutes:</span><span class="hl-1"> </span><span class="hl-5">true</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Add a custom REST resource</span><br/><span class="hl-4">api</span><span class="hl-1">.</span><span class="hl-0">addRestResource</span><span class="hl-1">(</span><span class="hl-2">'/items'</span><span class="hl-1">, </span><span class="hl-2">'get'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Get the Lambda function for a specific operation</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">lambdaFunction</span><span class="hl-1"> = </span><span class="hl-4">api</span><span class="hl-1">.</span><span class="hl-0">getFunctionForOperation</span><span class="hl-1">(</span><span class="hl-2">'getItems'</span><span class="hl-1">);</span>
|
|
25
|
+
</code><button>Copy</button></pre>
|
|
26
|
+
</div></section>
|
|
18
27
|
<section class="tsd-panel">
|
|
19
28
|
<h4>Type Parameters</h4>
|
|
20
29
|
<ul class="tsd-type-parameter-list">
|
|
21
30
|
<li>
|
|
22
|
-
<h4><span class="tsd-kind-type-parameter">PATHS</span></h4
|
|
31
|
+
<h4><span class="tsd-kind-type-parameter">PATHS</span></h4>
|
|
32
|
+
<div class="tsd-comment tsd-typography"><p>The type definition for the API paths.</p>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="tsd-comment tsd-typography"></div></li>
|
|
23
35
|
<li>
|
|
24
|
-
<h4><span class="tsd-kind-type-parameter">OPS</span></h4
|
|
36
|
+
<h4><span class="tsd-kind-type-parameter">OPS</span></h4>
|
|
37
|
+
<div class="tsd-comment tsd-typography"><p>The type definition for the API operations.</p>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></section>
|
|
25
40
|
<section class="tsd-panel tsd-hierarchy">
|
|
26
41
|
<h4>Hierarchy</h4>
|
|
27
42
|
<ul class="tsd-hierarchy">
|
|
@@ -69,6 +84,8 @@
|
|
|
69
84
|
<ul class="tsd-signatures">
|
|
70
85
|
<li class="tsd-signature tsd-anchor-link" id="constructor.new_RestApi"><span class="tsd-kind-constructor-signature">new <wbr/>Rest<wbr/>Api</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">PATHS</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">OPS</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">scope</span>, <span class="tsd-kind-parameter">id</span>, <span class="tsd-kind-parameter">props</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="RestApi.html" class="tsd-signature-type tsd-kind-class">RestApi</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">PATHS</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">OPS</span><span class="tsd-signature-symbol">></span><a href="#constructor.new_RestApi" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
71
86
|
<li class="tsd-description">
|
|
87
|
+
<div class="tsd-comment tsd-typography"><p>Creates an instance of RestApi.</p>
|
|
88
|
+
</div>
|
|
72
89
|
<section class="tsd-panel">
|
|
73
90
|
<h4>Type Parameters</h4>
|
|
74
91
|
<ul class="tsd-type-parameter-list">
|
|
@@ -80,26 +97,39 @@
|
|
|
80
97
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
81
98
|
<ul class="tsd-parameter-list">
|
|
82
99
|
<li>
|
|
83
|
-
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5
|
|
100
|
+
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5>
|
|
101
|
+
<div class="tsd-comment tsd-typography"><p>The scope in which this construct is defined.</p>
|
|
102
|
+
</div></li>
|
|
84
103
|
<li>
|
|
85
|
-
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5
|
|
104
|
+
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5>
|
|
105
|
+
<div class="tsd-comment tsd-typography"><p>The scoped construct ID.</p>
|
|
106
|
+
</div></li>
|
|
86
107
|
<li>
|
|
87
|
-
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/RestApiProps.html" class="tsd-signature-type tsd-kind-interface">RestApiProps</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">OPS</span><span class="tsd-signature-symbol">></span></h5
|
|
88
|
-
<
|
|
108
|
+
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/RestApiProps.html" class="tsd-signature-type tsd-kind-interface">RestApiProps</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">OPS</span><span class="tsd-signature-symbol">></span></h5>
|
|
109
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the RestApi construct.</p>
|
|
110
|
+
</div></li></ul></div>
|
|
111
|
+
<h4 class="tsd-returns-title">Returns <a href="RestApi.html" class="tsd-signature-type tsd-kind-class">RestApi</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">PATHS</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">OPS</span><span class="tsd-signature-symbol">></span></h4>
|
|
112
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
89
113
|
<p>Overrides <a href="BaseApi.html">BaseApi</a>.<a href="BaseApi.html#constructor">constructor</a></p></aside></li></ul></section></section>
|
|
90
114
|
<section class="tsd-panel-group tsd-member-group">
|
|
91
115
|
<h2>Properties</h2>
|
|
92
116
|
<section class="tsd-panel tsd-member tsd-is-private"><a id="_functions" class="tsd-anchor"></a>
|
|
93
117
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>_functions</span><a href="#_functions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
94
118
|
<div class="tsd-signature"><span class="tsd-kind-property">_functions</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span>[<span class="tsd-kind-index-signature">operationId</span>: <span class="tsd-signature-type">string</span>]<span class="tsd-signature-symbol">: </span><a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></div>
|
|
119
|
+
<div class="tsd-comment tsd-typography"><p>A collection of Lambda functions used as integrations for the API operations.</p>
|
|
120
|
+
</div>
|
|
95
121
|
<div class="tsd-type-declaration">
|
|
96
122
|
<h4>Type declaration</h4>
|
|
97
123
|
<ul class="tsd-parameters">
|
|
98
124
|
<li class="tsd-parameter-index-signature">
|
|
99
|
-
<h5><span class="tsd-signature-symbol">[</span><span class="tsd-kind-parameter">operationId</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></h5></li></ul></div
|
|
125
|
+
<h5><span class="tsd-signature-symbol">[</span><span class="tsd-kind-parameter">operationId</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></h5></li></ul></div>
|
|
126
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
100
127
|
<section class="tsd-panel tsd-member"><a id="api" class="tsd-anchor"></a>
|
|
101
128
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>api</span><a href="#api" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
102
|
-
<div class="tsd-signature"><span class="tsd-kind-property">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">SpecRestApi</span></div
|
|
129
|
+
<div class="tsd-signature"><span class="tsd-kind-property">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">SpecRestApi</span></div>
|
|
130
|
+
<div class="tsd-comment tsd-typography"><p>The AWS API Gateway REST API instance.</p>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
103
133
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="apiDomainName" class="tsd-anchor"></a>
|
|
104
134
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagOptional">Optional</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>api<wbr/>Domain<wbr/>Name</span><a href="#apiDomainName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
105
135
|
<div class="tsd-signature"><span class="tsd-kind-property">api<wbr/>Domain<wbr/>Name</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
|
|
@@ -114,7 +144,10 @@
|
|
|
114
144
|
<p>Inherited from <a href="BaseApi.html">BaseApi</a>.<a href="BaseApi.html#apiHostName">apiHostName</a></p></aside></section>
|
|
115
145
|
<section class="tsd-panel tsd-member"><a id="apiSpec" class="tsd-anchor"></a>
|
|
116
146
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>api<wbr/>Spec</span><a href="#apiSpec" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
117
|
-
<div class="tsd-signature"><span class="tsd-kind-property">api<wbr/>Spec</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">OpenAPI3</span></div
|
|
147
|
+
<div class="tsd-signature"><span class="tsd-kind-property">api<wbr/>Spec</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">OpenAPI3</span></div>
|
|
148
|
+
<div class="tsd-comment tsd-typography"><p>The OpenAPI specification for the REST API.</p>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
118
151
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="hostedZone" class="tsd-anchor"></a>
|
|
119
152
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagOptional">Optional</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>hosted<wbr/>Zone</span><a href="#hostedZone" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
120
153
|
<div class="tsd-signature"><span class="tsd-kind-property">hosted<wbr/>Zone</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type ">IHostedZone</span></div><aside class="tsd-sources">
|
|
@@ -128,7 +161,10 @@
|
|
|
128
161
|
<p>Inherited from <a href="BaseApi.html">BaseApi</a>.<a href="BaseApi.html#node">node</a></p></aside></section>
|
|
129
162
|
<section class="tsd-panel tsd-member tsd-is-private"><a id="props" class="tsd-anchor"></a>
|
|
130
163
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>props</span><a href="#props" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
131
|
-
<div class="tsd-signature"><span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/RestApiProps.html" class="tsd-signature-type tsd-kind-interface">RestApiProps</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">OPS</span><span class="tsd-signature-symbol">></span></div
|
|
164
|
+
<div class="tsd-signature"><span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/RestApiProps.html" class="tsd-signature-type tsd-kind-interface">RestApiProps</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">OPS</span><span class="tsd-signature-symbol">></span></div>
|
|
165
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the RestApi construct.</p>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="tsd-comment tsd-typography"></div></section></section>
|
|
132
168
|
<section class="tsd-panel-group tsd-member-group">
|
|
133
169
|
<h2>Methods</h2>
|
|
134
170
|
<section class="tsd-panel tsd-member"><a id="addCustomRestResource" class="tsd-anchor"></a>
|
|
@@ -15,6 +15,15 @@
|
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="SingleTableDatastore.html">SingleTableDatastore</a></li></ul>
|
|
17
17
|
<h1>Class SingleTableDatastore</h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>The SingleTableDatastore construct sets up an AWS DynamoDB table with a single-table design.
|
|
20
|
+
This construct facilitates the creation of a DynamoDB table with various configurations, including primary key, sort key, global secondary indexes, local secondary indexes, and encryption.
|
|
21
|
+
It also supports point-in-time recovery and time-to-live attributes.</p>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="tsd-comment tsd-typography">
|
|
24
|
+
<h4>Example</h4><pre><code class="language-ts"><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">datastore</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">SingleTableDatastore</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'MyDatastore'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">design:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">primaryKey:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">partitionKey:</span><span class="hl-1"> </span><span class="hl-2">'PK'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">sortKey:</span><span class="hl-1"> </span><span class="hl-2">'SK'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">globalIndexes:</span><span class="hl-1"> [</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">indexName:</span><span class="hl-1"> </span><span class="hl-2">'GSI1'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">partitionKey:</span><span class="hl-1"> { </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">'GSI1PK'</span><span class="hl-1">, </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-4">dynamodb</span><span class="hl-1">.</span><span class="hl-4">AttributeType</span><span class="hl-1">.</span><span class="hl-7">STRING</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">sortKey:</span><span class="hl-1"> { </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">'GSI1SK'</span><span class="hl-1">, </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-4">dynamodb</span><span class="hl-1">.</span><span class="hl-4">AttributeType</span><span class="hl-1">.</span><span class="hl-7">STRING</span><span class="hl-1"> },</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1"> </span><span class="hl-4">localIndexes:</span><span class="hl-1"> [</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">indexName:</span><span class="hl-1"> </span><span class="hl-2">'LSI1'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">sortKey:</span><span class="hl-1"> { </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">'LSI1SK'</span><span class="hl-1">, </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-4">dynamodb</span><span class="hl-1">.</span><span class="hl-4">AttributeType</span><span class="hl-1">.</span><span class="hl-7">STRING</span><span class="hl-1"> },</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1"> </span><span class="hl-4">timeToLiveAttribute:</span><span class="hl-1"> </span><span class="hl-2">'TTL'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">encryption:</span><span class="hl-1"> </span><span class="hl-4">dynamodb</span><span class="hl-1">.</span><span class="hl-4">TableEncryption</span><span class="hl-1">.</span><span class="hl-7">AWS_MANAGED</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
|
|
25
|
+
</code><button>Copy</button></pre>
|
|
26
|
+
</div></section>
|
|
18
27
|
<section class="tsd-panel tsd-hierarchy">
|
|
19
28
|
<h4>Hierarchy</h4>
|
|
20
29
|
<ul class="tsd-hierarchy">
|
|
@@ -47,16 +56,25 @@
|
|
|
47
56
|
<ul class="tsd-signatures">
|
|
48
57
|
<li class="tsd-signature tsd-anchor-link" id="constructor.new_SingleTableDatastore"><span class="tsd-kind-constructor-signature">new <wbr/>Single<wbr/>Table<wbr/>Datastore</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">scope</span>, <span class="tsd-kind-parameter">id</span>, <span class="tsd-kind-parameter">props</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SingleTableDatastore.html" class="tsd-signature-type tsd-kind-class">SingleTableDatastore</a><a href="#constructor.new_SingleTableDatastore" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
49
58
|
<li class="tsd-description">
|
|
59
|
+
<div class="tsd-comment tsd-typography"><p>Creates an instance of SingleTableDatastore.</p>
|
|
60
|
+
</div>
|
|
50
61
|
<div class="tsd-parameters">
|
|
51
62
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
52
63
|
<ul class="tsd-parameter-list">
|
|
53
64
|
<li>
|
|
54
|
-
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5
|
|
65
|
+
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5>
|
|
66
|
+
<div class="tsd-comment tsd-typography"><p>The scope in which this construct is defined.</p>
|
|
67
|
+
</div></li>
|
|
55
68
|
<li>
|
|
56
|
-
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5
|
|
69
|
+
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5>
|
|
70
|
+
<div class="tsd-comment tsd-typography"><p>The scoped construct ID.</p>
|
|
71
|
+
</div></li>
|
|
57
72
|
<li>
|
|
58
|
-
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/SingleTableDatastoreProps.html" class="tsd-signature-type tsd-kind-interface">SingleTableDatastoreProps</a></h5
|
|
59
|
-
<
|
|
73
|
+
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/SingleTableDatastoreProps.html" class="tsd-signature-type tsd-kind-interface">SingleTableDatastoreProps</a></h5>
|
|
74
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the SingleTableDatastore construct.</p>
|
|
75
|
+
</div></li></ul></div>
|
|
76
|
+
<h4 class="tsd-returns-title">Returns <a href="SingleTableDatastore.html" class="tsd-signature-type tsd-kind-class">SingleTableDatastore</a></h4>
|
|
77
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
60
78
|
<p>Overrides Construct.constructor</p></aside></li></ul></section></section>
|
|
61
79
|
<section class="tsd-panel-group tsd-member-group">
|
|
62
80
|
<h2>Properties</h2>
|
|
@@ -69,7 +87,10 @@
|
|
|
69
87
|
<p>Inherited from Construct.node</p></aside></section>
|
|
70
88
|
<section class="tsd-panel tsd-member"><a id="table" class="tsd-anchor"></a>
|
|
71
89
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>table</span><a href="#table" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
72
|
-
<div class="tsd-signature"><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Table</span></div
|
|
90
|
+
<div class="tsd-signature"><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Table</span></div>
|
|
91
|
+
<div class="tsd-comment tsd-typography"><p>The DynamoDB table instance.</p>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="tsd-comment tsd-typography"></div></section></section>
|
|
73
94
|
<section class="tsd-panel-group tsd-member-group">
|
|
74
95
|
<h2>Methods</h2>
|
|
75
96
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="toString" class="tsd-anchor"></a>
|
|
@@ -15,6 +15,15 @@
|
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="Workflow.html">Workflow</a></li></ul>
|
|
17
17
|
<h1>Class Workflow</h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>The Workflow construct sets up an AWS Step Functions state machine with a specified definition file and IAM role.
|
|
20
|
+
This construct facilitates the creation of a Step Functions workflow, including the definition from an S3 location and
|
|
21
|
+
various configurations for logging and tracing. It implements the IGrantable interface for granting permissions.</p>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="tsd-comment tsd-typography">
|
|
24
|
+
<h4>Example</h4><pre><code class="language-ts"><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">workflow</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">Workflow</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'MyWorkflow'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">definitionFileName:</span><span class="hl-1"> </span><span class="hl-2">'path/to/definition.asl.json'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">stateMachineType:</span><span class="hl-1"> </span><span class="hl-4">sfn</span><span class="hl-1">.</span><span class="hl-4">StateMachineType</span><span class="hl-1">.</span><span class="hl-7">STANDARD</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">loggingConfiguration:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">level:</span><span class="hl-1"> </span><span class="hl-4">sfn</span><span class="hl-1">.</span><span class="hl-4">LogLevel</span><span class="hl-1">.</span><span class="hl-7">ALL</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">includeExecutionData:</span><span class="hl-1"> </span><span class="hl-5">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">destinations:</span><span class="hl-1"> [</span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-4">logs</span><span class="hl-1">.</span><span class="hl-0">LogGroup</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'LogGroup'</span><span class="hl-1">)],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">tracingConfiguration:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">enabled:</span><span class="hl-1"> </span><span class="hl-5">true</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">definitionSubstitutions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">'${MyVariable}'</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-2">'MyValue'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">lambdaFunction</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-4">lambda</span><span class="hl-1">.</span><span class="hl-0">Function</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'MyFunction'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">runtime:</span><span class="hl-1"> </span><span class="hl-4">lambda</span><span class="hl-1">.</span><span class="hl-4">Runtime</span><span class="hl-1">.</span><span class="hl-7">NODEJS_20_X</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">handler:</span><span class="hl-1"> </span><span class="hl-2">'index.handler'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">code:</span><span class="hl-1"> </span><span class="hl-4">lambda</span><span class="hl-1">.</span><span class="hl-4">Code</span><span class="hl-1">.</span><span class="hl-0">fromAsset</span><span class="hl-1">(</span><span class="hl-2">'lambda'</span><span class="hl-1">),</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-4">workflow</span><span class="hl-1">.</span><span class="hl-4">grantPrincipal</span><span class="hl-1">.</span><span class="hl-0">grantInvoke</span><span class="hl-1">(</span><span class="hl-4">lambdaFunction</span><span class="hl-1">);</span>
|
|
25
|
+
</code><button>Copy</button></pre>
|
|
26
|
+
</div></section>
|
|
18
27
|
<section class="tsd-panel tsd-hierarchy">
|
|
19
28
|
<h4>Hierarchy</h4>
|
|
20
29
|
<ul class="tsd-hierarchy">
|
|
@@ -53,22 +62,34 @@
|
|
|
53
62
|
<ul class="tsd-signatures">
|
|
54
63
|
<li class="tsd-signature tsd-anchor-link" id="constructor.new_Workflow"><span class="tsd-kind-constructor-signature">new <wbr/>Workflow</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">scope</span>, <span class="tsd-kind-parameter">id</span>, <span class="tsd-kind-parameter">props</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Workflow.html" class="tsd-signature-type tsd-kind-class">Workflow</a><a href="#constructor.new_Workflow" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
55
64
|
<li class="tsd-description">
|
|
65
|
+
<div class="tsd-comment tsd-typography"><p>Creates an instance of Workflow.</p>
|
|
66
|
+
</div>
|
|
56
67
|
<div class="tsd-parameters">
|
|
57
68
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
58
69
|
<ul class="tsd-parameter-list">
|
|
59
70
|
<li>
|
|
60
|
-
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5
|
|
71
|
+
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5>
|
|
72
|
+
<div class="tsd-comment tsd-typography"><p>The scope in which this construct is defined.</p>
|
|
73
|
+
</div></li>
|
|
61
74
|
<li>
|
|
62
|
-
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5
|
|
75
|
+
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5>
|
|
76
|
+
<div class="tsd-comment tsd-typography"><p>The scoped construct ID.</p>
|
|
77
|
+
</div></li>
|
|
63
78
|
<li>
|
|
64
|
-
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/WorkflowProps.html" class="tsd-signature-type tsd-kind-interface">WorkflowProps</a></h5
|
|
65
|
-
<
|
|
79
|
+
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/WorkflowProps.html" class="tsd-signature-type tsd-kind-interface">WorkflowProps</a></h5>
|
|
80
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the Workflow construct.</p>
|
|
81
|
+
</div></li></ul></div>
|
|
82
|
+
<h4 class="tsd-returns-title">Returns <a href="Workflow.html" class="tsd-signature-type tsd-kind-class">Workflow</a></h4>
|
|
83
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
66
84
|
<p>Overrides constructs.Construct.constructor</p></aside></li></ul></section></section>
|
|
67
85
|
<section class="tsd-panel-group tsd-member-group">
|
|
68
86
|
<h2>Properties</h2>
|
|
69
87
|
<section class="tsd-panel tsd-member"><a id="grantPrincipal" class="tsd-anchor"></a>
|
|
70
88
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>grant<wbr/>Principal</span><a href="#grantPrincipal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
71
|
-
<div class="tsd-signature"><span class="tsd-kind-property">grant<wbr/>Principal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">IPrincipal</span></div
|
|
89
|
+
<div class="tsd-signature"><span class="tsd-kind-property">grant<wbr/>Principal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">IPrincipal</span></div>
|
|
90
|
+
<div class="tsd-comment tsd-typography"><p>The principal to which permissions can be granted.</p>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
72
93
|
<p>Implementation of iam.IGrantable.grantPrincipal</p></aside></section>
|
|
73
94
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="node" class="tsd-anchor"></a>
|
|
74
95
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>node</span><a href="#node" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
@@ -79,10 +100,16 @@
|
|
|
79
100
|
<p>Inherited from constructs.Construct.node</p></aside></section>
|
|
80
101
|
<section class="tsd-panel tsd-member"><a id="role" class="tsd-anchor"></a>
|
|
81
102
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>role</span><a href="#role" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
82
|
-
<div class="tsd-signature"><span class="tsd-kind-property">role</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">IRole</span></div
|
|
103
|
+
<div class="tsd-signature"><span class="tsd-kind-property">role</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">IRole</span></div>
|
|
104
|
+
<div class="tsd-comment tsd-typography"><p>The IAM role assumed by the state machine.</p>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
83
107
|
<section class="tsd-panel tsd-member"><a id="workflowArn" class="tsd-anchor"></a>
|
|
84
108
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>workflow<wbr/>Arn</span><a href="#workflowArn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
85
|
-
<div class="tsd-signature"><span class="tsd-kind-property">workflow<wbr/>Arn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div
|
|
109
|
+
<div class="tsd-signature"><span class="tsd-kind-property">workflow<wbr/>Arn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
110
|
+
<div class="tsd-comment tsd-typography"><p>The ARN of the created state machine.</p>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="tsd-comment tsd-typography"></div></section></section>
|
|
86
113
|
<section class="tsd-panel-group tsd-member-group">
|
|
87
114
|
<h2>Methods</h2>
|
|
88
115
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="toString" class="tsd-anchor"></a>
|
|
@@ -33,6 +33,15 @@
|
|
|
33
33
|
<li>Add 'cdk-serverless' as a dependency to your project</li>
|
|
34
34
|
<li>Run <code>npx projen</code> to install it</li>
|
|
35
35
|
</ol>
|
|
36
|
+
<p>Now you can use the project type <code>ServerlessProject</code> for your repo.</p>
|
|
37
|
+
<a id="md:adding-projen-constructs" class="tsd-anchor"></a><h3><a href="#md:adding-projen-constructs">Adding projen constructs</a></h3><p>First you need to add the desired construct to your projen configuration: (e.g. RestApi)</p>
|
|
38
|
+
<pre><code class="language-typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">RestApi</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/projen'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">RestApi</span><span class="hl-1">(</span><span class="hl-4">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">apiName:</span><span class="hl-1"> </span><span class="hl-2">'TestApi'</span><span class="hl-1">, </span><span class="hl-6">// logical name of your API</span><br/><span class="hl-1"> </span><span class="hl-4">definitionFile:</span><span class="hl-1"> </span><span class="hl-2">'testapi.yaml'</span><span class="hl-1">, </span><span class="hl-6">// path to your OpenAPI spec</span><br/><span class="hl-1">});</span>
|
|
39
|
+
</code><button>Copy</button></pre>
|
|
40
|
+
<p>Then run projen to generate construct files and models for the API.</p>
|
|
41
|
+
<a id="md:using-the-cdk-serverless-l3-constructs" class="tsd-anchor"></a><h3><a href="#md:using-the-cdk-serverless-l3-constructs">Using the CDK serverless L3 constructs</a></h3><p>In your stack you can then reference the generated L3s to create the API:</p>
|
|
42
|
+
<pre><code class="language-typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">TestApiRestApi</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'./generated/rest.testapi-api.generated'</span><span class="hl-1">;</span><br/><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">api</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">TestApiRestApi</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'Api'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">stageName:</span><span class="hl-1"> </span><span class="hl-4">props</span><span class="hl-1">.</span><span class="hl-4">stageName</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">domainName:</span><span class="hl-1"> </span><span class="hl-4">props</span><span class="hl-1">.</span><span class="hl-4">domainName</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">apiHostname:</span><span class="hl-1"> </span><span class="hl-2">'api'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">singleTableDatastore</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">cors:</span><span class="hl-1"> </span><span class="hl-5">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">additionalEnv:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">DOMAIN_NAME:</span><span class="hl-1"> </span><span class="hl-4">props</span><span class="hl-1">.</span><span class="hl-4">domainName</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
43
|
+
</code><button>Copy</button></pre>
|
|
44
|
+
<p>This will also create Lambda functions for all operations defined in your spec and wire them accordingly.</p>
|
|
36
45
|
<a id="md:contribute" class="tsd-anchor"></a><h2><a href="#md:contribute">Contribute</a></h2><a id="md:how-to-contribute-to-cdk-serverless" class="tsd-anchor"></a><h3><a href="#md:how-to-contribute-to-cdk-serverless">How to contribute to CDK Serverless</a></h3><a id="md:did-you-find-a-bug" class="tsd-anchor"></a><h4><a href="#md:did-you-find-a-bug"><strong>Did you find a bug?</strong></a></h4><ul>
|
|
37
46
|
<li><p><strong>Ensure the bug was not already reported</strong> by searching on GitHub under <a href="https://github.com/taimos/cdk-serverless/issues">Issues</a>.</p>
|
|
38
47
|
</li>
|
|
@@ -83,6 +92,10 @@
|
|
|
83
92
|
<ul>
|
|
84
93
|
<li><a href="#md:features"><span>Features</span></a></li>
|
|
85
94
|
<li><a href="#md:quick-start"><span>Quick <wbr/>Start</span></a></li>
|
|
95
|
+
<li>
|
|
96
|
+
<ul>
|
|
97
|
+
<li><a href="#md:adding-projen-constructs"><span>Adding projen constructs</span></a></li>
|
|
98
|
+
<li><a href="#md:using-the-cdk-serverless-l3-constructs"><span>Using the CDK serverless <wbr/>L3 constructs</span></a></li></ul></li>
|
|
86
99
|
<li><a href="#md:contribute"><span>Contribute</span></a></li>
|
|
87
100
|
<li>
|
|
88
101
|
<ul>
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="AssetCdnProps.html">AssetCdnProps</a></li></ul>
|
|
17
17
|
<h1>Interface AssetCdnProps</h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>Properties for AssetCdn L3 construct</p>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
18
22
|
<section class="tsd-panel tsd-hierarchy">
|
|
19
23
|
<h4>Hierarchy</h4>
|
|
20
24
|
<ul class="tsd-hierarchy">
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<div class="tsd-comment tsd-typography"><p>Hostname of the API if a domain name is specified</p>
|
|
62
62
|
</div>
|
|
63
63
|
<div class="tsd-comment tsd-typography">
|
|
64
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
64
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">api</span>
|
|
65
65
|
</code><button>Copy</button></pre>
|
|
66
66
|
</div></section>
|
|
67
67
|
<section class="tsd-panel tsd-member"><a id="apiName" class="tsd-anchor"></a>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<div class="tsd-comment tsd-typography"><p>Configure a content delivery network for static assets</p>
|
|
77
77
|
</div>
|
|
78
78
|
<div class="tsd-comment tsd-typography">
|
|
79
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
79
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">none</span>
|
|
80
80
|
</code><button>Copy</button></pre>
|
|
81
81
|
</div></section>
|
|
82
82
|
<section class="tsd-panel tsd-member"><a id="authentication" class="tsd-anchor"></a>
|
|
@@ -87,7 +87,7 @@ Alternatively supply a JWT issuer and audience
|
|
|
87
87
|
to use any other JWT-based authorization service.</p>
|
|
88
88
|
</div>
|
|
89
89
|
<div class="tsd-comment tsd-typography">
|
|
90
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
90
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">none</span>
|
|
91
91
|
</code><button>Copy</button></pre>
|
|
92
92
|
</div></section>
|
|
93
93
|
<section class="tsd-panel tsd-member"><a id="domainName" class="tsd-anchor"></a>
|
|
@@ -97,7 +97,7 @@ to use any other JWT-based authorization service.</p>
|
|
|
97
97
|
<p>only one of hostedZone and domainName can be specified</p>
|
|
98
98
|
</div>
|
|
99
99
|
<div class="tsd-comment tsd-typography">
|
|
100
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-
|
|
100
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-4">No</span><span class="hl-1"> </span><span class="hl-4">custom</span><span class="hl-1"> </span><span class="hl-4">domain</span><span class="hl-1"> </span><span class="hl-4">is</span><span class="hl-1"> </span><span class="hl-4">configured</span>
|
|
101
101
|
</code><button>Copy</button></pre>
|
|
102
102
|
</div></section>
|
|
103
103
|
<section class="tsd-panel tsd-member"><a id="hostedZone" class="tsd-anchor"></a>
|
|
@@ -107,7 +107,7 @@ to use any other JWT-based authorization service.</p>
|
|
|
107
107
|
<p>only one of hostedZone and domainName can be specified</p>
|
|
108
108
|
</div>
|
|
109
109
|
<div class="tsd-comment tsd-typography">
|
|
110
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-
|
|
110
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-4">No</span><span class="hl-1"> </span><span class="hl-4">custom</span><span class="hl-1"> </span><span class="hl-4">domain</span><span class="hl-1"> </span><span class="hl-4">is</span><span class="hl-1"> </span><span class="hl-4">configured</span>
|
|
111
111
|
</code><button>Copy</button></pre>
|
|
112
112
|
</div></section>
|
|
113
113
|
<section class="tsd-panel tsd-member"><a id="lambdaOptions" class="tsd-anchor"></a>
|
|
@@ -128,14 +128,14 @@ to use any other JWT-based authorization service.</p>
|
|
|
128
128
|
<div class="tsd-comment tsd-typography"><p>Configure CloudWatch Dashboard for the API and the Lambda functions</p>
|
|
129
129
|
</div>
|
|
130
130
|
<div class="tsd-comment tsd-typography">
|
|
131
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
131
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-5">true</span>
|
|
132
132
|
</code><button>Copy</button></pre>
|
|
133
133
|
</div></section>
|
|
134
134
|
<section class="tsd-panel tsd-member"><a id="singleTableDatastore" class="tsd-anchor"></a>
|
|
135
135
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>single<wbr/>Table<wbr/>Datastore</span><a href="#singleTableDatastore" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
136
136
|
<div class="tsd-signature"><span class="tsd-kind-property">single<wbr/>Table<wbr/>Datastore</span><span class="tsd-signature-symbol">?:</span> <a href="../classes/SingleTableDatastore.html" class="tsd-signature-type tsd-kind-class">SingleTableDatastore</a></div>
|
|
137
137
|
<div class="tsd-comment tsd-typography">
|
|
138
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
138
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">none</span>
|
|
139
139
|
</code><button>Copy</button></pre>
|
|
140
140
|
</div></section>
|
|
141
141
|
<section class="tsd-panel tsd-member"><a id="stageName" class="tsd-anchor"></a>
|
|
@@ -100,7 +100,7 @@ Value: group description</p>
|
|
|
100
100
|
<p>Code has to reside in './src/lambda/cognito.custom-message.ts' with a method 'handler'</p>
|
|
101
101
|
</div>
|
|
102
102
|
<div class="tsd-comment tsd-typography">
|
|
103
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
103
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-5">false</span>
|
|
104
104
|
</code><button>Copy</button></pre>
|
|
105
105
|
</div></li>
|
|
106
106
|
<li class="tsd-parameter">
|
|
@@ -109,7 +109,7 @@ Value: group description</p>
|
|
|
109
109
|
<p>Code has to reside in './src/lambda/cognito.pre-signup.ts' with a method 'handler'</p>
|
|
110
110
|
</div>
|
|
111
111
|
<div class="tsd-comment tsd-typography">
|
|
112
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
112
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-5">false</span>
|
|
113
113
|
</code><button>Copy</button></pre>
|
|
114
114
|
</div></li>
|
|
115
115
|
<li class="tsd-parameter">
|
|
@@ -118,7 +118,7 @@ Value: group description</p>
|
|
|
118
118
|
<p>Code has to reside in './src/lambda/cognito.pre-token-generation.ts' with a method 'handler'</p>
|
|
119
119
|
</div>
|
|
120
120
|
<div class="tsd-comment tsd-typography">
|
|
121
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
121
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-5">false</span>
|
|
122
122
|
</code><button>Copy</button></pre>
|
|
123
123
|
</div></li></ul></div>
|
|
124
124
|
<div class="tsd-comment tsd-typography"></div></section>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<div class="tsd-comment tsd-typography"><p>Hostname of the API if a domain name is specified</p>
|
|
63
63
|
</div>
|
|
64
64
|
<div class="tsd-comment tsd-typography">
|
|
65
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
65
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">api</span>
|
|
66
66
|
</code><button>Copy</button></pre>
|
|
67
67
|
</div><aside class="tsd-sources">
|
|
68
68
|
<p>Inherited from <a href="BaseApiProps.html">BaseApiProps</a>.<a href="BaseApiProps.html#apiHostname">apiHostname</a></p></aside></section>
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<div class="tsd-comment tsd-typography"><p>Configure a content delivery network for static assets</p>
|
|
80
80
|
</div>
|
|
81
81
|
<div class="tsd-comment tsd-typography">
|
|
82
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
82
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">none</span>
|
|
83
83
|
</code><button>Copy</button></pre>
|
|
84
84
|
</div><aside class="tsd-sources">
|
|
85
85
|
<p>Inherited from <a href="BaseApiProps.html">BaseApiProps</a>.<a href="BaseApiProps.html#assetCdn">assetCdn</a></p></aside></section>
|
|
@@ -91,7 +91,7 @@ Alternatively supply a JWT issuer and audience
|
|
|
91
91
|
to use any other JWT-based authorization service.</p>
|
|
92
92
|
</div>
|
|
93
93
|
<div class="tsd-comment tsd-typography">
|
|
94
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
94
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">none</span>
|
|
95
95
|
</code><button>Copy</button></pre>
|
|
96
96
|
</div><aside class="tsd-sources">
|
|
97
97
|
<p>Inherited from <a href="BaseApiProps.html">BaseApiProps</a>.<a href="BaseApiProps.html#authentication">authentication</a></p></aside></section>
|
|
@@ -105,7 +105,7 @@ to use any other JWT-based authorization service.</p>
|
|
|
105
105
|
<p>only one of hostedZone and domainName can be specified</p>
|
|
106
106
|
</div>
|
|
107
107
|
<div class="tsd-comment tsd-typography">
|
|
108
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-
|
|
108
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-4">No</span><span class="hl-1"> </span><span class="hl-4">custom</span><span class="hl-1"> </span><span class="hl-4">domain</span><span class="hl-1"> </span><span class="hl-4">is</span><span class="hl-1"> </span><span class="hl-4">configured</span>
|
|
109
109
|
</code><button>Copy</button></pre>
|
|
110
110
|
</div><aside class="tsd-sources">
|
|
111
111
|
<p>Inherited from <a href="BaseApiProps.html">BaseApiProps</a>.<a href="BaseApiProps.html#domainName">domainName</a></p></aside></section>
|
|
@@ -116,7 +116,7 @@ to use any other JWT-based authorization service.</p>
|
|
|
116
116
|
<p>only one of hostedZone and domainName can be specified</p>
|
|
117
117
|
</div>
|
|
118
118
|
<div class="tsd-comment tsd-typography">
|
|
119
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-
|
|
119
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-4">No</span><span class="hl-1"> </span><span class="hl-4">custom</span><span class="hl-1"> </span><span class="hl-4">domain</span><span class="hl-1"> </span><span class="hl-4">is</span><span class="hl-1"> </span><span class="hl-4">configured</span>
|
|
120
120
|
</code><button>Copy</button></pre>
|
|
121
121
|
</div><aside class="tsd-sources">
|
|
122
122
|
<p>Inherited from <a href="BaseApiProps.html">BaseApiProps</a>.<a href="BaseApiProps.html#hostedZone">hostedZone</a></p></aside></section>
|
|
@@ -140,7 +140,7 @@ to use any other JWT-based authorization service.</p>
|
|
|
140
140
|
<div class="tsd-comment tsd-typography"><p>Configure CloudWatch Dashboard for the API and the Lambda functions</p>
|
|
141
141
|
</div>
|
|
142
142
|
<div class="tsd-comment tsd-typography">
|
|
143
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
143
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-5">true</span>
|
|
144
144
|
</code><button>Copy</button></pre>
|
|
145
145
|
</div><aside class="tsd-sources">
|
|
146
146
|
<p>Inherited from <a href="BaseApiProps.html">BaseApiProps</a>.<a href="BaseApiProps.html#monitoring">monitoring</a></p></aside></section>
|
|
@@ -148,7 +148,7 @@ to use any other JWT-based authorization service.</p>
|
|
|
148
148
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>single<wbr/>Table<wbr/>Datastore</span><a href="#singleTableDatastore" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
149
149
|
<div class="tsd-signature"><span class="tsd-kind-property">single<wbr/>Table<wbr/>Datastore</span><span class="tsd-signature-symbol">?:</span> <a href="../classes/SingleTableDatastore.html" class="tsd-signature-type tsd-kind-class">SingleTableDatastore</a></div>
|
|
150
150
|
<div class="tsd-comment tsd-typography">
|
|
151
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
151
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">none</span>
|
|
152
152
|
</code><button>Copy</button></pre>
|
|
153
153
|
</div><aside class="tsd-sources">
|
|
154
154
|
<p>Inherited from <a href="BaseApiProps.html">BaseApiProps</a>.<a href="BaseApiProps.html#singleTableDatastore">singleTableDatastore</a></p></aside></section>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<div class="tsd-comment tsd-typography"><p>name of the pipeline steps to create</p>
|
|
38
38
|
</div>
|
|
39
39
|
<div class="tsd-comment tsd-typography">
|
|
40
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-
|
|
40
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-1">- </span><span class="hl-4">only</span><span class="hl-1"> </span><span class="hl-4">a</span><span class="hl-1"> </span><span class="hl-3">default</span><span class="hl-1"> </span><span class="hl-4">step</span><span class="hl-1"> </span><span class="hl-4">will</span><span class="hl-1"> </span><span class="hl-4">be</span><span class="hl-1"> </span><span class="hl-4">created</span>
|
|
41
41
|
</code><button>Copy</button></pre>
|
|
42
42
|
</div></section>
|
|
43
43
|
<section class="tsd-panel tsd-member"><a id="stashValues" class="tsd-anchor"></a>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<li class="tsd-parameter-index-signature">
|
|
52
52
|
<h5><span class="tsd-signature-symbol">[</span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">string</span></h5></li></ul></div>
|
|
53
53
|
<div class="tsd-comment tsd-typography">
|
|
54
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
54
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">none</span>
|
|
55
55
|
</code><button>Copy</button></pre>
|
|
56
56
|
</div></section></section></div>
|
|
57
57
|
<div class="col-sidebar">
|
|
@@ -86,7 +86,7 @@ It is available as process.env.ASSET_DOMAIN_NAME</p>
|
|
|
86
86
|
<div class="tsd-comment tsd-typography"><p>name of the exported handler function</p>
|
|
87
87
|
</div>
|
|
88
88
|
<div class="tsd-comment tsd-typography">
|
|
89
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
89
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">handler</span>
|
|
90
90
|
</code><button>Copy</button></pre>
|
|
91
91
|
</div></section>
|
|
92
92
|
<section class="tsd-panel tsd-member"><a id="includeSDK" class="tsd-anchor"></a>
|
|
@@ -95,7 +95,7 @@ It is available as process.env.ASSET_DOMAIN_NAME</p>
|
|
|
95
95
|
<div class="tsd-comment tsd-typography"><p>Should the AWS-SDK be packaged with the Lambda code or excluded</p>
|
|
96
96
|
</div>
|
|
97
97
|
<div class="tsd-comment tsd-typography">
|
|
98
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
98
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-5">false</span><span class="hl-1"> (</span><span class="hl-4">exclude</span><span class="hl-1"> </span><span class="hl-7">SDK</span><span class="hl-1"> </span><span class="hl-4">and</span><span class="hl-1"> </span><span class="hl-4">use</span><span class="hl-1"> </span><span class="hl-4">runtime</span><span class="hl-1"> </span><span class="hl-4">provided</span><span class="hl-1"> </span><span class="hl-4">one</span><span class="hl-1">)</span>
|
|
99
99
|
</code><button>Copy</button></pre>
|
|
100
100
|
</div></section>
|
|
101
101
|
<section class="tsd-panel tsd-member"><a id="jwt" class="tsd-anchor"></a>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<div class="tsd-comment tsd-typography"><p>Activate tracing with X-Ray</p>
|
|
37
37
|
</div>
|
|
38
38
|
<div class="tsd-comment tsd-typography">
|
|
39
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
39
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">lambda</span><span class="hl-1">.</span><span class="hl-4">Tracing</span><span class="hl-1">.</span><span class="hl-7">DISABLED</span>
|
|
40
40
|
</code><button>Copy</button></pre>
|
|
41
41
|
</div></section></section></div>
|
|
42
42
|
<div class="col-sidebar">
|