Skip to content

Commit

Permalink
fixing auth types
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbarbour committed Nov 4, 2023
1 parent 9a7558f commit 5feac75
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/cloudformation/modules/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export class Api{
return this;
}

static create(aws: ApiExpects, name: string, stage: string, lambdaArn?: Value<string>, tags?: Tag[]): Api {
static create(aws: ApiExpects, name: string, stage: Value<string>, lambdaArn?: Value<string>, tags?: Tag[]): Api {
const restApi = aws.apigateway.restApi({ name, tags });
const permission = lambdaArn ? aws.lambda.permission({
action: 'lambda:InvokeFunction',
Expand All @@ -330,8 +330,4 @@ export class Api{
}).withLogicalName(aws.logicalName('ApiDeployment' + Math.floor(Math.random() * 100000000)))
return new Api(aws, name, restApi, deployment, undefined, undefined, lambdaArn, permission ? [permission] : [], undefined);
}

static createWithCognitoAuth(aws: ApiExpects, name: string, stage: string, providerArns?: Value<string>[], lambdaArn?: Value<string>, tags?: Tag[]): Api {
return Api.create(aws, name, stage, lambdaArn, tags).withCognitoAuthorizer(...(providerArns ?? []));
}
}

0 comments on commit 5feac75

Please sign in to comment.