serverless-ide-vscode
serverless-ide-vscode copied to clipboard
Type property of authorizer has wrong valid values
An error when using the authorizerId prop to refer a custom authorizer.
functions:
func1:
...
events:
- http:
...
authorizer:
authorizerId: !Ref ApiGatewayAuthorizer
type: CUSTOM #[Serverless IDE] Value is not accepted. Valid values: "token", "request", "cognito_user_pools".
The correct values for the type prop, when authorizerId is present, are: ONE, AWS_IAM, CUSTOM, COGNITO_USER_POOLS, AWS_CROSS_ACCOUNT_IAM, JWT
@FerroO2000 The way it's implemented here...
https://github.com/threadheap/serverless-ide-vscode/blob/845ca587608a0833d73f5059b4b37f4140dcb007/packages/serverless-framework-schema/json/aws/common/authorizer.json#L47-L56
.. I think we can just add all possible values for type
, regardless of whether authorizerId
is present or not. So you can also add TOKEN
and REQUEST
to the list of valid values.
@FerroO2000 I was able to find the following values for type
in the AWS documentation:
-
TOKEN
-
REQUEST
-
COGNITO_USER_POOLS
Could you also provide sources for the other values you mentioned?
I got the values from the crash log when deploy with type prop set to TOKEN
Here is the log:
An error occurred: ApiGatewayMethodXXXVarPatch - Invalid AuthorizationType specified. Valid options are NONE,AWS_IAM,CUSTOM,COGNITO_USER_POOLS,AWS_CROSS_ACCOUNT_IAM,JWT (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException).
this happens only if an authorizer is refered with an authorizerId