Custom domain name with customer-managed CDN using Edge Key — AEMaaCS
by Imran Khan
Overview
Integrate custom domain name to an AEM as a Cloud Service website using CDE Edge Key.
As part of this blog we will configure and integrate custom domain name(client managed) to an AEM as a Cloud Service website using customer managed option using Adobe Cloud Manager.
A Customer Managed CDN (Content Delivery Network) is a setup in which the customer — either an organization or an individual user — assumes full responsibility for configuring, operating, and maintaining the CDN infrastructure, rather than depending entirely on a fully managed service such as Cloudflare, Akamai, or AWS CloudFront.
TheX-AEM-Edge-Keyis an HTTP header used by the Adobe CDN to validate requests originating from a Customer-Managed CDN.
Overall Process:
The AEM development team generates a CDN Edge Key and configures it in the Adobe Cloud Manager environment.
Incoming requests from a Customer-Managed CDN include the X-AEM-Edge-Key header containing the Edge Key value.
Site to validate the incoming request by verifying the Edge Key before allowing it to reach the AEM origin.
Implementation Approach:
There are three major steps require to create, configure and integrate customer managed custom domain with AEM as a cloud service website.
Ask customer / client to create and share custom domain. name e.g. javadoubts.com
Configure / implement CDN edge key on AEM as a cloud service website.
CDN team to configure Akamai CDN Edge key and X-Forwarded-Host header.
Implementation:
Custom Domain Name Creation
As part of this step customer suppose to create custom domain name and share with AEM development team.
In parallel, AEM development team to add this domain as part of dispatcher configuration to allow it as a host.
Configure / Implement CDN Edge Key
This step is mandatory and is fully executed by the AEM development team.
Follow the steps below to create a CDN Edge key and share it with the CDN/Akamai team:
In the root folder of the codebase, create the following configuration folder, and then create a cdn.yaml file within it.
envTypes:Having list of environments where CDN Edge Key implementation will be applied.
CDN_EDGEKEY_1andCDN_EDGEKEY_2are CDN Edge Key configuration variables that will be created directly in Adobe Cloud Manager.
CDN_EDGEKEY_2 is a rotation key used to replace earlier CDN Edge key which isCDN_EDGEKEY_1.
Add CDN Edge Key using Adobe Cloud Manager
Go to the Adobe Cloud Manager, select program and than environment to configure CDN Edge Key.
Click onAdd Configurationbutton to add configuration / CDN Edge Key
Click on Add button to add bothCDN_EDGEKEY_1andCDN_EDGEKEY_2Akamai CDN edge keys.
Provide a strong custom number as a value forCDN_EDGEKEY_1andCDN_EDGEKEY_2keys.
Select All as an option for Service Applied and Secret as a variable type.
Click onSavebutton to Save configurations.
Follow above process to addCDN_EDGEKEY_1andCDN_EDGEKEY_2keys for all of the available environments. e.g. DEV, QA, STAGE, PROD, etc.
QA:
CDN_EDGEKEY_1 =
CDN_EDGEKEY_2 =
STAGE:
CDN_EDGEKEY_1 =
CDN_EDGEKEY_2 =
PROD:
CDN_EDGEKEY_1 =
CDN_EDGEKEY_2 =
CDN Edge Key Code Deployment
Create a separate deployment pipeline to deployconfigchanges created as part of above steps:
Select Git branch having config changes and provideconfigas a root folder shown below:
Important Note:
Do not give build or deploy CDN Edge Key code changes to any of the environment as it will break the environment until the changes are done from Akamai / CDN team side as part of next subsequent step.
Configure CDN Edge key and X-Forwarded-Host
Request Akami team to follow below step by step process to setup CDN EDGE Akamai Key:
Share earlier created EDGE keys with akamai team for QA/STGAE/PROD environments and there no further action required from AEM development team side.
2. Akamai team to add/configure AEM Server Origin Hostname as shown below:
3. Add X-AEM-Edge-Key and X-Forwarded-Host as an header with required values.
Amazon CloudFront Configurations:
Cloudflare Configurations:
Testing:
Deploy CDN Edge Key changes with the help of Adobe Cloud manager once above changes are done from Akami CDN team side.
Hitting domain must load the website. If not, check the headers.
Q&A
Please use this thread to ask questions relating to this article