Gothic Framework G symbol

Domain: Custom Region infrastructure

At present, deploying your functions in regions other than us-east-1, while also creating the ACM certificate in us-east-1 within the same template, is not straightforward. For the Route 53 A record to work and for the CloudFormation CDN to have an alias domain, the ACM certificate must be created in the us-east-1 region.

If you want to create your infrastructure in another region, such as eu-central-1 (Central Europe), you will need to manually create your ACM certificate in the AWS console and reference it in gothic-config.json as an ARN value (we recommend storing it in Parameter Store).

Although this limitation may not be an issue for most use-cases since you can optimize your websites with CDN caching for pages and components, some scenarios may require the infrastructure to be deployed in a specific region.

Here’s an example of how to do it. First, you change your region in your gothic-config.json , then create your certificate for your domain in the us-east-1 region and validate it in your Route 53 hosted zone. For last, add your ACM certificate ARN to SSM and include this in your gothic-config.json.

{
 	"projectName" : "gothic-example" ,
 	"goModuleName" : "github.com/felipegenef/gothicframework/v2" ,
 	"optimizeImages" : {
 		"lowResolutionRate" :  20 ,
 	 }
 	"deploy" : {
 		"serverMemory" :  128 ,
 		"serverTimeout" :  30 ,
 		"region" :  "eu-central-1" ,
 		"customDomain" :  true ,
 		"profile" :  "default" ,
 		"stages" : {
 			"dev" : {
 				"hostedZoneId" :  "{{resolve:ssm:/gothicframework/dev/hostedZoneId}}" ,
 				"customDomain" :  "dev.mycustomDomain.com" ,
 				"certificateArn" :  "{{resolve:ssm:/gothicframework/dev/certificateArn}}" ,
 				"wafArn" :  null ,
 				"env" : {}
 			}
 		}
 	}
 } 

Did you like this session for deploy your domain with a custom region? Check out how to deploy your app with custom environment variables per stage!