-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/service-quotas' of https://github.com/reapit/ts-cd…
…k-constructs into feat/service-quotas
- Loading branch information
Showing
5 changed files
with
40 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters