aws cdk - API Gateway is censoringmodifying responses from ALB - Stack Overflow

How should one use the HttpAlbIntegration for HttpApi on API Gateway v2 library?At current, my applica

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 is 'Healthy Connection'. In truth, I defined a JSON response, where {"status": "ok"} should be returned.

Here's a method FastAPI application hosted on Fargate tasks:

# Health check route
@router.get("/ping", status_code=status.HTTP_200_OK)
async def ping():
    logging.info(f"ping request received.")
    # SageMaker will ping this to check if the endpoint is healthy
    return JSONResponse({"status": "ok"})   

In CDK, I define my integration as

    // Create the HTTP ALB Integration
    const albIntegration = new apigwv2_integrations.HttpAlbIntegration(`AlbIntegration-${props.stageName}`, 
        listener,
        );

    // Create the HTTP API with the integration
    this.httpApi = new apigwv2.HttpApi(this, `HttpApi-${props.stageName}`, {
      defaultIntegration: albIntegration,
    });

My theories are

  1. A VPC Link is needed and the listener object is insufficient.
  2. Some parameters are needed to ensure that API Gateway does not modify responses
  3. Some other explanation

HttpApi HttpAlbIntegration

Can I get clarification and cause/resolution here and proper usage of HttpAlbIntegration?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744628705a4584730.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信