Skip to content

Commit 2d84aa3

Browse files
committed
chore(refactor): Add functions to monitoring as they are instantiated
There is some stateful wonkery inside, because cdk-monitoring-constructs lacks functionality for influencing the layout of a dashboard
1 parent dc1e41f commit 2d84aa3

File tree

15 files changed

+55
-35
lines changed

15 files changed

+55
-35
lines changed

docs/constructs/assets/hierarchy.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/constructs/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/constructs/classes/BaseApi.html

Lines changed: 4 additions & 3 deletions
Large diffs are not rendered by default.

docs/constructs/classes/GraphQlApi.html

Lines changed: 5 additions & 4 deletions
Large diffs are not rendered by default.

docs/constructs/classes/LambdaFunction.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="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">&#39;MyLambdaFunction&#39;</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">&#39;path/to/lambda/handler.ts&#39;</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">&#39;main&#39;</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">&#39;dev&#39;</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>
66
</code><button type="button">Copy</button></pre>
77

8-
</div></div></section><section class="tsd-panel tsd-hierarchy" data-refl="128"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">NodejsFunction</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">LambdaFunction</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="LambdaFunction.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
8+
</div></div></section><section class="tsd-panel tsd-hierarchy" data-refl="131"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">NodejsFunction</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">LambdaFunction</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="LambdaFunction.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
99
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="LambdaFunction.html#architecture" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>architecture</span></a>
1010
<a href="LambdaFunction.html#cancreatepermissions" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>can<wbr/>Create<wbr/>Permissions</span></a>
1111
<a href="LambdaFunction.html#deadletterqueue" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dead<wbr/>Letter<wbr/>Queue?</span></a>

docs/constructs/classes/RestApi.html

Lines changed: 5 additions & 4 deletions
Large diffs are not rendered by default.

docs/constructs/classes/SingleTableDatastore.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="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">&#39;MyDatastore&#39;</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">&#39;PK&#39;</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">&#39;SK&#39;</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">&#39;GSI1&#39;</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">&#39;GSI1PK&#39;</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">&#39;GSI1SK&#39;</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">&#39;LSI1&#39;</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">&#39;LSI1SK&#39;</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">&#39;TTL&#39;</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>
55
</code><button type="button">Copy</button></pre>
66

7-
</div></div></section><section class="tsd-panel tsd-hierarchy" data-refl="599"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">Construct</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">SingleTableDatastore</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="SingleTableDatastore.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
7+
</div></div></section><section class="tsd-panel tsd-hierarchy" data-refl="606"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">Construct</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">SingleTableDatastore</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="SingleTableDatastore.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
88
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="SingleTableDatastore.html#node" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>node</span></a>
99
<a href="SingleTableDatastore.html#table" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>table</span></a>
1010
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="SingleTableDatastore.html#tostring" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>String</span></a>

0 commit comments

Comments
 (0)