-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
contributors/good-first-issueGood first issue for a contributorGood first issue for a contributortype/feature
Description
Hi, I was thinking about API key capabilities to AWS::Serverless::Api
resource.
Something like:
MyRestApi:
Type: AWS::Serverless::Api
Properties:
...
ApiKeys:
- Enabled: true
Name: myFirstApiKey
UsagePlanId: !Ref MyUsagePlan
MyUsagePlan:
Type: AWS::Serverless::ApiUsagePlan
Properties:
Name: String
Description: String
Quota: QuotaSettings
Throttle: ThrottleSettings
That will be translated into:
MyRestApi:
Type: AWS::Serverless::Api
...
MyFirstApiKey:
Type: AWS::ApiGateway::ApiKey
DependsOn:
- MyUsagePlan
Properties:
Name: MyFirstApiKey
Enabled: "true"
StageKeys:
- RestApiId: !Ref MyRestApi
StageName: !Ref MyRestApi.Stage
MyUsagePlan:
Type: AWS::ApiGateway::UsagePlan
DependsOn:
- MyRestApi
Properties:
ApiStages:
- ApiId: !Ref MyRestApi
Stage: !Ref MyRestApi.Stage
UsagePlanName: MyUsagePlan
Quota: QuotaSettings
Throttle: ThrottleSettings
MyUsagePlanKey:
Type: AWS::ApiGateway::UsagePlanKey
Properties :
KeyId: !Ref MyFirstApiKey
UsagePlanId: !Ref MyUsagePlan
KeyType: API_KEY
AWS::Serverless::ApiUsagePlan
could be optional with a default.
The current way do the job but it's a little bit more verbose
Does it sound?
TheMasquerader, mvanbaak, zjd713, AndyShortt, xydinesh and 4 more
Metadata
Metadata
Assignees
Labels
contributors/good-first-issueGood first issue for a contributorGood first issue for a contributortype/feature