aws / apprunner-roadmap

This is the public roadmap for AWS App Runner.
https://aws.amazon.com/apprunner/
Other
298 stars 14 forks source link

How can I expose private app runner services using api gateway. #193

Open akhil-ph opened 1 year ago

akhil-ph commented 1 year ago

I have few app runner services that I want to expose via api gateway, How can I achieve that!!

I trying following the solution no.2 mentioned in this comment. but I was not able to make it work.

I will explain what I did here:

when I hit the apigateway url, I was not proxied to app runner service. am I missing something ?

also it the above mentioned comment, that person said we can reuse these supporting non app runner resources for running multiple private app runner services.

please help!!!

shyamrock commented 1 year ago

Hi Did you get this resolve, I plan to do a similar setup.

fehimaltinisik commented 1 year ago

Hi @akhil-ph

Any news here? I also plan to do a similar setup.

jplock commented 1 year ago

Is the target group showing as healthy?

filipponova commented 10 months ago

I have same problem, I follow this AWS official tutorial video https://www.youtube.com/watch?v=H5OKe8jXnX0&list=PLMs16T14YDqhokZkF7PFW89EfOGYuGwmp&index=, but not works for me. The api gateway tests return HTTP 500, and I don't see any traffic or logs in apprunner service or NLB metrics.

Execution log for request 97adf511-639b-4d47-b3fc-e501499f2f55 Sun Dec 03 17:30:04 UTC 2023 : Starting execution for request: 97adf511-639b-4d47-b3fc-e501499f2f55 Sun Dec 03 17:30:04 UTC 2023 : HTTP Method: GET, Resource Path: / Sun Dec 03 17:30:04 UTC 2023 : Method request path: {} Sun Dec 03 17:30:04 UTC 2023 : Method request query string: {} Sun Dec 03 17:30:04 UTC 2023 : Method request headers: {} Sun Dec 03 17:30:04 UTC 2023 : Method request body before transformations: Sun Dec 03 17:30:04 UTC 2023 : Endpoint request URI: https://example.us-east-1.awsapprunner.com/ Sun Dec 03 17:30:04 UTC 2023 : Endpoint request headers: {x-amzn-apigateway-api-id=k90ul4ho11, User-Agent=AmazonAPIGateway_k90ul4ho11, Host=example.us-east-1.awsapprunner.com} Sun Dec 03 17:30:04 UTC 2023 : Endpoint request body after transformations: Sun Dec 03 17:30:04 UTC 2023 : Sending request to https://example.us-east-1.awsapprunner.com/ Sun Dec 03 17:30:14 UTC 2023 : Execution failed due to configuration error: There was an internal error while executing your request Sun Dec 03 17:30:14 UTC 2023 : Method completed with status: 500

filipponova commented 10 months ago

I've solved my problem. The problem it was a loadbalancer security option "Enforce inbound rules on PrivateLink traffic", this setting needs to be disabled.

More details: https://repost.aws/knowledge-center/api-gateway-500-error-vpc?sc_channel=sm&sc_campaign=Support&sc_publisher=YOUTUBE&sc_country=global&sc_geo=GLOBAL&sc_outcome=AWS%20Support&sc_content=Support&trk=Support&linkId=246337659

https://www.google.com/search?q=Enforce+inbound+rules+on+AWS+PrivateLink&rlz=1C5CHFA_enBR1072BR1073&oq=Enforce+inbound+rules+on+AWS+PrivateLink&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIHCAIQIRigAdIBBzU2NGowajGoAgCwAgA&sourceid=chrome&ie=UTF-8

hariohmprasath commented 9 months ago

Hi @filipponova, Thanks for reaching out. We are currently working on a blog to publish the guidelines on integrating an private App Runner service with API Gateway, will update the link once the blog gets officially published. thanks

cwensel commented 7 months ago

@hariohmprasath was this ever posted?

I'm currently trying to put AppRunner behind an Interface VPC Endpoint (so that an API Gateway can see it), which requires the AppRunner instance to not be publicly accessible.

[updated] removed irrelevant error

akvadrako commented 2 months ago

@cwensel Did that work?

cwensel commented 2 months ago

@akvadrako yes

https://chris.wensel.net/post/api-gateway-with-app-runner/

akvadrako commented 2 months ago

Hum, thanks for the write-up. I'm not so sure about relying on the interfaces being a static list with static IPs, especially if the apps get re-deployed or scaled.

Have you been running this way for a while, with scaling and re-deploys?

cwensel commented 2 months ago

good question.

we've had no issues to date with redeployments of updated images.

as for scaling, no issues so far, doesn't mean we won't. thanks for pointing this one out.