can we create route53 using aws cloudformation template,

0

Hi Team, i'm not able to able to create route53 using aws cloudformation template , but i'm able to create the records for an existing route53

2개 답변
0

What do you mean by not able to create Route53? Are you trying to create hosted zone?

답변함 2년 전
0

To create records for a Route53 Zone you need to use a RecordSet

Example:

Resources:
  myDNSRecordHostedZone: 
    Type: "AWS::Route53::HostedZone"
    Properties: 
      HostedZoneConfig: 
        Comment: 'My hosted zone for example.com'
      Name: 'example.com'

  Ec2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
  myDNSRecord:
    Type: AWS::Route53::RecordSet
    Properties:
      HostedZoneName: !Ref 'myDNSRecordHostedZone' <<<< Passing Reference to R53 Hosted Zone.
      Comment: DNS name for my instance.
      Name: !Join ['', [!Ref 'Ec2Instance', ., !Ref 'AWS::Region', ., !Ref 'myDNSRecordHostedZone', .]] 
      Type: A
      TTL: 900
      ResourceRecords:
      - !GetAtt Ec2Instance.PublicIp
AWS
답변함 2년 전

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

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

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

관련 콘텐츠