-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fsx-lustre-l2
- Loading branch information
Showing
157 changed files
with
3,355 additions
and
2,721 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,10 @@ | ||
## Description | ||
|
||
<!-- | ||
The description should describe _motivation_. Think about your code reviewers and what information they need in order to understand what you did. If it's a big commit (hopefully not), try to provide some good entry points so it will be easier to follow. | ||
If not obvious (i.e. from unit tests), describe how you verified that your change works. | ||
--> | ||
|
||
## Commit Message | ||
<!--Simply copy paste from the PR title and replace the necessary parts--> | ||
{*replace-with-pr-title*} (#{*replace-with-pr-number*}) | ||
|
||
<!--Use this to give a more detailed message that describes the change--> | ||
{replace-with-extended-commit-message} | ||
|
||
<!--For every issue your PR resolves, add `fixes #<issue>` or `closes #<issue>`--> | ||
|
||
<!--Shout out to collaborators.--> | ||
|
||
<!--If your PR includes breaking changes, uncomment and fill in the following (notice how multiple breaking changes should be formatted):--> | ||
<!-- | ||
BREAKING CHANGE: Description of what broke and how to achieve this behavior now<br> | ||
\* **module-name:** Another breaking change<br> | ||
\* **module-name:** Yet another breaking change | ||
--> | ||
|
||
<!--IMPORTANT: This section cannot contain any additional markdown headers (#)--> | ||
|
||
## End Commit Message | ||
|
||
---- | ||
|
||
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* | ||
|
||
<!-- | ||
<!-- | ||
Please read the contribution guidelines and follow the pull-request checklist: | ||
https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md | ||
--> |
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
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
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
54 changes: 54 additions & 0 deletions
54
packages/@aws-cdk/aws-apigateway/lib/rate-limited-api-key.ts
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Construct, Resource } from '@aws-cdk/core'; | ||
import { ApiKey, ApiKeyProps, IApiKey } from './api-key'; | ||
import { QuotaSettings, ThrottleSettings, UsagePlan, UsagePlanPerApiStage } from './usage-plan'; | ||
|
||
/** | ||
* RateLimitedApiKey properties. | ||
*/ | ||
export interface RateLimitedApiKeyProps extends ApiKeyProps { | ||
/** | ||
* API Stages to be associated with the RateLimitedApiKey. | ||
* @default none | ||
*/ | ||
readonly apiStages?: UsagePlanPerApiStage[]; | ||
|
||
/** | ||
* Number of requests clients can make in a given time period. | ||
* @default none | ||
*/ | ||
readonly quota?: QuotaSettings; | ||
|
||
/** | ||
* Overall throttle settings for the API. | ||
* @default none | ||
*/ | ||
readonly throttle?: ThrottleSettings; | ||
} | ||
|
||
/** | ||
* An API Gateway ApiKey, for which a rate limiting configuration can be specified. | ||
* | ||
* @resource AWS::ApiGateway::ApiKey | ||
*/ | ||
export class RateLimitedApiKey extends Resource implements IApiKey { | ||
public readonly keyId: string; | ||
|
||
constructor(scope: Construct, id: string, props: RateLimitedApiKeyProps = { }) { | ||
super(scope, id, { | ||
physicalName: props.apiKeyName, | ||
}); | ||
|
||
const resource = new ApiKey(this, 'Resource', props); | ||
|
||
if (props.apiStages || props.quota || props.throttle) { | ||
new UsagePlan(this, 'UsagePlanResource', { | ||
apiKey: resource, | ||
apiStages: props.apiStages, | ||
quota: props.quota, | ||
throttle: props.throttle | ||
}); | ||
} | ||
|
||
this.keyId = resource.keyId; | ||
} | ||
} |
Oops, something went wrong.