App Builder Configuration Files
Overview
An app has three configuration files, defined in the root of the project folder:
app.config.yaml
is the main configuration file, defining the application's behavior and implementation..env
is used to store secrets and environment variables available during build time..aio
is populated by theaio
CLI to store the current Developer Console Workspace details.
Note: .env
and .aio
files should not be committed to version control.
app.config.yaml
Tl;dr: give me a full example:
Copied to your clipboard# standalone application configapplication:hostname: 'customhost'runtimeManifest:packages:application-pkg:actions:count-apples:function: actions/count-apples/index.jsweb: 'yes'runtime: nodejs:18annotations:require-adobe-auth: truehooks:post-app-build: 'echo hook'# extension points configextensions:dx/excshell/1:# $include directive stores config in a separate file$include: ./dx-excshell-1/ext.config.yamldx/asset-compute/worker/1:operations:workerProcess:- type: actionimpl: dx-asset-compute-worker-1/myworkerruntimeManifest:packages:dx-asset-compute-worker-1:actions:myworker:function: actions/worker/index.jsweb: 'yes'runtime: nodejs:18# public distribution only - customer configurationconfigSchema:title: 'the title'description: 'the description'properties:- title: 'Slack Webhook'type: 'string'description: 'Please provide the webhook used by this application. Configure in slack.com'envKey: 'SLACK_WEBHOOK'# public distribution only - required productsrequiredProducts:- code: AEPminVersion: 0.0.0maxVersion: 1.0.0
Standalone application and extensions
The app.config.yaml
file can contain two top level fields: application
and extensions
.
Only one is required.
Copied to your clipboard# app.config.yamlapplication:<common-config>extensions:<extension-type>:<extension-definition><common-config>
A project can implement a standalone application and N extensions.
Common configuration
Extensions and the standalone application behave in a similar way. Both can contain a UI and actions and both support a common configuration. The common configuration contains following fields:
Copied to your clipboard# <common-config>runtimeManifest:<runtime-manifest>hooks:<app-hooks>actions: <path to action folder>web: <path to web folder>unitTest: <path to unit test folder>e2eTest: <path to e2e test folder>dist: <path to build output folder>htmlCacheDuration: <cache duration for UI .html files, default: 60s>jsCacheDuration: <cache duration for UI .js files, default: about a week>cssCacheDuration: <cache duration for UI .css files, default: about a week>imageCacheDuration: <cache duration for UI image (.jpg, .png, .gif, etc.) files, default: about a week>tvmurl: <alternative tvm url used to upload the UI>awsaccesskeyid: <upload UI to own s3, provide credentials>awssecretaccesskey: <upload UI to own s3, provide credentials>s3bucket: <upload UI to own s3, provide credentials>hostname: <alternative hostname for the UI>
Runtime Manifest
The runtimeManifest
field holds the backend configuration deployed into Adobe I/O Runtime.
The full spec can be found here. Acceptable values for the limits
fields below can be found on the Runtime System Settings page.
Here is an example to get started:
Copied to your clipboardruntimeManifestpackages:myapp:license: Apache-2.0actions:generic:# path relative to the configuration filefunction: src/myapp/actions/generic/index.jsweb: 'yes'runtime: nodejs:18annotations:require-adobe-auth: truetarget:function: src/myapp/actions/target/index.jsweb: 'yes'runtime: nodejs:18limits:timeout: 60000memory: 512concurrency: 1logs: 10include:- ["myfilestoinclude/*.txt", "text/"]
Note that the above example also demonstrates the 'include' field of an action. In some cases you may want to have a file deployed with your action code, and available to your code when it runs. The example will copy all .txt files from the
myfilestoinclude/
directory and place it in a new dirtext/
that is available viafs.readFile('text/somefile.txt', 'utf8', callback);
when your action is invoked.
Note the above sets limit values. Limits are defined as:
concurrency
: the maximum number of action invocations to send to the same container in parallel (default 200, min: 1,max: 500)logs
: the maximum log size LIMIT in MB for the action (default 10, min: 0, max: 10)timeout
: the timeout LIMIT in milliseconds after which the action is terminated (default 60000, min: 100, max: 3600000)
- for web actions served from cdn there is a hard limit of 30 seconds for timeout
memory
: the maximum memory LIMIT in MB for the action (default 256, min: 128, max: 4096)
- setting distinct values (ex. 671) can impact cold starts as Runtime keeps a number of pre-warmed containers, but only for common memory sizes (128, 256, 512, 1024, etc.)
More info on
limits
can be found on the Runtime System Settings page.
Annotations
Runtime actions can be decorated with annotations to enhance or modify action behavior.
Copied to your clipboardruntimeManifest:packages:myapp:license: Apache-2.0actions:generic:annotations:require-adobe-auth: truedisable-download: true
In addition to the base annotations provided by Runtime (See here), there are a few special annotations:
- disable-download (Default: false) - Determines whether action code can be downloaded. Once this annotation is set to true, it cannot be set back to false.
- require-adobe-auth (Default: false) - Determines whether the action will require Adobe authentication to invoke. See here for more.
API Gateway Configuration
A Runtime API Gateway configuration can be added to expose web actions over specific paths and HTTP verbs.
Note: It can take 5 to 10 minutes for new gateway configurations to provision. In the meantime, you may see 404 errors from your API.
Copied to your clipboardruntimeManifest:packages:petsapp:license: Apache-2.0actions:get-pets: # Note the name of the actionfunction: actions/get-pets/index.jsweb: 'yes'runtime: nodejs:18get-pet: # Note the name of the actionfunction: actions/get-pet/index.jsweb: 'yes'runtime: nodejs:18apis:get-pets: # API Namev1: # Base Pathpets: # Relative Pathget-pets: # Name of the action to connect this path tomethod: getresponse: httpget-pet: # API Namev1: # Base Pathpets/{petName}: # Relative Path, with a path parameterget-pet: # Name of the action to connect this path tomethod: getresponse: http
Note: The configuration above will result in the following:
GET https://adobeioruntime.net/apis/[namespace]/v1/pets
GET https://adobeioruntime.net/apis/[namespace]/v1/pets/{petName}
Note: The second API above defines a path parameter in the relative path by using curly braces, i.e
pets/{petName}
- APIs using path parameters must use the
http
response type
- The following options are available for
method
: get, post, put, delete, patch - The following options are available for
response
: http (default), json, text, or html
Learn more about API Gateway Configuration with the Action APIs QuickStart
Hooks to customize the tooling
Hooks can be used to customize aio app
commands. Hooks are documented here.
Extension specific configuration
Extension types
The <extension-type>
indicates which product the extension is extending, currently we support the following product extensions:
dx/excshell/1
to implement an Experience Cloud Shell single page application.dx/asset-compute/worker/1
to implement an AEM Asset Compute worker.
dx/excshell/1
definition
The Experience Cloud Shell extension supports a view
operation that points to the entry html file of the SPA.
In the following example the impl
field points to an index.html
file stored in the web/
folder of the extension.
Copied to your clipboardextensionsdx/excshell/1:operations:view:- type: webimpl: index.htmlweb-src: web/
dx/asset-compute/worker/1
definition
The AEM Asset Compute worker extension supports a workerProcess
operation that points to the backend Adobe I/O Runtime action implementing the worker logic.
In the following example the impl
field points to the dx-asset-compute-worker-1/worker
action defined in the runtimeManifest
.
Copied to your clipboardextensionsdx/asset-compute/worker/1:operations:workerProcess:- type: actionimpl: dx-asset-compute-worker-1/myworkerruntimeManifest:packages:dx-asset-compute-worker-1:actions:myworker:function: actions/worker/index.jsweb: 'yes'runtime: nodejs:18
The $include
directive
The $include
directive allows to defer any part of the app.config.yaml
to another file.
In the following example, the dx/excshell/1
configuration is stored in another ./src/dx-excshell-1/ext.config.yaml
file.
Copied to your clipboardextensions:dx/excshell/1:$include: ./src/dx-excshell-1/ext.config.yaml
Configuration paths defined in ./src/dx-excshell-1/ext.config.yaml
must be relative to that file.
Public distribution configuration
A subset of configuration options are specific to publicly distributable apps. See the Public Distribution guide for more details.
Copied to your clipboardconfigSchema:title: 'the title'description: 'the description'properties:- title: 'Slack Webhook'type: 'string'description: 'Please provide the webhook used by this application. Configure in slack.com'envKey: 'SLACK_WEBHOOK'requiredProducts:- code: AEPminVersion: 0.0.0maxVersion: 1.0.0
.env
The .env
file is used to store:
- secrets to be injected into I/O Runtime Actions.
- environment variables available to
hooks
. - auto generated secrets used by the
aio
CLI, prefixed byAIO_
, those should not be edited.
Copied to your clipboard# User secretsENABLE_DEV_DEBUG=true# Auto-generated secretsAIO_runtime_namespace=AIO_runtime_auth=AIO_runtime_apihost=
Using environment variables in frontend
Environment variables set in .env can be accessed directly via process.env
:
Copied to your clipboard<View showDevDebugOverlay={process.env.ENABLE_DEV_DEBUG}></View>
Using environment variables in Runtime actions
Environment variables set in .env need to be passed as inputs to an action and then are available via the action parameters.
app.config.yaml
Copied to your clipboardruntimeManifest:packages:myapp:actions:generic:function: src/myapp/actions/generic/index.jsweb: 'yes'runtime: nodejs:18inputs:ENABLE_DEV_DEBUG: $ENABLE_DEV_DEBUG
Action code
Copied to your clipboardasync function main (params) {if (params.ENABLE_DEV_DEBUG) {console.debug("Enabling dev tools, extra usage data will be captured...")}}exports.main = main
.aio
The .aio
file is auto generated and contains Developer Console specific configuration.
This file is updated via the aio app use
command and should not be edited manually.
Legacy configuration system
Apps initialized using a @adobe/aio-cli
CLI version prior to 8.x use a legacy configuration system that we still support in newer CLI versions.
Those apps do not support extensions, and only get deployed as standalone applications.
The legacy configuration system does not have an app.config.yaml
and instead uses:
.aio
to store common configuration bits, but hooks and Runtime Manifest, such asactions
path.manifest.yaml
to stores the Runtime Manifest.package.json
to store hooks..env
behaves the same.
Migrating between Standalone Application and DX Experience Cloud SPA v1
- Standalone Application to DX Experience Cloud SPA v1 - Useful if you can't seem to view your application in the App Builder Catalog in Adobe Experience Cloud.