gpt4 book ai didi

aws-api-gateway - 使用 CloudFormation 的 API 网关的自定义域

转载 作者:行者123 更新时间:2023-12-03 17:35:53 25 4
gpt4 key购买 nike

我正在尝试使用 CloudFormation 为 API 网关定义自定义域(实际上是子域)。根据所有文档,我发现以下内容应该有效,但是当我部署它时,我为 BasePathMapping

指定了 无效的域名标识符
aws cloudformation deploy --template-file packaged-prompt.yaml --capabilities CAPABILITY_IAM --stack-name prompt-stack

提示.yaml

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:

...

Certificate:
Type: 'AWS::CertificateManager::Certificate'
Properties:
DomainName: example.mydomain.com

DomainName:
Type: 'AWS::ApiGateway::DomainName'
Properties:
CertificateArn: !Ref Certificate
DomainName: example.mydomain.com

Mapping:
Type: 'AWS::ApiGateway::BasePathMapping'
Properties:
DomainName: !Ref DomainName
RestApiId: !Ref Api

Api:
Type: AWS::Serverless::Api
Properties:
StageName: prod
DefinitionBody:
swagger: 2.0
info:
title:
Ref: AWS::StackName
paths:

....

最佳答案

BasePathMapping 中的属性丢失

BasePath: ""

关于aws-api-gateway - 使用 CloudFormation 的 API 网关的自定义域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48198261/

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