--- AWSTemplateFormatVersion: 2010-09-09 Description: Reference Architecture to host Moodle on AWS - Creates Route 53 record set (if selected) Metadata: AWS::CloudFormation::Interface: ParameterGroups: - Label: default: Route 53 Parameters Parameters: - DomainName - HostedZoneName - DnsEndpoint - DnsHostId ParameterLabels: DnsEndpoint: default: DNS Endpoint DnsHostId: default: DNS Host Id DomainName: default: Domain Name of the Moodle site HostedZoneName: default: Hosted Zone Name Parameters: DnsEndpoint: AllowedPattern: ^(?!http)(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$ Description: The DNS endpoint - CloudFront DNS if using CloudFront else Public ALB DNS name. Type: String DnsHostId: AllowedPattern: ^[A-Z0-9]+$ Description: The DNS host zone id - 'Z2FDTNDATAQYW2' if using CloudFront else Public ALB host zone id. Type: String HostedZoneName: AllowedPattern: ^(?!http)(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$ Description: The main Route 53 hosted zone (e.g. example.edu). Type: String DomainName: AllowedPattern: ^(?!http)(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$ Description: The main domain name of the Moodle site (e.g. moodle.example.edu). Type: String Resources: RecordSet: Type: AWS::Route53::RecordSetGroup Properties: HostedZoneName: !Join ['', [!Ref HostedZoneName, '.']] RecordSets: - Name: !Join ['', [!Ref DomainName, '.']] Type: A AliasTarget: DNSName: !Ref DnsEndpoint EvaluateTargetHealth: True HostedZoneId: !Ref DnsHostId