Amazon web services AWS中具有不一致性的BaseUrl映射

Amazon web services AWS中具有不一致性的BaseUrl映射,amazon-web-services,aws-lambda,Amazon Web Services,Aws Lambda,我正在使用yaml为api网关创建自定义域。这是我的yaml样品 TestAppApi: Type: AWS::Serverless::Api Properties: StageName: !Ref ApiStageName EndpointConfiguration: REGIONAL TracingEnabled: TRUE MethodSettings: - LoggingLevel: INFO

我正在使用yaml为api网关创建自定义域。这是我的yaml样品

TestAppApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: !Ref ApiStageName
      EndpointConfiguration: REGIONAL
      TracingEnabled: TRUE
      MethodSettings:
        - LoggingLevel: INFO
          ResourcePath: "/*" # allows for logging on any resource
          HttpMethod: "*" # allows for logging on any method
          DataTraceEnabled: TRUE
      
  DomainName:
    Type: AWS::ApiGateway::DomainName
    Properties:
      RegionalCertificateArn: !Ref Certificate
      DomainName: !Ref ApiDomain
      SecurityPolicy: TLS_1_2
      EndpointConfiguration:
        Types:
          - REGIONAL
      
  UrlMapping:
    Type: AWS::ApiGateway::BasePathMapping
    DependsOn:
      - TestAppApiStage
      - DomainName
    Properties:
      DomainName:
        !Ref ApiDomain
      RestApiId:
        Ref: TestAppApi
      Stage: !Ref ApiStageName
  
  Domain:
    Type: AWS::Route53::RecordSetGroup
    DependsOn:
      - TestAppApi
      - UrlMapping
      - DomainName
    Properties:
      HostedZoneId: !Ref ApiDomainHostedZoneId
      RecordSets:
        - Name: !Ref ApiDomain 
          Type: A
          AliasTarget:
            DNSName: !GetAtt DomainName.RegionalDomainName
            HostedZoneId: !GetAtt DomainName.RegionalHostedZoneId
我将ApiDomain作为参数传递,当我的ApiDomain是'dev.test.com.au'时,它会按预期工作,其中test.com.au是我的注册域。但是,如果我将我的ApiDomain更改为类似“dev-$env:USERNAME.test.com.au”的内容,然后会出现以下错误

指定的域名标识符无效(服务:AmazonApiGateway;状态代码:404; 错误代码:NotFoundException;请求ID:fbf8ce40-cce0-4a0f-9714-c649d35a3ee4;代理:null)

显然,根据这个线程,这个错误与依赖性问题有关,但是它使用一个名称,而不是另一个名称。不管怎样,我已经添加了所有的依赖项,仍然是无效的域名标识符错误。
任何帮助都将不胜感激

您的域名中没有大写字母。我的ApiDomain参数有大写字母。域名创建会自动将其转换为小写字母。但是baseurlmapping只能找到带有大写字母的ApiDomain,因此存在问题。需要更清楚地阅读文档,但无论如何,如果有人遇到这个愚蠢的问题,请将其张贴在这里