Skip to content

Commit

Permalink
Merge branch 'feat/service-quotas' of https://github.com/reapit/ts-cd…
Browse files Browse the repository at this point in the history
…k-constructs into feat/service-quotas
  • Loading branch information
joshbalfour committed Feb 9, 2024
2 parents 8f4df5f + 7ec7b9f commit 25fcfa3
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/constructs/cross-region-stack-export/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

![npm version](https://img.shields.io/npm/v/@reapit-cdk/cross-region-stack-export)
![npm downloads](https://img.shields.io/npm/dm/@reapit-cdk/cross-region-stack-export)
![coverage: 74.02%25](https://img.shields.io/badge/coverage-74.02%25-orange)
![coverage: 71.85%25](https://img.shields.io/badge/coverage-71.85%25-orange)
![Integ Tests: X](https://img.shields.io/badge/Integ%20Tests-X-red)

Allows you to share values between stack across regions and accounts.
Expand Down
1 change: 1 addition & 0 deletions packages/constructs/edge-api/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ api.addEndpoint({

// optional
customMiddlewares: [
// @ts-expect-error
(req, mapping) => {
// req is CloudfrontRequest https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/aws-lambda/common/cloudfront.d.ts#L44
// mapping is destination['user requested domain name'] e.g. mapping['example.org']
Expand Down
39 changes: 26 additions & 13 deletions packages/constructs/service-quotas/readme.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
# @reapit-cdk/active-ruleset
# @reapit-cdk/service-quotas


![npm version](https://img.shields.io/npm/v/@reapit-cdk/active-ruleset)
![npm downloads](https://img.shields.io/npm/dm/@reapit-cdk/active-ruleset)
![coverage: 99.02%25](https://img.shields.io/badge/coverage-99.02%25-green)
![Integ Tests: ](https://img.shields.io/badge/Integ%20Tests-%E2%9C%94-green)
![npm version](https://img.shields.io/npm/v/@reapit-cdk/service-quotas)
![npm downloads](https://img.shields.io/npm/dm/@reapit-cdk/service-quotas)
![coverage: 0%25](https://img.shields.io/badge/coverage-0%25-red)
![Integ Tests: X](https://img.shields.io/badge/Integ%20Tests-X-red)

This construct returns the currently active SES receipt RuleSet, or creates one. This enables you to add rules to it.
This construct allows you to IaC your service quotas

## Package Installation:

```sh
yarn add --dev @reapit-cdk/active-ruleset
yarn add --dev @reapit-cdk/service-quotas
# or
npm install @reapit-cdk/active-ruleset --save-dev
npm install @reapit-cdk/service-quotas --save-dev
```

## Usage
```ts
import { CfnOutput, Stack, App } from 'aws-cdk-lib'
import { ActiveRuleset } from '@reapit-cdk/active-ruleset'
import { Stack, App } from 'aws-cdk-lib'
import { AWSService, AmazonCloudFrontQuota, ServiceQuotas } from '@reapit-cdk/service-quotas'

const app = new App()
const stack = new Stack(app, 'stack-name')
const activeRuleset = new ActiveRuleset(stack, 'active-ruleset')
new CfnOutput(stack, 'activeRulesetName', {
value: activeRuleset.receiptRuleSet.receiptRuleSetName,
const quotas = new ServiceQuotas(stack, 'service-quotas', {
// Fail the stack if your requests aren't granted yet
failIfNotGranted: true,
// Make another request if an existing one is denied
rerequestWhenDenied: true,
})

quotas.requestQuota(
// region
'us-east-1',
// service (use the AWSService.${Service} helper or specify the e.g. 'cloudfront' string as any)
AWSService.AmazonCloudFront,
// quota (use the ${Service}Quota e.g. AmazonCloudFrontQuota helper or specify the 'LL-' string as any)
AmazonCloudFrontQuota.CacheBehaviorsPerDistribution,
// desired value
100,
)

```
2 changes: 1 addition & 1 deletion packages/modules/edge-api-sdk/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

![npm version](https://img.shields.io/npm/v/@reapit-cdk/edge-api-sdk)
![npm downloads](https://img.shields.io/npm/dm/@reapit-cdk/edge-api-sdk)
![coverage: 95.74%25](https://img.shields.io/badge/coverage-95.74%25-green)
![coverage: 95.8%25](https://img.shields.io/badge/coverage-95.8%25-green)

Provides convenience wrappers for accepting and responding to [@reapit-cdk/edge-api]('../../constructs/edge-api/readme.md') lambda requests.

Expand Down
14 changes: 11 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @reapit-cdk/ts-constructs
![coverage: 92.94%25](https://img.shields.io/badge/coverage-92.94%25-green)
![coverage: 92.65%25](https://img.shields.io/badge/coverage-92.65%25-green)
CDK Constructs Monorepo
## Constructs

Expand Down Expand Up @@ -27,7 +27,7 @@ CloudFront invalidations are [very error prone](https://github.com/aws/aws-cdk/i

![npm version](https://img.shields.io/npm/v/@reapit-cdk/cross-region-stack-export)
![npm downloads](https://img.shields.io/npm/dm/@reapit-cdk/cross-region-stack-export)
![coverage: 74.02%25](https://img.shields.io/badge/coverage-74.02%25-orange)
![coverage: 71.85%25](https://img.shields.io/badge/coverage-71.85%25-orange)
![Integ Tests: X](https://img.shields.io/badge/Integ%20Tests-X-red)

Allows you to share values between stack across regions and accounts.
Expand Down Expand Up @@ -87,6 +87,14 @@ Creates a KMS key and replicates it to the desired regions. Useful when replicat
![Integ Tests: ✔](https://img.shields.io/badge/Integ%20Tests-%E2%9C%94-green)

Creates a Secret and replicates it across the given regions. Requires a [ReplicatedKey](../replicated-key/readme.md) be passed in.
<h3><a href="packages/constructs/service-quotas">@reapit-cdk/service-quotas</a></h3>

![npm version](https://img.shields.io/npm/v/@reapit-cdk/service-quotas)
![npm downloads](https://img.shields.io/npm/dm/@reapit-cdk/service-quotas)
![coverage: 0%25](https://img.shields.io/badge/coverage-0%25-red)
![Integ Tests: X](https://img.shields.io/badge/Integ%20Tests-X-red)

This construct allows you to IaC your service quotas
<h3><a href="packages/constructs/userpool-domain">@reapit-cdk/userpool-domain</a></h3>

![npm version](https://img.shields.io/npm/v/@reapit-cdk/userpool-domain)
Expand Down Expand Up @@ -124,7 +132,7 @@ This module helps write custom resource handlers. It's designed to work with the

![npm version](https://img.shields.io/npm/v/@reapit-cdk/edge-api-sdk)
![npm downloads](https://img.shields.io/npm/dm/@reapit-cdk/edge-api-sdk)
![coverage: 95.74%25](https://img.shields.io/badge/coverage-95.74%25-green)
![coverage: 95.8%25](https://img.shields.io/badge/coverage-95.8%25-green)

Provides convenience wrappers for accepting and responding to [@reapit-cdk/edge-api]('../../constructs/edge-api/readme.md') lambda requests.
<h3><a href="packages/modules/email-receiver-client">@reapit-cdk/email-receiver-client</a></h3>
Expand Down

0 comments on commit 25fcfa3

Please sign in to comment.