-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Describe the bug
AWS::Serverless::Api supports various auth methods.
AddApiKeyRequiredToCorsPreflight: Boolean
AddDefaultAuthorizerToCorsPreflight: Boolean
ApiKeyRequired: Boolean
Authorizers: CognitoAuthorizer | LambdaTokenAuthorizer | LambdaRequestAuthorizer
DefaultAuthorizer: String
InvokeRole: String
ResourcePolicy: ResourcePolicyStatement
UsagePlan: ApiUsagePlan
However, only AddDefaultAuthorizerToCorsPreflight, Authorizers, and DefaultAuthorizer are supported.
Others such as ResourcePolicy and ApiKeyRequired are not supported.
./node_modules/aws-cdk-lib/aws-sam/lib/sam.generated.d.ts
export interface CfnApiProps {
[...]
/**
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-serverless-api.html#cfn-serverless-api-auth
*/
readonly auth?: CfnApi.AuthProperty | cdk.IResolvable;
interface AuthProperty {
/**
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-auth.html#cfn-serverless-api-auth-adddefaultauthorizertocorspreflight
*/
readonly addDefaultAuthorizerToCorsPreflight?: boolean | cdk.IResolvable;
/**
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-auth.html#cfn-serverless-api-auth-authorizers
*/
readonly authorizers?: any | cdk.IResolvable;
/**
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-auth.html#cfn-serverless-api-auth-defaultauthorizer
*/
readonly defaultAuthorizer?: string;
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
It should cover all supported options.
Current Behavior
only AddDefaultAuthorizerToCorsPreflight, Authorizers, and DefaultAuthorizer are supported.
Reproduction Steps
See above
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.159.1 (build c66f4e3)
Framework Version
No response
Node.js Version
20
OS
ubuntu
Language
TypeScript
Language Version
No response
Other information
No response