Skip to content

app.capabilities element

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.

Examples

Postgres Access

yaml
apps:
  api:
    capabilities:
      - name: postgres
        module: nullstone/aws-postgres-access
        connections:
          postgres: postgres

Rails SECRET_KEY_BASE

yaml
apps:
  api:
    capabilities:
      - name: rails-cookies
        module: nullstone/rails-cookies

Attributes

module

See blocks#module.

module_version

See blocks#module_version.

vars

See blocks#vars.

connections

The connections section is used to connect the capability to another block. A capability uses connections to gain critical information for infrastructure configuration from a dependent block.

Let's take an example where a developer attaches a "Postgres Access" capability to the application. The "Postgres Access" module relies on a connection postgres to know where to configure the database cluster for this application. Normally, a human would have to manually configure this information for each environment. Instead, this connection provides a way for Nullstone to dynamically inject the correct information.

A connection reference is a "pointer" to a Nullstone block by name. In the example below, the "postgres" connection is defined in the nullstone/aws-postgres-access module and refers to the "db" datastore block.

yaml
apps:
  api:
    capabilities:
      - name: postgres
        module: nullstone/aws-postgres-access
        connections:
          postgres: db 

datastores:
  db:
    # ...