x-api-key only secures some resources x-api-key only secures some resources flask flask

x-api-key only secures some resources


Yes, this is possible with a bit of configuration in the AWS console.

In your API Gateway setup you probably have the default resources created with a Zappa deployment: / and /{proxy+}.

Default resources

You can now manually create a new resource corresponding to your documentation endpoint (e.g. /docs).

Clicking on "Actions" -> "Create Resource" you can create the new resource:

create new resource

After the resource is created, click "Actions" -> "Create Method" and choose "ANY". Point the method and resource to your Lambda function in the dialog.

By default, the new resource should not require the API key.

no api key required

Note: you might need to redeploy the gateway before the changes take effect. "Actions" -> "Deploy API".