amazon-web-services - 指定的域名标识符无效

标签 amazon-web-services aws-api-gateway aws-cloudformation

尝试通过 CloudFormation 创建 AWS::ApiGateway::BasePathMapping 时,出现以下错误:

Invalid domain name identifier specified

下面是我的 CloudFormation 模板中应创建 AWS::ApiGateway::BasePathMapping 的部分:

{
    "Parameters": {
        "ApiDomainName": {
            "Description": "The domain name for the API",
            "Type": "String"
        }
    },
    "Resources": {
        "ApiBasePathMapping": {
            "Type": "AWS::ApiGateway::BasePathMapping",
            "Properties": {
                "DomainName": {
                    "Ref": "ApiDomainName"   
                },
                "RestApiId": {
                    "Ref": "RepositoryApi"
                },
                "Stage": {
                    "Ref": "ApiProductionStage"
                }
            },
            "DependsOn": [
                "ApiProductionStage"
            ]
        }
    }
}

documentation没有提到它需要对 DomainName 有任何特殊之处,但该资源的文档似乎缺少一些信息(例如,它没有列出输出,即使有 分发域名作为示例创建)。

堆栈的其余部分按预期工作。我正在尝试将此资源添加为更改集。我确实拥有我尝试使用的域,并且我已在 ACM 中为此域创建了证书。

最佳答案

引自AWS论坛:

You can only create or modify base path mappings after the domain name has been added to API Gateway. This "Invalid domain name identifier specified" error message is returned when the domain name given in the base path mapping is not found, indicating that it has not been added yet.

此外,自 2017 年 3 月起,通过 CloudFormation 将域名添加到 API 网关的唯一方法是通过 CloudFormation 提供的自定义资源。

引用号:https://forums.aws.amazon.com/message.jspa?messageID=769627

关于amazon-web-services - 指定的域名标识符无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43924140/

相关文章:

用于交互式社区网站的 PHP 或 Ruby on Rails?

amazon-web-services - AWS API Gateway删除响应 header

json - API 网关 : JSON 5+ MB Gives error "413, Request Too Long"

amazon-web-services - 自定义授权方 AWS CDK

amazon-web-services - 在 SAM 项目中部署 lambda 时如何忽略冗余文件

aws-cloudformation - CDK 中留空时设置 CfnParameter 的默认值

amazon-web-services - "Python"中的欧拉计划#2

amazon-web-services - AWS CloudFormation 和函数声明

amazon-web-services - CloudFormation,在 DependsOn 上应用条件

python-3.x - 如何使用 Python(Boto lib)获取 Amazon S3 存储桶的大小?