Skip to content

Instantly share code, notes, and snippets.

@mdlavin
Created January 23, 2021 20:37
Show Gist options
  • Save mdlavin/06de73a6cb75daaa58b79a855c7b5b49 to your computer and use it in GitHub Desktop.
Save mdlavin/06de73a6cb75daaa58b79a855c7b5b49 to your computer and use it in GitHub Desktop.
Amplify custom auth domain template.yml
AWSTemplateFormatVersion: 2010-09-09
Parameters:
env:
Type: String
authCognitoResourceUserPoolId:
Type: String
Mappings:
CustomAuthDomains:
master:
domain: auth.app.yourdomain.com
Conditions:
CreateCustomAuthDomain: !Equals
- master
- !Ref env
Resources:
CustomDomainCert:
Condition: CreateCustomAuthDomain
Type: AWS::CertificateManager::Certificate
Properties:
DomainName: !FindInMap
- CustomAuthDomains
- !Ref env
- domain
ValidationMethod: DNS
AuthDomain:
Type: AWS::Cognito::UserPoolDomain
Condition: CreateCustomAuthDomain
Properties:
Domain: !FindInMap
- CustomAuthDomains
- !Ref env
- domain
UserPoolId: !Ref authCognitoResourceUserPoolId
CustomDomainConfig:
CertificateArn: !Ref CustomDomainCert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment