因此,我在托管在EC2实例上并与gunicorn一起使用的RESTFUL Flask API之前设置了一个AWS API网关,但这给了我一个非常丑陋的终结点,请问有什么方法可以将其应用于自定义网址?
我已获得此网址https://123x123x.execute-api.eu-west-2.amazonaws.com/myendpoint/
我想要一个像https://myurl.net/myendpoint
答案 0 :(得分:2)
简短的答案是:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCloudFrontUpdateDistribution",
"Effect": "Allow",
"Action": [
"cloudfront:updateDistribution"
],
"Resource": [
"*"
]
}
]
}
https://123x123x.execute-api.eu-west-2.amazonaws.com/myendpoint/
myurl.net
域创建一个自定义DNS名称a1b2c3d4e5f6.cloudfront.net
此处详细介绍了来自AWS的更长的答案:https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html
注意:还可以使用AWS API Gateway REST API:https://docs.aws.amazon.com/apigateway/api-reference/link-relation/domainname-create/
在很大程度上进行管理