Overview
AEM as a Cloud Service offers the following advanced networking options:
- Flexible port egress - Configure AEM as a Cloud Service to allow outbound traffic out of non-standard ports.
- Dedicated egress IP address - Configure traffic out of AEM as a Cloud Service to originate from a unique IP.
- Virtual Private Network (VPN) - Secure traffic between your infrastructure and AEM as a Cloud Service, if you have a VPN.
This article describes each of these options in detail and why you might use them, before describing how they are configured using the Cloud Manager UI and by using the API. The article concludes with some advanced use cases.
Requirements and Limitations
When configuring advanced networking features, the following restrictions apply.
-
A program can provision a single advanced networking option (flexible port egress, dedicated egress IP address, or VPN).
-
Advanced networking is not available for sandbox programs.
-
A user must have the Administrator role to add and configure network infrastructure in your program.
-
The production environment must be created before network infrastructure can be added in your program.
-
Your network infrastructure must be in the same region as your production environment’s primary region.
- In the case where your production environment has extra publish regions, you may create another network infrastructure mirroring each additional region.
- You are not allowed to create more network infrastructures than the maximum number of regions configured in your production environment.
- You can define as many network infrastructures as available regions in your production environment, but the new infrastructure must be the same type as the previously created infrastructure.
- When creating multiple infrastructures, you are permitted to select from only those regions in which advanced networking infrastructure has not been created.
Configuring and Enabling Advanced Networking
Using advanced networking features requires two steps:
- Configuration of the advanced networking option, whether flexible port egress, dedicated egress IP address, or VPN, must first be done at the program level.
- To be used, the advanced networking option must then be enabled at the environment level.
Both steps can be done either using the Cloud Manager UI or the Cloud Manager API.
-
When using the Cloud Manager UI, this means creating advanced network configurations using a wizard at the program level and then editing each environment where you want to enable the configuration.
-
When using the Cloud Manager API, the
/networkInfrastructures
API endpoint is invoked at the program level to declare the desired type of advanced networking. It is followed by a call to the/advancedNetworking
endpoint for each environment to enable the infrastructure and configure environment-specific parameters.
Flexible Port Egress
This advanced networking feature lets you configure AEM as a Cloud Service to egress traffic through ports other than HTTP (port 80) and HTTPS (port 443), which are open by default.
UI Configuration
-
Log into Cloud Manager at my.cloudmanager.adobe.com and select the appropriate organization.
-
On the My Programs console, select the program.
-
From the Program Overview page, navigate to the Environments tab and select Network Infrastructure in the left panel.
-
In the Add network infrastructure wizard, select Flexible port egress.
-
From the Region drop-down menu, choose the desired region, then click Continue.
-
The Confirmation tab summarizes your selection and the next steps. Click Save to create the infrastructure.
A new record appears below the Network Infrastructure heading in the side panel. It includes details such as the type of infrastructure, status, region, and the environments where it is enabled.
API Configuration
Once per program, the POST /program/<programId>/networkInfrastructures
endpoint is invoked, simply passing the value of flexiblePortEgress
for the kind
parameter and region. The endpoint responds with the network_id
, and other information including the status.
Once called, it typically takes approximately 15 minutes for the networking infrastructure to be provisioned. A call to the Cloud Manager’s network infrastructure GET endpoint would show a status of ready.
Traffic Routing
For http or https traffic going to ports other than 80 or 443 a proxy should be configured using the following host and port environment variables:
- for HTTP:
AEM_PROXY_HOST
/AEM_HTTP_PROXY_PORT
(default toproxy.tunnel:3128
in AEM releases < 6094) - for HTTPS:
AEM_PROXY_HOST
/AEM_HTTPS_PROXY_PORT
(default toproxy.tunnel:3128
in AEM releases < 6094)
For example, here’s sample code to send a request to www.example.com:8443
:
String url = "www.example.com:8443"
String proxyHost = System.getenv().getOrDefault("AEM_PROXY_HOST", "proxy.tunnel");
int proxyPort = Integer.parseInt(System.getenv().getOrDefault("AEM_HTTPS_PROXY_PORT", "3128"));
HttpClient client = HttpClient.newBuilder()
.proxy(ProxySelector.of(new InetSocketAddress(proxyHost, proxyPort)))
.build();
HttpRequest request = HttpRequest.newBuilder().uri(URI.create(url)).build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
If using non-standard Java™ networking libraries, configure proxies using the properties above, for all traffic.
Non-http/s traffic with destinations through ports declared in the portForwards
parameter should reference a property called AEM_PROXY_HOST
, along with the mapped port. For example:
DriverManager.getConnection("jdbc:mysql://" + System.getenv("AEM_PROXY_HOST") + ":53306/test");
The table below describes traffic routing:
Non-standard traffic (on other ports outside 80 or 443) through http proxy configured using the following environment variable and proxy port number. Do not declare the destination port in the Cloud Manager API call's portForwards parameter:
- AEM_PROXY_HOST (default to `proxy.tunnel` in AEM releases < 6094)
- AEM_HTTPS_PROXY_PORT (default to port 3128 in AEM releases < 6094)
AEM_PROXY_HOST
environment variable using a portOrig
declared in the portForwards
API parameter.mysql.example.com:3306
db.example.com:5555