The best way to handle optional services (e.g. services that exist in some environments but not in others) is to put them into their own components. This repository contains two of Architect's starter projects: a react frontend and a node backend.
The backend component contains only the information needed for itself to run, which in this case includes the service itself and a postgres database. The frontend component however contains both its runtime and a reference to the node-rest-api component via dependencies. This means that whenever the frontend is deployed to an environment, it will automatically deploy the node-rest-api backend or connect to an existing instance already in the environment.
$ architect dev ./node-rest-api
# This only has to be done once on your machine
$ architect link ./node-rest-api
# This will automatically deploy the node-rest-api since its cited as a dependency
$ architect dev ./react
$ architect env:create <my-environment> --account <my-account>
$ architect deploy ./node-rest-api --account <my-account> --environment <my-environment>
$ architect env:create <my-environment> --account <my-account>
$ architect deploy ./react --account <my-account> --environment <my-environment>
When running the second deploy command, Architect is smart enough to determine that the dependency already exists. The deployment will connect to the existing instance instead of deploying a new one.
$ architect env:create <my-environment> --account <my-account>
$ architect deploy ./node-rest-api --account <my-account> --environment <my-environment>
$ architect deploy ./react --account <my-account> --environment <my-environment>