Skip to content

Commit

Permalink
Add a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinZZ committed May 8, 2024
1 parent 2bee7ce commit 831322b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/aws-cdk-lib/aws-apigateway/lib/method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export class Method extends Resource {
// be applied to COGNITO_USER_POOLS AuthorizationType.
const defaultScopes = options.authorizationScopes ?? defaultMethodOptions.authorizationScopes;
const authorizationScopes = authorizationTypeOption === AuthorizationType.COGNITO ? defaultScopes : undefined;
Annotations.of(this).addWarningV2('@aws-cdk/aws-apigateway:invalidAuthScope', '\'AuthorizationScopes\' can only be set when \'AuthorizationType\' sets \'COGNITO_USER_POOLS\'. Default to ignore the values set in \'AuthorizationScopes\'.');

if (Authorizer.isAuthorizer(authorizer)) {
authorizer._attachToApi(this.api);
Expand Down

0 comments on commit 831322b

Please sign in to comment.