gpt4 book ai didi

amazon-web-services - 使用 CloudFormation 为 APIGateway 提供适当的子域

转载 作者:行者123 更新时间:2023-12-03 07:16:14 25 4
gpt4 key购买 nike

我有一个 APIGateway 正在工作,有一些 lambda 函数支持它,其余的都在工作。

现在我需要将 APIGateway 锁定到我的域。想象一下,我拥有域名 www.example.com,并且我希望对 foobar.example.com 的所有调用都在我的 APIGateway 上结束。

我需要使用 CloudFormation 创建哪些资源才能获得此资源?

示例模板将受到高度赞赏。

最佳答案

您需要通过 CLI、SDK 或控制台在 API Gateway 上创建带有 foobar.example.com 的自定义域,因为 CloudFormation 目前不支持它。然后,您可以在 CloudFormation 模板中为自定义域创建基本路径映射。

{
"Type" : "AWS::ApiGateway::BasePathMapping",
"Properties" : {
"BasePath" : String,
"DomainName" : String,
"RestApiId" : String,
"Stage" : String
}
}

关于amazon-web-services - 使用 CloudFormation 为 APIGateway 提供适当的子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39389248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com