Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API Key capabilities to AWS::Serverless::Api #547

Closed
mariano-calandra-xp opened this issue Aug 10, 2018 · 6 comments
Closed

Add API Key capabilities to AWS::Serverless::Api #547

mariano-calandra-xp opened this issue Aug 10, 2018 · 6 comments
Labels
contributors/good-first-issue Good first issue for a contributor type/feature

Comments

@mariano-calandra-xp
Copy link

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?

@brettstack
Copy link
Contributor

Absolutely! We've taken our first steps into Auth with #546 and plan on following up with API Keys, AWS_IAM, and Resource Policies. Thanks for the suntan proposal; I'll tag you when I have an RFC up

@studds
Copy link

studds commented Feb 5, 2019

Any update on this? I'd love to do a PR, but unfortunately python is all ancient greek to me - I'd probably set the effort back months if not years.

@brettstack
Copy link
Contributor

Note I added some instructions in #802 for anyone who wants to submit a PR the instructions should be similar.

@mkamioner
Copy link

Any update on this?

@jlhood
Copy link
Contributor

jlhood commented Apr 16, 2019

@mkamioner This is not currently prioritized internally so the fastest way to get it implemented would be for a member of the community to contribute the feature. #827 is a good example PR to follow as the changes needed to implement API key support would touch similar areas of the code.

@ShreyaGangishetty
Copy link

ShreyaGangishetty commented Sep 13, 2019

We have created an RFC #1141 to support creation of Api keys for Auth with Usage Plans. Please let us know your thoughts on the RFC
@studds @mkamioner once the RFC is finalized we can prioritize this feature. Please post your thoughts on the RFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributors/good-first-issue Good first issue for a contributor type/feature
Projects
None yet
Development

No branches or pull requests

8 participants