How to configure record set for a custom domain name for a multi region api gateway?

0

I have created a hosted zone (resource type AWS::Route53::HostedZone) in aws with a custom domain name (example - numbero.uno.com)

customDomain:
  Type: AWS::Route53::HostedZone
  Properties:
     Name: 'numero.uno.com'

now i'm creating an api to be deployed to two regions, by deploying stack below to two regions. when i deploy stack below in one region everything works fine , but when i deploy the same stack in a second region , i get the error message, create failed for Mycustomdomainconfig => "The domain name you provided already exists. (service: ApiGateway, ...Status Code 400...

i'm trying to use same custom domain name for both api gateway endpoints deployed in two regions. can anyone see what i'm doing wrong here?

Resources: 
  MyCertificate: 
    Type: "AWS::CertificateManager::Certificate"
    Properties: 
      DomainName: example.com
      ValidationMethod: DNS
      DomainValidationOptions:
        - DomainName: 'numero.uno.com'
           HostedZoneId: 'afnqrejxyi'

Myrecord:
  Type: AWS::Route53::RecordSet
  Properties:
    Region: !Ref aws_region
    SetIdentifier: !Sub "endpoint-${aws_region}"
    HostedZoneId:  'afnqrejxyi'
    Name:  'numero.uno.com'
    Type: A
    AliasTarget:
      DNSname: !GetAtt  Mycustomdomainconfig.RegionalDomainName
      HostedZoneId: !GetAtt Mycustomdomainconfig.RegionalHostedZoneId
  
Mycustomdomainconfig:
  Type: AWS::ApiGateway::DomainName
  Properties:
    RegionalCertificationArn: !Ref MyCertificate
    DomainName: 'numero.uno.com'
    ...

MyApiMapping:
   Type: AWS::ApiGateway::BasePathMapping
   Properties:
     DomainName: !Ref Mycustomdomainconfig
     RestApiId: !Ref MyApi
     ...

MyApi:
   Type:  AWS::Serverless::Api
    Properties:
      ....


   
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠