AWS CDK user pool authorizer

I'm trying to create an API gateway using the AWS-CDK and protect the REST endpoints with a Cognito user pool authorizer. I cannot find any examples how one would do this. I thought it should...

enabling CORS for AWS API gateway with the AWS CDK

I'm trying to build an application with the AWS CDK and if I were to build an application by hand using the AWS Console, I normally would enable CORS in API gateway. Even though I can export the...

How to configure sending(apigateway) and getting(lambda) request Query Parameters with CDK for Typescript

I've cdk initialized an app. My app has a stack of ApiGateway with a 'GET' method bound to the root ('/'). A Lambda function is bound to the 'GET' method. I want when I send a 'GET' request with...

aws ressource limit api - how to separate stacks on RestApi

as i am using aws-cdk to define aws stacks, i am running into some limits here and i have no idea how to solve it. First of all, there is a non-changeable limit on resources of 200 per stack. this...

Migrate from apigateway to apigatewayv2

How to migrate from apigateway to apigatewayv2 using AWS-CDK? Specifically: I am using LambdaRestApi and restApiId and deploymentStage from that resource. // old const apiGw = new...

AWS CDK: run external build command in CDK sequence?

Is it possible to run an external build command as part of a CDK stack sequence? Intention: 1) create a rest API, 2) write rest URL to config file, 3) build and deploy a React app: import...

AWS CDK API Gateway Construct Library

I'm trying to use the AWS_CDK for python to provision an apigateway integration. The typescript on https://pypi.org/project/aws-cdk.aws-apigateway/1.4.0/ is helpful, as is the unchecked python...

AWS CDK: Get LoadBalancer ARN of ElasticBeanstalk Environment for ApiGateway VPC Link

I'm using AWS CDK to create an Elastic Beanstalk Environment with a Network Load Balancer. The Elastic Beanstalk application and the Load Balancer are both in a private Subnet in a VPC. I want to...

AWS CDK - how to grant invoke permissions on a Lambda to API Gateway before deployment?

This question relates to a problem I cam across here: https://stackoverflow.com/questions/62179893/aws-cdk-how-to-create-an-api-gateway-backed-by-lambda-from-openapi-spec. I create an API Gateway...

Have I split up these Constructs incorrectly?

I'm fairly new to CDK and I've tried migrating something from vanilla JavaScript to TypeScript, in doing so trying to make it a little more modular. This is the current structure that I've...

How to get the Arn of a resource created in a cdk script

I'm currently experimenting with AWS CDK and I'm stuck with something that, in my mind, should be easy. (I'm working with python, but I believe it's the same with any "cdk enabled" language ) I...

Amazon CDK: Incorrect Construct Type even though it is extended from cdk.Construct?

I am trying to deploy an API Gateway with a custom domain. (no functions, just a common API Gateway that other stacks can then import and use) bin/api-app.ts: import { APIAppStack } from...

aws-cdk - Private API Gateway using SpecRestApi (openAPI 3)

Resolved The following PR fixes the issue: https://github.com/aws/aws-cdk/pull/9068 Fixes this issue. You can now set your endpointType like this: const api = new apigateway.SpecRestApi(this,...

AWS CDK - Cognito UserPool authorizer on API Gateway not working

My goal is to set up some lambda functions which are public (i.e. no authorization required to send requests) and other ones which require a User to be logged in within a Cognito UserPool. In my...

Is there a way to connect a new lambda function an existing AWS ApiGateway using AWS-CDK? (Python)

I am trying to wrap my head around AWS-CDK to deploy Lambda functions to aws through it. I already have a pre-existing Api gateway, that I have manually deployed through the console and would like...

aws-cdk LambdaRestApi: The final policy size is bigger than the limit

Hi i have been trying many possibilities, but now i would need some help. I am using aws-cdk to create architecture by code and so far things have going well. Now i am running into this issue: The...

How to integrate API Gateway with s3 in CDK

The docs are very clear in doing this in the console, https://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html, but replicating in CDK is really...

How to integrate Dynamodb Local into AWS Cloud Development Kit

How does one integrate DynamoDB Local into the development process when using aws-cdk? For example, the following app (using the "sample app" template) works, but how would one run sam local...

Getting a 403 when trying to call a websocket

Hey I have a web socket deployed to AWS API gateway with a custom domain and lambda's backing it. I keep getting this error in web console when trying to interact with it through my angular...

AWS CDK set Stage stageName

I have an aws cdk project using typescript. I plan to set up a pipeline with 2 stages (dev and prod). I have a cdk stage which contains a stack with a gateway and lamba construct inside /*...

How to use AWS CDK to look up existing ApiGateway

I am using AWS CDK to build my lambda, and I would like to register endpoints from the lambda's CDK stack. I found I can get an existing ApiGateway construct using fromRestApiId(scope, id,...

How to provide a custom domain name for a Lambda-based APIGateway in CDK?

For the purposes of this question, assume that I already have an example.org Hosted Zone in Route53 (my actual zone is, of course, different) With the following CDK app: export class...

Serverless Framework API Gateway Websockets Binary Data

Anyone know how to set a websocket's content handling strategy to binary in the serverless framework? I have a websocket defined as follows: my_websocket: handler: src/handler.handler ...

CDK: How to get apigateway key value (ie x-api-key: *20 Chars*)

I'm unable to find out how to get the api key out of an apigateway key. I can get its ID and its ARN but not the value. I know you can specify the value when creating the key, but not how to...

AWS API Gateway, default base mappings with CDK

I'm setting up an environment with AWS CDK but I'm having trouble with API Gateway and base mappings for custom domains. I got an API that should have two stages: "internal" and...

Deploy .NET 5 AWS Lambda with Container Images using CDK: Internal Server Error

I've created a new .NET 5 AWS Lambda Function using Container Images via the Visual Studio Project Template: And now I want to deploy the Lambda Function and an ApiGateway using the CDK. I was...

How to solve CDK CLI version mismatch

I'm getting following error: This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version. (Cloud assembly schema version mismatch:...

How to resolve AWS CDK error "Argument of type 'Function' is not assignable to parameter of type 'IFunction'"

I want to get the following example code from https://docs.aws.amazon.com/cdk/latest/guide/serverless_example.html working, but I get a "Argument of type 'Function' is not assignable to parameter...

How can I set up my HostedZone so that it delegates to a parent DNS record in another AWS account?

Introduction I have some TypeScript code that uses CDK to create an API Gateway and a Lambda. It works and deploys to a standard AWS URL. So far so good. I now need to transfer the API Gateway so...

route53 returns forbidden for custom domain with API Gateway

I'm using AWS CDK to create an APIGateway. I want to attach a custom domain to my api so I can use api.findtechjobs.io. In the console, I can see I have a custom domain attached, however I always...