Skip to content

apps top-level element

An app is a logical representation of a service or application. There are four types of application patterns: container, serverless, static site, or VM-based. The pattern for an application is defined by the selected Nullstone module as configured in the module parameter.

An app has the same schema as a block with additional attributes for environment variables and capabilities.

Examples

Fargate Container

yaml
apps:
  api:
    module: nullstone/aws-fargate-service
    vars:
      num_tasks: 1
      cpu: 256
      memory: 512
    environment:
      LOG_LEVEL: info
      BASE_URL: "{{ NULLSTONE_ENV }}.acme.com"
    capabilities:
      - name: postgres
        module: nullstone/aws-postgres-access
        connections:
          postgres: postgres
    connections:
      cluster-namespace: namespace0

Attributes

module

See blocks#module.

module_version

See blocks#module_version.

vars

See blocks#vars.

connections

See blocks#connections.

environment

The environment refers to "Custom" environment variables that are injected into an application.

Nullstone injects environment variables into applications by merging environment variables from three sources:

When specified in .nullstone/config.yml, environment overrides any "Custom" env variables configured in the Nullstone UI. When specified in an overrides file, environment appends entries to the existing set of environment variables defined in the Nullstone UI or in .nullstone/config.yml.

Nullstone supports Env Var Interpolation in environment variable values. You can interpolate values from any of the three env var sources (Standard, Capabilities, Custom). You may also interpolate multiple environment variables in one value. Example:

yaml
apps:
  api:
    environment:
      BASE_DOMAIN: "{{ NULLSTONE_ENV }}.acme.com" # "dev.acme.com"
      DASHBOARD_URL: "https://dashboard.{{ BASE_DOMAIN }}" # https://dashboard.dev.acme.com

Nullstone also supports Secret References using secret(...). This allows you to manually add a secret to a vault (e.g. AWS Secrets Manager) and inject into your application.

Example:

yaml
apps:
  api:
    environment:
      STRIPE_API_KEY: "{{ secret(arn:aws:secretsmanager:us-east-1:0123456789012:secret:stripe_api_key) }}"

capabilities

The capabilities section acts as "glue" infrastructure for applications. This gives the application access to datastores, third parties, and much more. See Capabilities for more information about capabilities.

See app capabilities.