custom-domains/both-declared/template.yaml [1:36]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Custom Domain

Parameters:
  DomainName:
    Type: String
    Description: Domian name for api
  ZoneId:
    Type: String
    Description: Zone ID if exists. If not leave as none.
    Default: none
  CertArn:
    Type: String
    Description: Certificate ARN if exists. If not leave as none.
    Default: none

Conditions:
  CreateZone:
    !Equals [!Ref ZoneId, 'none']
  CreateCert:
    !Equals [!Ref CertArn, 'none']

Resources:
  GeneratedZone: # If a Zone ID is not passed in the parameteres, then a new zone is created for the domain
    Type: AWS::Route53::HostedZone
    Condition: CreateZone
    Properties: 
      Name: !Ref DomainName

  GeneratedCert: # If a Certificate ARN is not passed in the parameters, then a new cert is created and will required validation during the deploy
    Type: AWS::CertificateManager::Certificate
    Condition: CreateCert
    Properties: 
      DomainName: !Ref DomainName
      ValidationMethod: DNS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



custom-domains/both-implied/template.yaml [1:36]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Custom Domain

Parameters:
  DomainName:
    Type: String
    Description: Domian name for api
  ZoneId:
    Type: String
    Description: Zone ID if exists. If not leave as none.
    Default: none
  CertArn:
    Type: String
    Description: Certificate ARN if exists. If not leave as none.
    Default: none

Conditions:
  CreateZone:
    !Equals [!Ref ZoneId, 'none']
  CreateCert:
    !Equals [!Ref CertArn, 'none']

Resources:
  GeneratedZone: # If a Zone ID is not passed in the parameteres, then a new zone is created for the domain
    Type: AWS::Route53::HostedZone
    Condition: CreateZone
    Properties: 
      Name: !Ref DomainName

  GeneratedCert: # If a Certificate ARN is not passed in the parameters, then a new cert is created and will required validation during the deploy
    Type: AWS::CertificateManager::Certificate
    Condition: CreateCert
    Properties: 
      DomainName: !Ref DomainName
      ValidationMethod: DNS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



