In my template.yaml I have this config for an authorizer and API, when I try to deploy it I get this error:
Authorizer name must be
unique.Authorizer CognitoAuthorizer
already exists in this RestApi
CognitoAuthorizer:
Type: AWS::ApiGateway::Authorizer
Properties:
Name: CognitoAuthorizer
RestApiId: !Ref UserApi
Type: COGNITO_USER_POOLS
IdentitySource: method.request.header.Authorization
ProviderARNs:
- !GetAtt UserPool.Arn
UserApi:
Type: AWS::Serverless::Api
Properties:
Name: UserApi
StageName: Prod
Auth:
DefaultAuthorizer: CognitoAuthorizer
Authorizers:
CognitoAuthorizer:
UserPoolArn: !GetAtt UserPool.Arn
I’m trying to do a relation between my API and Authorizer
New contributor
Emiliano Ortz Hernndez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.