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 年前檢視次數 2099 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南