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
package/README.md
CHANGED
|
@@ -30,6 +30,45 @@ Adding CDK Serverless is a two step process:
|
|
|
30
30
|
1. Add 'cdk-serverless' as a dependency to your project
|
|
31
31
|
2. Run `npx projen` to install it
|
|
32
32
|
|
|
33
|
+
Now you can use the project type `ServerlessProject` for your repo.
|
|
34
|
+
|
|
35
|
+
### Adding projen constructs
|
|
36
|
+
|
|
37
|
+
First you need to add the desired construct to your projen configuration: (e.g. RestApi)
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { RestApi } from 'cdk-serverless/projen';
|
|
41
|
+
|
|
42
|
+
new RestApi(project, {
|
|
43
|
+
apiName: 'TestApi', // logical name of your API
|
|
44
|
+
definitionFile: 'testapi.yaml', // path to your OpenAPI spec
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then run projen to generate construct files and models for the API.
|
|
49
|
+
|
|
50
|
+
### Using the CDK serverless L3 constructs
|
|
51
|
+
|
|
52
|
+
In your stack you can then reference the generated L3s to create the API:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { TestApiRestApi } from './generated/rest.testapi-api.generated';
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
const api = new TestApiRestApi(this, 'Api', {
|
|
59
|
+
stageName: props.stageName,
|
|
60
|
+
domainName: props.domainName,
|
|
61
|
+
apiHostname: 'api',
|
|
62
|
+
singleTableDatastore,
|
|
63
|
+
cors: true,
|
|
64
|
+
additionalEnv: {
|
|
65
|
+
DOMAIN_NAME: props.domainName,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This will also create Lambda functions for all operations defined in your spec and wire them accordingly.
|
|
71
|
+
|
|
33
72
|
## Contribute
|
|
34
73
|
|
|
35
74
|
### How to contribute to CDK Serverless
|
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
--dark-hl-1: #D4D4D4;
|
|
6
6
|
--light-hl-2: #A31515;
|
|
7
7
|
--dark-hl-2: #CE9178;
|
|
8
|
-
--light-hl-3: #
|
|
9
|
-
--dark-hl-3: #
|
|
10
|
-
--light-hl-4: #
|
|
11
|
-
--dark-hl-4: #
|
|
12
|
-
--light-hl-5: #
|
|
13
|
-
--dark-hl-5: #
|
|
14
|
-
--light-hl-6: #
|
|
15
|
-
--dark-hl-6: #
|
|
16
|
-
--light-hl-7: #
|
|
17
|
-
--dark-hl-7: #
|
|
8
|
+
--light-hl-3: #AF00DB;
|
|
9
|
+
--dark-hl-3: #C586C0;
|
|
10
|
+
--light-hl-4: #001080;
|
|
11
|
+
--dark-hl-4: #9CDCFE;
|
|
12
|
+
--light-hl-5: #0000FF;
|
|
13
|
+
--dark-hl-5: #569CD6;
|
|
14
|
+
--light-hl-6: #008000;
|
|
15
|
+
--dark-hl-6: #6A9955;
|
|
16
|
+
--light-hl-7: #0070C1;
|
|
17
|
+
--dark-hl-7: #4FC1FF;
|
|
18
18
|
--light-hl-8: #098658;
|
|
19
19
|
--dark-hl-8: #B5CEA8;
|
|
20
|
-
--light-hl-9: #
|
|
21
|
-
--dark-hl-9: #
|
|
20
|
+
--light-hl-9: #267F99;
|
|
21
|
+
--dark-hl-9: #4EC9B0;
|
|
22
22
|
--light-code-background: #FFFFFF;
|
|
23
23
|
--dark-code-background: #1E1E1E;
|
|
24
24
|
}
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="AssetCdn.html">AssetCdn</a></li></ul>
|
|
17
17
|
<h1>Class AssetCdn</h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>The AssetCdn construct is responsible for setting up an S3 bucket for asset storage
|
|
20
|
+
and a CloudFront distribution to serve the assets securely with HTTPS. It also
|
|
21
|
+
configures a Route 53 DNS record to point to the CloudFront distribution.</p>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
18
24
|
<section class="tsd-panel tsd-hierarchy">
|
|
19
25
|
<h4>Hierarchy</h4>
|
|
20
26
|
<ul class="tsd-hierarchy">
|
|
@@ -49,25 +55,40 @@
|
|
|
49
55
|
<ul class="tsd-signatures">
|
|
50
56
|
<li class="tsd-signature tsd-anchor-link" id="constructor.new_AssetCdn"><span class="tsd-kind-constructor-signature">new <wbr/>Asset<wbr/>Cdn</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="AssetCdn.html" class="tsd-signature-type tsd-kind-class">AssetCdn</a><a href="#constructor.new_AssetCdn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
51
57
|
<li class="tsd-description">
|
|
58
|
+
<div class="tsd-comment tsd-typography"><p>Creates an instance of AssetCdn.</p>
|
|
59
|
+
</div>
|
|
52
60
|
<div class="tsd-parameters">
|
|
53
61
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
54
62
|
<ul class="tsd-parameter-list">
|
|
55
63
|
<li>
|
|
56
|
-
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5
|
|
64
|
+
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5>
|
|
65
|
+
<div class="tsd-comment tsd-typography"><p>The scope in which this construct is defined.</p>
|
|
66
|
+
</div></li>
|
|
57
67
|
<li>
|
|
58
|
-
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5
|
|
68
|
+
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5>
|
|
69
|
+
<div class="tsd-comment tsd-typography"><p>The scoped construct ID.</p>
|
|
70
|
+
</div></li>
|
|
59
71
|
<li>
|
|
60
|
-
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/AssetCdnProps.html" class="tsd-signature-type tsd-kind-interface">AssetCdnProps</a></h5
|
|
61
|
-
<
|
|
72
|
+
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/AssetCdnProps.html" class="tsd-signature-type tsd-kind-interface">AssetCdnProps</a></h5>
|
|
73
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the AssetCdn construct.</p>
|
|
74
|
+
</div></li></ul></div>
|
|
75
|
+
<h4 class="tsd-returns-title">Returns <a href="AssetCdn.html" class="tsd-signature-type tsd-kind-class">AssetCdn</a></h4>
|
|
76
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
62
77
|
<p>Overrides Construct.constructor</p></aside></li></ul></section></section>
|
|
63
78
|
<section class="tsd-panel-group tsd-member-group">
|
|
64
79
|
<h2>Properties</h2>
|
|
65
80
|
<section class="tsd-panel tsd-member"><a id="assetBucket" class="tsd-anchor"></a>
|
|
66
81
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>asset<wbr/>Bucket</span><a href="#assetBucket" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
67
|
-
<div class="tsd-signature"><span class="tsd-kind-property">asset<wbr/>Bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Bucket</span></div
|
|
82
|
+
<div class="tsd-signature"><span class="tsd-kind-property">asset<wbr/>Bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Bucket</span></div>
|
|
83
|
+
<div class="tsd-comment tsd-typography"><p>The S3 bucket used to store the assets.</p>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
68
86
|
<section class="tsd-panel tsd-member"><a id="assetDomainName" class="tsd-anchor"></a>
|
|
69
87
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>asset<wbr/>Domain<wbr/>Name</span><a href="#assetDomainName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
70
|
-
<div class="tsd-signature"><span class="tsd-kind-property">asset<wbr/>Domain<wbr/>Name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div
|
|
88
|
+
<div class="tsd-signature"><span class="tsd-kind-property">asset<wbr/>Domain<wbr/>Name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
89
|
+
<div class="tsd-comment tsd-typography"><p>The domain name used for accessing the assets.</p>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
71
92
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="node" class="tsd-anchor"></a>
|
|
72
93
|
<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>
|
|
73
94
|
<div class="tsd-signature"><span class="tsd-kind-property">node</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Node</span></div>
|
|
@@ -77,7 +98,10 @@
|
|
|
77
98
|
<p>Inherited from Construct.node</p></aside></section>
|
|
78
99
|
<section class="tsd-panel tsd-member"><a id="zone" class="tsd-anchor"></a>
|
|
79
100
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>zone</span><a href="#zone" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
80
|
-
<div class="tsd-signature"><span class="tsd-kind-property">zone</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">IHostedZone</span></div
|
|
101
|
+
<div class="tsd-signature"><span class="tsd-kind-property">zone</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">IHostedZone</span></div>
|
|
102
|
+
<div class="tsd-comment tsd-typography"><p>The Route 53 hosted zone for the asset domain.</p>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="tsd-comment tsd-typography"></div></section></section>
|
|
81
105
|
<section class="tsd-panel-group tsd-member-group">
|
|
82
106
|
<h2>Methods</h2>
|
|
83
107
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="toString" class="tsd-anchor"></a>
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="BaseApi.html">BaseApi</a></li></ul>
|
|
17
17
|
<h1>Class BaseApi<code class="tsd-tag ts-flagAbstract">Abstract</code> </h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>Base class for different types of APIs</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">
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="CognitoAuthentication.html">CognitoAuthentication</a></li></ul>
|
|
17
17
|
<h1>Class CognitoAuthentication</h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>The CognitoAuthentication construct sets up a Cognito User Pool with optional triggers and an optional Cognito Identity Pool.
|
|
20
|
+
It also configures various Lambda triggers for custom message, pre-sign up, and pre-token generation events.</p>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
18
23
|
<section class="tsd-panel tsd-hierarchy">
|
|
19
24
|
<h4>Hierarchy</h4>
|
|
20
25
|
<ul class="tsd-hierarchy">
|
|
@@ -55,25 +60,40 @@
|
|
|
55
60
|
<ul class="tsd-signatures">
|
|
56
61
|
<li class="tsd-signature tsd-anchor-link" id="constructor.new_CognitoAuthentication"><span class="tsd-kind-constructor-signature">new <wbr/>Cognito<wbr/>Authentication</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="CognitoAuthentication.html" class="tsd-signature-type tsd-kind-class">CognitoAuthentication</a><a href="#constructor.new_CognitoAuthentication" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
57
62
|
<li class="tsd-description">
|
|
63
|
+
<div class="tsd-comment tsd-typography"><p>Creates an instance of CognitoAuthentication.</p>
|
|
64
|
+
</div>
|
|
58
65
|
<div class="tsd-parameters">
|
|
59
66
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
60
67
|
<ul class="tsd-parameter-list">
|
|
61
68
|
<li>
|
|
62
|
-
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5
|
|
69
|
+
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5>
|
|
70
|
+
<div class="tsd-comment tsd-typography"><p>The scope in which this construct is defined.</p>
|
|
71
|
+
</div></li>
|
|
63
72
|
<li>
|
|
64
|
-
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5
|
|
73
|
+
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5>
|
|
74
|
+
<div class="tsd-comment tsd-typography"><p>The scoped construct ID.</p>
|
|
75
|
+
</div></li>
|
|
65
76
|
<li>
|
|
66
|
-
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/CognitoAuthenticationProps.html" class="tsd-signature-type tsd-kind-interface">CognitoAuthenticationProps</a></h5
|
|
67
|
-
<
|
|
77
|
+
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/CognitoAuthenticationProps.html" class="tsd-signature-type tsd-kind-interface">CognitoAuthenticationProps</a></h5>
|
|
78
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the CognitoAuthentication construct.</p>
|
|
79
|
+
</div></li></ul></div>
|
|
80
|
+
<h4 class="tsd-returns-title">Returns <a href="CognitoAuthentication.html" class="tsd-signature-type tsd-kind-class">CognitoAuthentication</a></h4>
|
|
81
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
68
82
|
<p>Overrides Construct.constructor</p></aside></li></ul></section></section>
|
|
69
83
|
<section class="tsd-panel-group tsd-member-group">
|
|
70
84
|
<h2>Properties</h2>
|
|
71
85
|
<section class="tsd-panel tsd-member"><a id="customMessageFunction" class="tsd-anchor"></a>
|
|
72
86
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>custom<wbr/>Message<wbr/>Function</span><a href="#customMessageFunction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
73
|
-
<div class="tsd-signature"><span class="tsd-kind-property">custom<wbr/>Message<wbr/>Function</span><span class="tsd-signature-symbol">?:</span> <a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></div
|
|
87
|
+
<div class="tsd-signature"><span class="tsd-kind-property">custom<wbr/>Message<wbr/>Function</span><span class="tsd-signature-symbol">?:</span> <a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></div>
|
|
88
|
+
<div class="tsd-comment tsd-typography"><p>The optional Lambda function for custom message trigger.</p>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
74
91
|
<section class="tsd-panel tsd-member"><a id="identityPool" class="tsd-anchor"></a>
|
|
75
92
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>identity<wbr/>Pool</span><a href="#identityPool" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
76
|
-
<div class="tsd-signature"><span class="tsd-kind-property">identity<wbr/>Pool</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type ">IdentityPool</span></div
|
|
93
|
+
<div class="tsd-signature"><span class="tsd-kind-property">identity<wbr/>Pool</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type ">IdentityPool</span></div>
|
|
94
|
+
<div class="tsd-comment tsd-typography"><p>The optional Cognito Identity Pool for federated identities.</p>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
77
97
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="node" class="tsd-anchor"></a>
|
|
78
98
|
<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
99
|
<div class="tsd-signature"><span class="tsd-kind-property">node</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Node</span></div>
|
|
@@ -83,14 +103,20 @@
|
|
|
83
103
|
<p>Inherited from Construct.node</p></aside></section>
|
|
84
104
|
<section class="tsd-panel tsd-member"><a id="preSignUpFunction" class="tsd-anchor"></a>
|
|
85
105
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>pre<wbr/>Sign<wbr/>Up<wbr/>Function</span><a href="#preSignUpFunction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
86
|
-
<div class="tsd-signature"><span class="tsd-kind-property">pre<wbr/>Sign<wbr/>Up<wbr/>Function</span><span class="tsd-signature-symbol">?:</span> <a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></div
|
|
106
|
+
<div class="tsd-signature"><span class="tsd-kind-property">pre<wbr/>Sign<wbr/>Up<wbr/>Function</span><span class="tsd-signature-symbol">?:</span> <a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></div>
|
|
107
|
+
<div class="tsd-comment tsd-typography"><p>The optional Lambda function for pre-sign up trigger.</p>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
87
110
|
<section class="tsd-panel tsd-member"><a id="preTokenGenerationFunction" class="tsd-anchor"></a>
|
|
88
111
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>pre<wbr/>Token<wbr/>Generation<wbr/>Function</span><a href="#preTokenGenerationFunction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
89
|
-
<div class="tsd-signature"><span class="tsd-kind-property">pre<wbr/>Token<wbr/>Generation<wbr/>Function</span><span class="tsd-signature-symbol">?:</span> <a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></div
|
|
112
|
+
<div class="tsd-signature"><span class="tsd-kind-property">pre<wbr/>Token<wbr/>Generation<wbr/>Function</span><span class="tsd-signature-symbol">?:</span> <a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></div>
|
|
113
|
+
<div class="tsd-comment tsd-typography"><p>The optional Lambda function for pre-token generation trigger.</p>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
90
116
|
<section class="tsd-panel tsd-member"><a id="userpool" class="tsd-anchor"></a>
|
|
91
117
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>userpool</span><a href="#userpool" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
92
118
|
<div class="tsd-signature"><span class="tsd-kind-property">userpool</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">UserPool</span></div>
|
|
93
|
-
<div class="tsd-comment tsd-typography"><p>The Cognito
|
|
119
|
+
<div class="tsd-comment tsd-typography"><p>The Cognito User Pool for user authentication.</p>
|
|
94
120
|
</div>
|
|
95
121
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
96
122
|
<p>Implementation of <a href="../interfaces/ICognitoAuthentication.html">ICognitoAuthentication</a>.<a href="../interfaces/ICognitoAuthentication.html#userpool">userpool</a></p></aside></section></section>
|
|
@@ -14,12 +14,24 @@
|
|
|
14
14
|
<ul class="tsd-breadcrumb">
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="GraphQlApi.html">GraphQlApi</a></li></ul>
|
|
17
|
-
<h1>Class GraphQlApi<RESOLVERS></h1></div>
|
|
17
|
+
<h1>Class GraphQlApi<RESOLVERS></h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>The GraphQlApi construct sets up an AWS AppSync GraphQL API integrated with Cognito for authentication and DynamoDB for data storage.
|
|
20
|
+
This construct facilitates the creation of a GraphQL API with various configurations, including custom domain, logging, schema definition,
|
|
21
|
+
and authorization using Cognito User Pool and Identity Pool. It also provides methods to dynamically add resolvers and grant access to specific fields.</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">GraphQlApi</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'MyGraphQlApi'</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">'schema.graphql'</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><br/><br/><span class="hl-6">// Add a Lambda resolver</span><br/><span class="hl-4">api</span><span class="hl-1">.</span><span class="hl-0">addLambdaResolver</span><span class="hl-1">(</span><span class="hl-2">'Query'</span><span class="hl-1">, </span><span class="hl-2">'getItem'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Grant access to unauthenticated users for a specific query</span><br/><span class="hl-4">api</span><span class="hl-1">.</span><span class="hl-0">grantAccessUnAuth</span><span class="hl-1">(</span><span class="hl-2">'Query'</span><span class="hl-1">, </span><span class="hl-2">'getItem'</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">RESOLVERS</span></h4
|
|
31
|
+
<h4><span class="tsd-kind-type-parameter">RESOLVERS</span></h4>
|
|
32
|
+
<div class="tsd-comment tsd-typography"><p>The type definition for the GraphQL resolvers.</p>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></section>
|
|
23
35
|
<section class="tsd-panel tsd-hierarchy">
|
|
24
36
|
<h4>Hierarchy</h4>
|
|
25
37
|
<ul class="tsd-hierarchy">
|
|
@@ -72,6 +84,8 @@
|
|
|
72
84
|
<ul class="tsd-signatures">
|
|
73
85
|
<li class="tsd-signature tsd-anchor-link" id="constructor.new_GraphQlApi"><span class="tsd-kind-constructor-signature">new <wbr/>Graph<wbr/>Ql<wbr/>Api</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">RESOLVERS</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="GraphQlApi.html" class="tsd-signature-type tsd-kind-class">GraphQlApi</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">RESOLVERS</span><span class="tsd-signature-symbol">></span><a href="#constructor.new_GraphQlApi" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
74
86
|
<li class="tsd-description">
|
|
87
|
+
<div class="tsd-comment tsd-typography"><p>Creates an instance of GraphQlApi.</p>
|
|
88
|
+
</div>
|
|
75
89
|
<section class="tsd-panel">
|
|
76
90
|
<h4>Type Parameters</h4>
|
|
77
91
|
<ul class="tsd-type-parameter-list">
|
|
@@ -81,26 +95,39 @@
|
|
|
81
95
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
82
96
|
<ul class="tsd-parameter-list">
|
|
83
97
|
<li>
|
|
84
|
-
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5
|
|
98
|
+
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5>
|
|
99
|
+
<div class="tsd-comment tsd-typography"><p>The scope in which this construct is defined.</p>
|
|
100
|
+
</div></li>
|
|
85
101
|
<li>
|
|
86
|
-
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5
|
|
102
|
+
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5>
|
|
103
|
+
<div class="tsd-comment tsd-typography"><p>The scoped construct ID.</p>
|
|
104
|
+
</div></li>
|
|
87
105
|
<li>
|
|
88
|
-
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/GraphQlApiProps.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiProps</a></h5
|
|
89
|
-
<
|
|
106
|
+
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/GraphQlApiProps.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiProps</a></h5>
|
|
107
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the GraphQlApi construct.</p>
|
|
108
|
+
</div></li></ul></div>
|
|
109
|
+
<h4 class="tsd-returns-title">Returns <a href="GraphQlApi.html" class="tsd-signature-type tsd-kind-class">GraphQlApi</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">RESOLVERS</span><span class="tsd-signature-symbol">></span></h4>
|
|
110
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
90
111
|
<p>Overrides <a href="BaseApi.html">BaseApi</a>.<a href="BaseApi.html#constructor">constructor</a></p></aside></li></ul></section></section>
|
|
91
112
|
<section class="tsd-panel-group tsd-member-group">
|
|
92
113
|
<h2>Properties</h2>
|
|
93
114
|
<section class="tsd-panel tsd-member tsd-is-private"><a id="_functions" class="tsd-anchor"></a>
|
|
94
115
|
<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>
|
|
95
116
|
<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>
|
|
117
|
+
<div class="tsd-comment tsd-typography"><p>A collection of Lambda functions used as resolvers for the GraphQL API.</p>
|
|
118
|
+
</div>
|
|
96
119
|
<div class="tsd-type-declaration">
|
|
97
120
|
<h4>Type declaration</h4>
|
|
98
121
|
<ul class="tsd-parameters">
|
|
99
122
|
<li class="tsd-parameter-index-signature">
|
|
100
|
-
<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
|
|
123
|
+
<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>
|
|
124
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
101
125
|
<section class="tsd-panel tsd-member"><a id="api" class="tsd-anchor"></a>
|
|
102
126
|
<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>
|
|
103
|
-
<div class="tsd-signature"><span class="tsd-kind-property">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">GraphqlApi</span></div
|
|
127
|
+
<div class="tsd-signature"><span class="tsd-kind-property">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">GraphqlApi</span></div>
|
|
128
|
+
<div class="tsd-comment tsd-typography"><p>The AWS AppSync GraphQL API instance.</p>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
104
131
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="apiDomainName" class="tsd-anchor"></a>
|
|
105
132
|
<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>
|
|
106
133
|
<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">
|
|
@@ -115,7 +142,10 @@
|
|
|
115
142
|
<p>Inherited from <a href="BaseApi.html">BaseApi</a>.<a href="BaseApi.html#apiHostName">apiHostName</a></p></aside></section>
|
|
116
143
|
<section class="tsd-panel tsd-member tsd-is-private"><a id="cognitoAuth" class="tsd-anchor"></a>
|
|
117
144
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>cognito<wbr/>Auth</span><a href="#cognitoAuth" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
118
|
-
<div class="tsd-signature"><span class="tsd-kind-property">cognito<wbr/>Auth</span><span class="tsd-signature-symbol">:</span> <a href="CognitoAuthentication.html" class="tsd-signature-type tsd-kind-class">CognitoAuthentication</a></div
|
|
145
|
+
<div class="tsd-signature"><span class="tsd-kind-property">cognito<wbr/>Auth</span><span class="tsd-signature-symbol">:</span> <a href="CognitoAuthentication.html" class="tsd-signature-type tsd-kind-class">CognitoAuthentication</a></div>
|
|
146
|
+
<div class="tsd-comment tsd-typography"><p>The Cognito authentication configuration.</p>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
119
149
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="hostedZone" class="tsd-anchor"></a>
|
|
120
150
|
<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>
|
|
121
151
|
<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">
|
|
@@ -129,10 +159,16 @@
|
|
|
129
159
|
<p>Inherited from <a href="BaseApi.html">BaseApi</a>.<a href="BaseApi.html#node">node</a></p></aside></section>
|
|
130
160
|
<section class="tsd-panel tsd-member tsd-is-private"><a id="props" class="tsd-anchor"></a>
|
|
131
161
|
<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>
|
|
132
|
-
<div class="tsd-signature"><span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/GraphQlApiProps.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiProps</a></div
|
|
162
|
+
<div class="tsd-signature"><span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/GraphQlApiProps.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiProps</a></div>
|
|
163
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the GraphQlApi construct.</p>
|
|
164
|
+
</div>
|
|
165
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
133
166
|
<section class="tsd-panel tsd-member"><a id="tableDataSource" class="tsd-anchor"></a>
|
|
134
167
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>table<wbr/>Data<wbr/>Source</span><a href="#tableDataSource" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
135
|
-
<div class="tsd-signature"><span class="tsd-kind-property">table<wbr/>Data<wbr/>Source</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type ">DynamoDbDataSource</span></div
|
|
168
|
+
<div class="tsd-signature"><span class="tsd-kind-property">table<wbr/>Data<wbr/>Source</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type ">DynamoDbDataSource</span></div>
|
|
169
|
+
<div class="tsd-comment tsd-typography"><p>The optional DynamoDB data source for the GraphQL API.</p>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="tsd-comment tsd-typography"></div></section></section>
|
|
136
172
|
<section class="tsd-panel-group tsd-member-group">
|
|
137
173
|
<h2>Methods</h2>
|
|
138
174
|
<section class="tsd-panel tsd-member"><a id="addDynamoDbJSResolver" class="tsd-anchor"></a>
|
|
@@ -15,6 +15,16 @@
|
|
|
15
15
|
<li><a href="../modules.html">cdk-serverless</a></li>
|
|
16
16
|
<li><a href="LambdaFunction.html">LambdaFunction</a></li></ul>
|
|
17
17
|
<h1>Class LambdaFunction</h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>The LambdaFunction construct extends the AWS CDK NodejsFunction to provide additional configurations and environment settings for AWS Lambda functions.
|
|
20
|
+
This construct facilitates setting up a Lambda function with various custom options, environment variables, and permissions required to interact with AWS services
|
|
21
|
+
such as DynamoDB, Cognito, and S3. It supports setting up Lambda functions with pre-defined bundles, custom handlers, and integrations with AWS services.
|
|
22
|
+
The construct also provides methods to dynamically update the configuration and permissions of the Lambda function after it has been created.</p>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="tsd-comment tsd-typography">
|
|
25
|
+
<h4>Example</h4><pre><code class="language-ts"><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-0">LambdaFunction</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'MyLambdaFunction'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">entry:</span><span class="hl-1"> </span><span class="hl-2">'path/to/lambda/handler.ts'</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">'main'</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">table:</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">userPool:</span><span class="hl-1"> </span><span class="hl-4">myCognitoUserPool</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">assetBucket:</span><span class="hl-1"> </span><span class="hl-4">myS3Bucket</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">lambdaOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">timeout:</span><span class="hl-1"> </span><span class="hl-4">Duration</span><span class="hl-1">.</span><span class="hl-0">seconds</span><span class="hl-1">(</span><span class="hl-8">30</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-4">memorySize:</span><span class="hl-1"> </span><span class="hl-8">512</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Add additional permissions</span><br/><span class="hl-4">lambdaFunction</span><span class="hl-1">.</span><span class="hl-0">grantSendEmails</span><span class="hl-1">();</span><br/><span class="hl-4">lambdaFunction</span><span class="hl-1">.</span><span class="hl-0">grantTableWrite</span><span class="hl-1">();</span>
|
|
26
|
+
</code><button>Copy</button></pre>
|
|
27
|
+
</div></section>
|
|
18
28
|
<section class="tsd-panel tsd-hierarchy">
|
|
19
29
|
<h4>Hierarchy</h4>
|
|
20
30
|
<ul class="tsd-hierarchy">
|
|
@@ -117,16 +127,25 @@
|
|
|
117
127
|
<ul class="tsd-signatures">
|
|
118
128
|
<li class="tsd-signature tsd-anchor-link" id="constructor.new_LambdaFunction"><span class="tsd-kind-constructor-signature">new <wbr/>Lambda<wbr/>Function</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="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a><a href="#constructor.new_LambdaFunction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
119
129
|
<li class="tsd-description">
|
|
130
|
+
<div class="tsd-comment tsd-typography"><p>Creates an instance of LambdaFunction.</p>
|
|
131
|
+
</div>
|
|
120
132
|
<div class="tsd-parameters">
|
|
121
133
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
122
134
|
<ul class="tsd-parameter-list">
|
|
123
135
|
<li>
|
|
124
|
-
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5
|
|
136
|
+
<h5><span class="tsd-kind-parameter">scope</span>: <span class="tsd-signature-type ">Construct</span></h5>
|
|
137
|
+
<div class="tsd-comment tsd-typography"><p>The scope in which this construct is defined.</p>
|
|
138
|
+
</div></li>
|
|
125
139
|
<li>
|
|
126
|
-
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5
|
|
140
|
+
<h5><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></h5>
|
|
141
|
+
<div class="tsd-comment tsd-typography"><p>The scoped construct ID.</p>
|
|
142
|
+
</div></li>
|
|
127
143
|
<li>
|
|
128
|
-
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/LambdaFunctionProps.html" class="tsd-signature-type tsd-kind-interface">LambdaFunctionProps</a></h5
|
|
129
|
-
<
|
|
144
|
+
<h5><span class="tsd-kind-parameter">props</span>: <a href="../interfaces/LambdaFunctionProps.html" class="tsd-signature-type tsd-kind-interface">LambdaFunctionProps</a></h5>
|
|
145
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the LambdaFunction construct.</p>
|
|
146
|
+
</div></li></ul></div>
|
|
147
|
+
<h4 class="tsd-returns-title">Returns <a href="LambdaFunction.html" class="tsd-signature-type tsd-kind-class">LambdaFunction</a></h4>
|
|
148
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
130
149
|
<p>Overrides lambdaNodejs.NodejsFunction.constructor</p></aside></li></ul></section></section>
|
|
131
150
|
<section class="tsd-panel-group tsd-member-group">
|
|
132
151
|
<h2>Properties</h2>
|
|
@@ -208,7 +227,10 @@ cross-environment scenarios.</li>
|
|
|
208
227
|
<p>Inherited from lambdaNodejs.NodejsFunction.physicalName</p></aside></section>
|
|
209
228
|
<section class="tsd-panel tsd-member tsd-is-private"><a id="props" class="tsd-anchor"></a>
|
|
210
229
|
<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>
|
|
211
|
-
<div class="tsd-signature"><span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/LambdaFunctionProps.html" class="tsd-signature-type tsd-kind-interface">LambdaFunctionProps</a></div
|
|
230
|
+
<div class="tsd-signature"><span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/LambdaFunctionProps.html" class="tsd-signature-type tsd-kind-interface">LambdaFunctionProps</a></div>
|
|
231
|
+
<div class="tsd-comment tsd-typography"><p>The properties of the LambdaFunction construct.</p>
|
|
232
|
+
</div>
|
|
233
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
212
234
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="role" class="tsd-anchor"></a>
|
|
213
235
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <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>
|
|
214
236
|
<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>
|
|
@@ -311,7 +333,7 @@ to never expire even if it was configured with a different value.</p>
|
|
|
311
333
|
<div class="tsd-comment tsd-typography"><p>Defines an alias for this function.</p>
|
|
312
334
|
<p>The alias will automatically be updated to point to the latest version of
|
|
313
335
|
the function as it is being updated during a deployment.</p>
|
|
314
|
-
<pre><code class="language-ts"><span class="hl-
|
|
336
|
+
<pre><code class="language-ts"><span class="hl-5">declare</span><span class="hl-1"> </span><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">fn</span><span class="hl-1">: </span><span class="hl-9">lambda</span><span class="hl-1">.</span><span class="hl-9">Function</span><span class="hl-1">;</span><br/><br/><span class="hl-4">fn</span><span class="hl-1">.</span><span class="hl-0">addAlias</span><span class="hl-1">(</span><span class="hl-2">'Live'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Is equivalent to</span><br/><br/><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">Alias</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">, </span><span class="hl-2">'AliasLive'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">aliasName:</span><span class="hl-1"> </span><span class="hl-2">'Live'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">version:</span><span class="hl-1"> </span><span class="hl-4">fn</span><span class="hl-1">.</span><span class="hl-4">currentVersion</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
|
|
315
337
|
</code><button>Copy</button></pre>
|
|
316
338
|
</div>
|
|
317
339
|
<div class="tsd-parameters">
|
|
@@ -997,7 +1019,7 @@ this type-testing method instead.</p>
|
|
|
997
1019
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">props</span>: <span class="tsd-signature-type ">MetricOptions</span></h5><code class="tsd-tag ts-flagOptional">Optional</code> </li></ul></div>
|
|
998
1020
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Metric</span></h4>
|
|
999
1021
|
<div class="tsd-comment tsd-typography">
|
|
1000
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
1022
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">max</span><span class="hl-1"> </span><span class="hl-4">over</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1"> </span><span class="hl-4">minutes</span>
|
|
1001
1023
|
</code><button>Copy</button></pre>
|
|
1002
1024
|
</div><aside class="tsd-sources">
|
|
1003
1025
|
<p>Inherited from lambdaNodejs.NodejsFunction.metricAllConcurrentExecutions</p></aside></li></ul></section>
|
|
@@ -1015,7 +1037,7 @@ this type-testing method instead.</p>
|
|
|
1015
1037
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">props</span>: <span class="tsd-signature-type ">MetricOptions</span></h5><code class="tsd-tag ts-flagOptional">Optional</code> </li></ul></div>
|
|
1016
1038
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Metric</span></h4>
|
|
1017
1039
|
<div class="tsd-comment tsd-typography">
|
|
1018
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
1040
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">average</span><span class="hl-1"> </span><span class="hl-4">over</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1"> </span><span class="hl-4">minutes</span>
|
|
1019
1041
|
</code><button>Copy</button></pre>
|
|
1020
1042
|
</div><aside class="tsd-sources">
|
|
1021
1043
|
<p>Inherited from lambdaNodejs.NodejsFunction.metricAllDuration</p></aside></li></ul></section>
|
|
@@ -1033,7 +1055,7 @@ this type-testing method instead.</p>
|
|
|
1033
1055
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">props</span>: <span class="tsd-signature-type ">MetricOptions</span></h5><code class="tsd-tag ts-flagOptional">Optional</code> </li></ul></div>
|
|
1034
1056
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Metric</span></h4>
|
|
1035
1057
|
<div class="tsd-comment tsd-typography">
|
|
1036
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
1058
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">sum</span><span class="hl-1"> </span><span class="hl-4">over</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1"> </span><span class="hl-4">minutes</span>
|
|
1037
1059
|
</code><button>Copy</button></pre>
|
|
1038
1060
|
</div><aside class="tsd-sources">
|
|
1039
1061
|
<p>Inherited from lambdaNodejs.NodejsFunction.metricAllErrors</p></aside></li></ul></section>
|
|
@@ -1051,7 +1073,7 @@ this type-testing method instead.</p>
|
|
|
1051
1073
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">props</span>: <span class="tsd-signature-type ">MetricOptions</span></h5><code class="tsd-tag ts-flagOptional">Optional</code> </li></ul></div>
|
|
1052
1074
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Metric</span></h4>
|
|
1053
1075
|
<div class="tsd-comment tsd-typography">
|
|
1054
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
1076
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">sum</span><span class="hl-1"> </span><span class="hl-4">over</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1"> </span><span class="hl-4">minutes</span>
|
|
1055
1077
|
</code><button>Copy</button></pre>
|
|
1056
1078
|
</div><aside class="tsd-sources">
|
|
1057
1079
|
<p>Inherited from lambdaNodejs.NodejsFunction.metricAllInvocations</p></aside></li></ul></section>
|
|
@@ -1069,7 +1091,7 @@ this type-testing method instead.</p>
|
|
|
1069
1091
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">props</span>: <span class="tsd-signature-type ">MetricOptions</span></h5><code class="tsd-tag ts-flagOptional">Optional</code> </li></ul></div>
|
|
1070
1092
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Metric</span></h4>
|
|
1071
1093
|
<div class="tsd-comment tsd-typography">
|
|
1072
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
1094
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">sum</span><span class="hl-1"> </span><span class="hl-4">over</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1"> </span><span class="hl-4">minutes</span>
|
|
1073
1095
|
</code><button>Copy</button></pre>
|
|
1074
1096
|
</div><aside class="tsd-sources">
|
|
1075
1097
|
<p>Inherited from lambdaNodejs.NodejsFunction.metricAllThrottles</p></aside></li></ul></section>
|
|
@@ -1087,7 +1109,7 @@ this type-testing method instead.</p>
|
|
|
1087
1109
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">props</span>: <span class="tsd-signature-type ">MetricOptions</span></h5><code class="tsd-tag ts-flagOptional">Optional</code> </li></ul></div>
|
|
1088
1110
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Metric</span></h4>
|
|
1089
1111
|
<div class="tsd-comment tsd-typography">
|
|
1090
|
-
<h4>Default</h4><pre><code class="language-ts"><span class="hl-
|
|
1112
|
+
<h4>Default</h4><pre><code class="language-ts"><span class="hl-4">max</span><span class="hl-1"> </span><span class="hl-4">over</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1"> </span><span class="hl-4">minutes</span>
|
|
1091
1113
|
</code><button>Copy</button></pre>
|
|
1092
1114
|
</div><aside class="tsd-sources">
|
|
1093
1115
|
<p>Inherited from lambdaNodejs.NodejsFunction.metricAllUnreservedConcurrentExecutions</p></aside></li></ul></section></section></div>
|