Skip to content

Instantly share code, notes, and snippets.

@tarasowski
Created October 16, 2018 09:15
Show Gist options
  • Save tarasowski/c17ee38c2b7a1ee685b898f4033955bd to your computer and use it in GitHub Desktop.
Save tarasowski/c17ee38c2b7a1ee685b898f4033955bd to your computer and use it in GitHub Desktop.
Cognito swagger example
ShopTokenApi:
Type: AWS::Serverless::Api
Properties:
StageName: prod
DefinitionBody:
swagger: 2.0
info:
title: !Sub ${AWS::StackName}
securityDefinitions:
custom-authorizer:
type: apiKey
name: Authorization
in: header
x-amazon-apigateway-authtype: awsSigv4
paths:
/shop/{id}:
get:
parameters:
- name: id
in: path
required: true
type: string
responses: {}
security:
- custom-authorizer: []
x-amazon-apigateway-integration:
httpMethod: POST # for Lambda integrations the value must be POST
type: aws_proxy
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetShopToken.Arn}/invocations
/auth:
get:
responses: {}
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ShopifyServiceAuthBegin.Arn}/invocations
/callback:
post:
responses: {}
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ShopifyServiceAuthComplete.Arn}/invocations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment