7,787 questions
1
vote
1
answer
57
views
Issue consuming API that returns Base64 Excel file in Angular
I am facing difficulties consuming an API in Angular that returns an Excel file encoded in Base64. The API is configured in AWS API Gateway and uses a Lambda function to generate the file. Although ...
0
votes
0
answers
27
views
Unable to transform request AWS Gateway VTL
I have the following pulumi go code which uses AWS Integration to start a StepFunction.
func DealRequestTemplate(stateMachineArn pulumi.StringInput) pulumi.StringInput {
return pulumi.Sprintf(`#...
-3
votes
0
answers
79
views
How to use the built-in request validators instead of creating new resource?
In order to enforce query params validation, we have to assign Request validator in the method request. In my case I want to enforce required validation to startDate and endDate query params (Validate ...
0
votes
0
answers
55
views
AWS CDK use api gateway in a nested stack
I have this api gateway in my main stack:
api_gateway = _api_gw.LambdaRestApi(
self,
f"{construct_id}-gw-api",
handler=lambda_hello,
rest_api_name=f"gw-api{env_ext}"...
0
votes
0
answers
42
views
FastAPI: PDF upload works when called directly inside Kubernetes or locally, but results in blank files when routed through API Gateway/NGINX
I’m running a FastAPI service in Kubernetes that accepts multipart/form-data uploads and stores files in S3.
The upload endpoint works fine when I call it directly inside the cluster using the service ...
0
votes
1
answer
86
views
Spring Boot OAuth2 with Casdoor behind AWS Lambda + HTTP API v2: state parameter encoding issue
I’m developing a Spring Boot application deployed behind an AWS API Gateway (HTTP API v2) with Lambda (handler based on SpringBootLambdaContainerHandler and HttpApiV2ProxyRequest).
I’m using OAuth2 ...
0
votes
1
answer
61
views
Significant import discrepancy in Python CDK v2 when enabling API Gateway logging
I have been modifying an AWS CDK v2 stack (Python) to generate an API Gateway v2 stage with logging enabled. Sounds simple, there are countless examples on the internet, and countless agentic coding ...
0
votes
0
answers
20
views
awsEndpointRequestId not being consumed by headers for HTTP APIGateway
According the Customize HTTP API access logs, the logging variable $context.awsEndpointRequestId is populated from x-amz-request-id or x-amzn-requestId header.
I am directly hitting the my HTTP ...
1
vote
1
answer
128
views
CredentialsProviderError using ApiGatewayManagementApiClient in Serverless Framework Offline
I'm having issues trying to get Serverless Framework (using the Offline plugin) to be able to use the ApiGatewayManagementApiClient to send WebSocket responses offline.
It's probably just using the ...
1
vote
0
answers
53
views
Mongodb not available for my AWS Lambda function
I have tried to import mongodb into my lambda function and I keep getting an error message when I attempt to test it. All the recommended resolutions I have seen assume I am working in an environment ...
1
vote
1
answer
89
views
Get AWS API Gateway API keys that don't match nameQuery parameter in get_api_keys() boto3 AWS SDK
As the title says, I can get all API keys in API Gateway that start with the contents of nameQuery, but is it possible to get all API keys that don't match nameQuery?
I'm looking to filter out some ...
0
votes
0
answers
44
views
Is it possible to create an HTTP API Gateway integration to EventBridge that reads the detail-type from a detail-type attribute of the payload?
My input to API Gateway looks like this:
{
"detail": {
"stuff": "goeshere"
},
"detail-type": "ApiGatewayTest",
"source&...
0
votes
1
answer
29
views
How is the AWS::Serverless::Api DefinitionBody auto-generated?
According to the documentation:
If neither DefinitionUri nor DefinitionBody are specified, SAM will generate a DefinitionBody for you based on your template configuration.
However, I can't seem to ...
1
vote
2
answers
82
views
Can I transform a query string parameter with AWS API Gateway using a Lambda proxy integration?
The AWS docs here state that "You can use parameter mapping in your integration request for proxy and non-proxy integrations, but to use parameter mapping for an integration response, you need a ...
0
votes
0
answers
51
views
Proxy JSON Response Of Step Function Through API Gateway
My step function outputs:
{
"statusCode": 400,
"body": {
"error": "Email already associated with another account"
}
}
(Or ...
0
votes
0
answers
62
views
CloudFront throws 401 or 403 before accessing to API Gateway
This is my first time deploying a web application using AWS and I could successfully see the static pages but not dynamic pages now.
I've read that when CloudFront gets a header with authorization, it ...
-1
votes
1
answer
59
views
Terraform deployment in localstack with out errors half the config only get deployed [closed]
So Im trying to deploy some terraform configuration into localstack. Im running it inside WSL so linux based, The problem is that for testing now the configuration in terraform creates an S3 bucket ...
0
votes
0
answers
40
views
Error Invoking Sagemaker Endpoint from API Gateway REST API Integration
I am having difficulty invoking a sagemaker endpoint from API gateway. The API gateway API is a REST API (POST method type) with Sagemaker Runtime as the Integration type. The HTTP method in the ...
0
votes
1
answer
130
views
AWS Lambda + API Gateway returns 502 Bad Gateway (Internal server error) when called from frontend
I'm working on a Next.js frontend that sends a POST request to an AWS Lambda function via API Gateway (REST API). The Lambda function is supposed to receive an array of objects and return a modified ...
2
votes
1
answer
128
views
Why does AWS STS regional endpoint affect when calling an API Gateway in a different region?
I have a simple Python script that makes a GET request to a REST API hosted in AWS API Gateway. To authorize the request, I use the temporary credentials obtained by assuming a role (a role that is ...
0
votes
0
answers
34
views
Caching with API Gateway, aws_proxy integration and custom domains
I'm trying to figure out how to handle caching in the most appropriate way for my APIs which are handled via Lambdas hooked up to API Gateway using aws_proxy and custom domains.
I read that a hidden ...
0
votes
1
answer
140
views
How to set Access-Control-Allow-Origin dynamically from incoming Origin header in integration response?
I'm working on an AWS API Gateway setup. I need to dynamically set the Access-Control-Allow-Origin header in the response based on the incoming Origin header from the client request.
This is necessary ...
1
vote
1
answer
59
views
AWS Websockets API with custom domain name not working in all stages?
I setup a Websockets API with the AWS API Gateway service and it‘s working fine for the stage staging. I‘ve setup a custom domain name for thr websockets API, like so:
staging stage, path /staging
...
0
votes
1
answer
61
views
How to map custom header into body request?
I'm working with AWS Api Gateway integrated with SQS.
I would like to catch a header from the request to the Api Gateway and map it to the body, so it becomes part of the message the SQS will recieve.
...
1
vote
1
answer
115
views
How to Apply WAF WebACL to Edge-Optimized API Gateway?
I'm trying to apply an AWS WAF WebACL to an edge-optimized API Gateway, but I'm running into some confusion around how this is supposed to work, given the architecture.
As I understand it, edge-...
0
votes
0
answers
81
views
AWS API Gateway WebSocket 403 Forbidden errors despite correct policy and credentials
Problem Description:
I'm encountering persistent 403 Forbidden errors when trying to use WebSocket connections with AWS API Gateway. We recently migrated from ca-central-1 to us-east-1 region, and ...
0
votes
0
answers
43
views
Why Azure DevOps WebHook fails when hitting an AWS API Gateway?
I've created a Service Web Hook on Azure DevOps so I can hit an AWS API Gateway, then send a message to an SQS and invoke a lambda function.
The whole process works fine. Hit from Azure is being done, ...
0
votes
0
answers
74
views
Enable CORS for simple GET on AWS API Gateway resource with Cognito authorizer
I have an AWS API Gateway resource /foo with a GET method. It has a Lambda integration, which for the purposes of this question simply returns bar. However I want the API to be protected, so I have ...
1
vote
1
answer
78
views
AWS API Gateway (REST API) Resource Policy to restrict one endpoint to certain IPs while other endpoints can be reached by all IPs
I have the following Resource Policy defined for my "REST API" in AWS API Gateway:
I tried the following appraoches:
{
"Version": "2012-10-17",
"Statement": ...
0
votes
0
answers
77
views
How to convert a http response with content type application/json to application/octet-stream?
What is the issue?
We use AWS API Gateway for integration with the AWS S3 using REST calls.
In the API Gateway transformation we haven't supported HTTP_HEADERS yet. And we don't want to roll out ...
0
votes
0
answers
22
views
Extract message from lambda record - triggered by alertmanager to api gateway
trying to create a message alert from alertmanager(my instance is having pod restarts in production namespace), using lambda to trigger SNS messaging in case the alert jumps in.
so its- alertmanager(...
0
votes
1
answer
65
views
SAM template authorizerr error: authorizerUri/Fn::Sub/1/__FunctionArn__] 'null' values are not allowed in templates
Trying to create and API Gateway with lambda and attach the authorizer to it. The api and lambda creation works perfectly, but when I add the authorizer section, I get the following error:
Error: ...
0
votes
0
answers
107
views
Is there a way to prevent AWS ApiGateway from re-writing headers?
I am using an AWS proxy ApiGateway that is mapped to a lambda function that is hosting a REST Api. Everything is wired up and functioning, except I see that responses from the server are remapping my '...
1
vote
0
answers
62
views
How to configure AWS API Gateway Integration Request for CloudWatch Logs StartQuery Action?
I'm trying to configure API Gateway to provide a POST method that sends the StartQuery action to CloudWatch Logs but I just seem to get 404 errors in the log output as when I use Edit integration ...
0
votes
1
answer
34
views
Having API Gateway sign a proxied request destined for OpenSearch in CloudFormation
I have a CloudFormation setup that I hope to use to automatically index documents in OpenSearch. I've set up an ingestion bucket in S3; when a file's dropped in the bucket, it triggers a Lambda ...
1
vote
1
answer
104
views
What is the difference between a "REST API" of type "private" and a "REST API Private"
When creating an API endpoint on the AWS console, 2 options exist:
Option A: A "REST API" with "API endpoint type" of "Regional" or "Edge-optimized" or "...
0
votes
0
answers
54
views
AWS WebSocket API (WSS) Handshake Succeeds, No Data Received
I have a Node.js server hosted on AWS Fargate, listening on port 8080. It's responsive and working as expected.
The server is connected to a WebSocket API, and I’ve tested both tcp:8080 and http:8080 ...
0
votes
1
answer
65
views
How can I ensure my AWS Lambda function uses the CloudFront domain instead of the API Gateway URL for the canonical link in my Qwik SSR application?
I have an AWS Lambda function connected to an API Gateway (Regional HTTP API) and my domain is linked to CloudFront. However, my application's canonical URL is being set to the API Gateway domain ...
0
votes
1
answer
54
views
Redirect based on URL to AWS CloudFront or AWS Amplify
I have two apps in AWS.
One hosted in AWS S3 and acts as an origin for an AWS CloudFront distribution.
Another one hosted in AWS Amplify.
I would like to, based on a specific path, to redirect ...
0
votes
0
answers
62
views
AWS API-gateway multiple authorizer and caching
Context
I have an api-gateway with a custom authorizer that validates a JWT. The authorizer gives back broad resource permissions. Something like the following:
{
"Version": "2012-10-...
0
votes
0
answers
45
views
return 401 from lambda non-proxy api gateway and return headers
How do I return 401 to the client, based on the statusCode returned from the lambda? (non-proxy integration).
How do I return the headers from the headers field? (for 401 and 200)
return {
"...
0
votes
1
answer
82
views
how to remove escape char \" that is added by aws api gateway integration response
I have this template:
#set($context.responseOverride.header.A = 'ab "cd"')
In Postman I see a header A with value "ab \"cd\"".
I want to see in Postman a header A with ...
0
votes
1
answer
64
views
How to activate a documentation on AWS API Gateway using Terraform?
I am publishing an API Gateway documentation using aws_api_gateway_documentation_version as follows:
resource "aws_api_gateway_documentation_version" "docs_version" {
version ...
0
votes
0
answers
38
views
AwsIntegration write to DynamoDB SerializationException
I have the following code which takes a POST input and writes the data in a DynamoDB table.
It works if I don't add the validation to check if the key:value pair exists.
Here is the code:
const ...
0
votes
1
answer
60
views
API Gateway with mTLS accepts any self-signed CA signed cert
I am configuring mTLS for an API Gateway, my trustore.pem only has one cert.
I've created another CA, signed a cert with that CA and issued the curl request with --key and --cert params, and it went ...
0
votes
0
answers
136
views
AWS API Gateway Returning {"message":"not found"}
Been working on this semi-secure (will add HTTPS later) API Gateway. I've managed to deploy the TF into the cloud, and it built fine.
My main issue currently is that when I try to use the Invoke URL (...
1
vote
0
answers
82
views
API Gateway is censoring/modifying responses from ALB
How should one use the HttpAlbIntegration for HttpApi on API Gateway v2 library?
At current, my application does indeed build and deploy. However, when I query requests.get(endpoint/ping) the response ...
2
votes
2
answers
120
views
AWS SAM: Calling a Lambda Function from an API Gateway asynchronously
In my current project I want to call a long running Lambda function from an API Gateway asynchronously. All resources are defined in a SAM template.
I tried to follow the instructions in
https://docs....
1
vote
0
answers
86
views
How to get query parameter info in API gateway Log
The log format in AWS Api Gateway is set to
{
"requestTime": "$context.requestTime",
"requestId": "$context.requestId",
"httpMethod": &...
0
votes
0
answers
48
views
How to invoke API developed using AWS API Gateway which was protected by Amazon Cognito user pool token in Salesforce Apex class
I have created an API using AWS API Gateway, which is protected by an Amazon Cognito User Pool.
I need to obtain a token from Amazon Cognito to invoke or access this API from my Salesforce Apex class. ...