I have an endpoint in ApiGateway of the form GET /user/{userId} and I want the endpoint to be open (i.e. without any security) and return some basic non-sensitive information about a user (e.g. nickname). But I also want that when a user is authenticated and authorized (through Cognito) to show more information about that user. Is there a way to set up this in CloudFormation?
My code so far:
/person/{id}:
get:
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFunctionArn.Arn}/invocations
httpMethod: POST
type: "AWS_PROXY"
tags:
- Person
summary: Find person by identifier
description: Returns a single person matching id parameter
operationId: GetPersonById
security:
- CognitoUserPool: [ ]
- <what_can_I_put_here_for_an_open_endpoint?>
