rc/env-configuration
Tells the platform which environment variables a workload reads to reach its APIs, mail servers, databases and caches. The platform fills them in, so addresses and secrets never live in the code.
Add a configuration field to a common-integrations Condition. Each entry pairs a variable the workload reads, such as DATABASE_URL, with the detail it carries, such as url, hostname, port, username or password. Mark an entry sensitive when it holds a secret, so the platform stores and passes it securely, and required when the workload cannot start without it.
When the workload can connect in more than one way, list alternatives instead. For example, one full DATABASE_URL, or separate host, port, user and password variables. Put them in order of preference; the platform provides one of them.
Each integration accepts only the details that make sense for it: a database can take database, and an HTTP API can take baseUrl or token. This extension builds on common-integrations, which defines the integrations themselves.
Documentation
Status
Draft — Request for Comments
This document defines a first-party Runtime Conditions extension for declaring workload configuration inputs that are provided through environment variables.
The current machine-readable definition is env-configuration-v1alpha2.yaml. The previous v1alpha1 definition is preserved.
env-configuration-v1alpha3.yaml has the same vocabulary as v1alpha2 and adds documentation: a description of the extension and of every kind, interface type, field and allowed value, and JSON Schema descriptions of the validation rules. The generated language bindings show this text as Godoc, Javadoc, Python docstrings and JSDoc. The published bindings move to v1alpha3 in their next release.
env-configuration-v1alpha4.yaml has the same vocabulary and documentation as v1alpha3. It depends on common-integrations v1alpha4 and was released automatically when common-integrations v1alpha4 was added. It depends on common-integrations v1alpha3.
This extension is not part of the core Runtime Conditions Profile vocabulary. Profiles that use this extension MUST declare it in the top-level extensions list.
1. Extension Identity
extensions:
- https://runtimeconditions.io/extensions/rc/common-integrations:v1alpha2
- https://runtimeconditions.io/extensions/rc/env-configuration:v1alpha2
This extension defines the Condition field configuration.
This release depends on common-integrations v1alpha2. Immutable definition URIs identify that dependency in the definition and binding metadata; generated profiles use the namespaced <location>:<version> references above.
This extension owns the unqualified Condition field name configuration only
within the common integration scopes listed in this document. Other extensions
MAY define configuration for their own non-overlapping Condition kinds and
interface types.
2. Purpose
The Environment Configuration extension describes the environment variable names a workload expects to read in order to consume a fulfilled Condition.
This extension describes:
- Which environment variables are read by the workload
- Which connection property each environment variable represents
- Whether an environment variable carries sensitive material
- Whether an environment variable is required within a configuration set
- Alternative sets of environment variables supported by the workload
This extension does not describe:
- Concrete target-environment values
- Infrastructure resources
- Deployment topology
- Provider-specific provisioning behavior
- Default values used by application code
- Validation rules for the contents of environment variable values
Environment variable values are strings. This extension declares how strings are passed to the workload, not what those strings contain.
3. Configuration Field
A Condition MAY include a configuration field when this extension is declared.
The configuration field MUST contain exactly one of:
envalternatives
Use configuration.env when the workload expects one configuration set:
conditions:
- name: todos-api
kind: api
interface:
type: http
operations:
- method: GET
path: /todos/{id}
configuration:
env:
- property: baseUrl
name: TODOS_API_URL
- property: token
name: TODOS_API_TOKEN
sensitive: true
Use configuration.alternatives when the workload supports two or more complete configuration sets:
conditions:
- name: request-cache
kind: cache
interface:
type: key_value
engine: redis
configuration:
alternatives:
- env:
- property: url
name: REDIS_URL
- env:
- property: hostname
name: REDIS_HOST
- property: port
name: REDIS_PORT
required: false
The alternatives field describes valid input sets, not precedence. If workload code supports multiple alternatives, the workload code determines how to handle precedence when more than one alternative is provided.
Platform automation MUST satisfy at least one complete configuration set for a required Condition. Platform automation MAY provide more than one complete configuration set.
4. Environment Variable Inputs
Each item in an env list describes one environment variable expected by the workload.
| Field | Required | Description |
|---|---|---|
property |
YES | Standard connection property represented by the environment variable |
name |
YES | Environment variable name read by the workload |
sensitive |
NO | Whether the value is sensitive and should be handled as secret material. Defaults to false |
required |
NO | Whether this input is required within its configuration set. Defaults to true |
Environment variable names MUST match the following pattern:
^[A-Za-z_][A-Za-z0-9_]*$
An environment variable input with required: false declares that the workload may read the variable but does not require it to be present for the configuration set to be valid.
5. Standard Connection Properties
The following standard connection properties are defined by this extension:
| Property | Description |
|---|---|
url |
Complete connection URL for a dependency |
baseUrl |
Base URL used when calling an API dependency |
hostname |
DNS name, host name, or network host for a dependency |
port |
Network port |
scheme |
Connection or request scheme |
username |
Username or client identifier |
password |
Password or shared secret |
database |
Database name, schema name, logical database number, or equivalent datastore selector |
token |
Bearer token, API token, or equivalent credential |
tls |
Whether TLS is required or enabled |
tlsMode |
SMTP transport mode; the application interprets disabled, starttls, or implicit |
fromAddress |
Configured SMTP sender address |
toAddress |
Configured SMTP recipient address |
Allowed properties are validated against the Condition kind and interface.type.
| Condition | Allowed properties |
|---|---|
kind: api, interface.type: http |
url, baseUrl, hostname, port, scheme, username, password, token, tls |
kind: api, interface.type: smtp |
url, hostname, port, username, password, tlsMode, fromAddress, toAddress |
kind: datastore, interface.type: relational |
url, hostname, port, scheme, username, password, database, tls |
kind: datastore, interface.type: document |
url, hostname, port, scheme, username, password, database, tls |
kind: cache, interface.type: key_value |
url, hostname, port, scheme, username, password, database, token, tls |
Extensions that define additional Condition kinds or interface types MAY define additional allowed properties for use with this extension.
6. Validation
A Condition that uses this extension is invalid if:
configurationappears and the applicable env-configuration release is not declaredconfigurationcontains neitherenvnoralternativesconfigurationcontains bothenvandalternativesconfiguration.envis present but emptyconfiguration.alternativescontains fewer than two alternatives- Any configuration alternative does not declare exactly one
envlist - Any configuration alternative declares an empty
envlist - Any
envitem omitsproperty - Any
envitem omitsname - Any
env.namedoes not match the required environment variable name pattern - Any
env.propertyis not allowed for the Conditionkindandinterface.type - Any
env.sensitivevalue is not a boolean - Any
env.requiredvalue is not a boolean - Any configuration set declares the same
propertymore than once - Any configuration set declares the same environment variable
namemore than once
7. Example Profile
apiVersion: runtimeconditions.io/v1alpha1
kind: RuntimeConditionsProfile
metadata:
name: request-logger
workload:
uri: https://github.com/example-org/request-logger
version: v1.2.3
extensions:
- https://runtimeconditions.io/extensions/rc/common-integrations:v1alpha2
- https://runtimeconditions.io/extensions/rc/env-configuration:v1alpha2
conditions:
- name: todos-api
kind: api
interface:
type: http
operations:
- method: GET
path: /todos/{id}
configuration:
env:
- property: baseUrl
name: TODOS_API_URL
- name: request-cache
kind: cache
interface:
type: key_value
engine: redis
configuration:
alternatives:
- env:
- property: url
name: REDIS_URL
- env:
- property: hostname
name: REDIS_HOST
- property: port
name: REDIS_PORT
required: false
8. Summary
The Environment Configuration extension defines a portable workload input contract for environment-variable-based dependency configuration while preserving the core Runtime Conditions Profile boundary between runtime integration requirements and concrete fulfillment values.
Packages
Install the package for your language to declare this extension's Conditions from your code.
Go
This package version is generated but not published to its registry yet.
go get runtimeconditions.io/x/rc/env@v0.4.0
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
configuration on api · http: How the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
env.HttpConfiguration sets the configuration field of an api Condition.
| Field | Type | Required | Description |
|---|---|---|---|
Alternatives |
HttpConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
Alternatives[].Env |
HttpConfigurationAlternativesEnv |
yes | List at least one environment variable, without repeats. |
Alternatives[].Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Alternatives[].Env[].Property |
HttpConfigurationAlternativesEnvProperty |
yes | Must be one of the properties defined for this integration. Values: baseUrl: The base URL that request paths are appended to, for example https://api.example.com/v1.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Alternatives[].Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Alternatives[].Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
Env |
HttpConfigurationEnv |
no | List at least one environment variable, without repeats. |
Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Env[].Property |
HttpConfigurationEnvProperty |
yes | Must be one of the properties defined for this integration. Values: baseUrl: The base URL that request paths are appended to, for example https://api.example.com/v1.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on api · smtp: How the platform passes the SMTP server details and email addresses to the workload, as environment variables.
env.SmtpConfiguration sets the configuration field of an api Condition.
| Field | Type | Required | Description |
|---|---|---|---|
Alternatives |
SmtpConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
Alternatives[].Env |
SmtpConfigurationAlternativesEnv |
yes | List at least one environment variable, without repeats. |
Alternatives[].Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Alternatives[].Env[].Property |
SmtpConfigurationAlternativesEnvProperty |
yes | Must be one of the properties defined for this integration. Values: fromAddress: The email address that messages are sent from.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.tlsMode: How the SMTP connection uses TLS, for example starttls or tls.toAddress: The email address that messages are sent to.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Alternatives[].Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Alternatives[].Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
Env |
SmtpConfigurationEnv |
no | List at least one environment variable, without repeats. |
Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Env[].Property |
SmtpConfigurationEnvProperty |
yes | Must be one of the properties defined for this integration. Values: fromAddress: The email address that messages are sent from.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.tlsMode: How the SMTP connection uses TLS, for example starttls or tls.toAddress: The email address that messages are sent to.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on cache · key_value: How the platform passes the connection details of the cache to the workload, as environment variables.
env.KeyValueConfiguration sets the configuration field of a cache Condition.
| Field | Type | Required | Description |
|---|---|---|---|
Alternatives |
KeyValueConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
Alternatives[].Env |
KeyValueConfigurationAlternativesEnv |
yes | List at least one environment variable, without repeats. |
Alternatives[].Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Alternatives[].Env[].Property |
KeyValueConfigurationAlternativesEnvProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Alternatives[].Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Alternatives[].Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
Env |
KeyValueConfigurationEnv |
no | List at least one environment variable, without repeats. |
Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Env[].Property |
KeyValueConfigurationEnvProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on datastore · document: How the platform passes the connection details of the database to the workload, as environment variables.
env.DocumentConfiguration sets the configuration field of a datastore Condition.
| Field | Type | Required | Description |
|---|---|---|---|
Alternatives |
DocumentConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
Alternatives[].Env |
DocumentConfigurationAlternativesEnv |
yes | List at least one environment variable, without repeats. |
Alternatives[].Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Alternatives[].Env[].Property |
DocumentConfigurationAlternativesEnvProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Alternatives[].Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Alternatives[].Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
Env |
DocumentConfigurationEnv |
no | List at least one environment variable, without repeats. |
Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Env[].Property |
DocumentConfigurationEnvProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on datastore · relational: How the platform passes the connection details of the database to the workload, as environment variables.
env.RelationalConfiguration sets the configuration field of a datastore Condition.
| Field | Type | Required | Description |
|---|---|---|---|
Alternatives |
RelationalConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
Alternatives[].Env |
RelationalConfigurationAlternativesEnv |
yes | List at least one environment variable, without repeats. |
Alternatives[].Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Alternatives[].Env[].Property |
RelationalConfigurationAlternativesEnvProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Alternatives[].Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Alternatives[].Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
Env |
RelationalConfigurationEnv |
no | List at least one environment variable, without repeats. |
Env[].Name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
Env[].Property |
RelationalConfigurationEnvProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
Env[].Required |
*bool |
no | True when the workload cannot start without this variable. |
Env[].Sensitive |
*bool |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
DocumentConfiguration, RelationalConfiguration
env.DocumentConfiguration sets the configuration field of datastore Conditions with interface type document.
env.RelationalConfiguration sets the configuration field of datastore Conditions with interface type relational.
How the platform passes the connection details of the database to the workload, as environment variables.
Example: a workload that accepts either one PostgreSQL connection URL or separate host, port, user, password and database variables. The platform provides one of the two sets.
common.Datastore(
common.Relational{
Engine: &[]common.RelationalEngine{common.RelationalEnginePostgres}[0],
},
env.RelationalConfiguration{
Alternatives: env.RelationalConfigurationAlternatives{
env.RelationalConfigurationAlternativesItem{
Env: env.RelationalConfigurationAlternativesEnv{
env.RelationalConfigurationAlternativesEnvItem{
Name: "DATABASE_URL",
Property: env.RelationalConfigurationAlternativesEnvPropertyUrl,
Sensitive: &[]bool{true}[0],
},
},
},
env.RelationalConfigurationAlternativesItem{
Env: env.RelationalConfigurationAlternativesEnv{
env.RelationalConfigurationAlternativesEnvItem{
Name: "DB_HOST",
Property: env.RelationalConfigurationAlternativesEnvPropertyHostname,
},
env.RelationalConfigurationAlternativesEnvItem{
Name: "DB_PORT",
Property: env.RelationalConfigurationAlternativesEnvPropertyPort,
},
env.RelationalConfigurationAlternativesEnvItem{
Name: "DB_USER",
Property: env.RelationalConfigurationAlternativesEnvPropertyUsername,
},
env.RelationalConfigurationAlternativesEnvItem{
Name: "DB_PASSWORD",
Property: env.RelationalConfigurationAlternativesEnvPropertyPassword,
Sensitive: &[]bool{true}[0],
},
env.RelationalConfigurationAlternativesEnvItem{
Name: "DB_NAME",
Property: env.RelationalConfigurationAlternativesEnvPropertyDatabase,
},
},
},
},
},
)
HttpConfiguration
env.HttpConfiguration sets the configuration field of api Conditions with interface type http.
How the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
Example: a workload that reads the todos API base URL and an access token from its environment.
common.Api(
common.Http{
Spec: &common.Spec{
Format: common.FormatOpenapi,
Uri: "catalog://api/default/todos-api",
},
},
env.HttpConfiguration{
Env: env.HttpConfigurationEnv{
env.HttpConfigurationEnvItem{
Name: "TODOS_API_URL",
Property: env.HttpConfigurationEnvPropertyBaseUrl,
Required: &[]bool{true}[0],
},
env.HttpConfigurationEnvItem{
Name: "TODOS_API_TOKEN",
Property: env.HttpConfigurationEnvPropertyToken,
Sensitive: &[]bool{true}[0],
},
},
},
)
KeyValueConfiguration
env.KeyValueConfiguration sets the configuration field of cache Conditions with interface type key_value.
How the platform passes the connection details of the cache to the workload, as environment variables.
Example: a workload that needs a Redis cache and cannot start without its URL.
common.Cache(
common.KeyValue{
Engine: &[]common.KeyValueEngine{common.KeyValueEngineRedis}[0],
},
env.KeyValueConfiguration{
Env: env.KeyValueConfigurationEnv{
env.KeyValueConfigurationEnvItem{
Name: "REDIS_URL",
Property: env.KeyValueConfigurationEnvPropertyUrl,
Required: &[]bool{true}[0],
},
},
},
)
SmtpConfiguration
env.SmtpConfiguration sets the configuration field of api Conditions with interface type smtp.
How the platform passes the SMTP server details and email addresses to the workload, as environment variables.
Example: a workload that sends email through an SMTP server and reads the server, login and sender address from its environment.
common.Api(
common.Smtp{
Operations: common.SmtpOperations{
common.SmtpOperationsItemSend,
},
},
env.SmtpConfiguration{
Env: env.SmtpConfigurationEnv{
env.SmtpConfigurationEnvItem{
Name: "SMTP_HOST",
Property: env.SmtpConfigurationEnvPropertyHostname,
Required: &[]bool{true}[0],
},
env.SmtpConfigurationEnvItem{
Name: "SMTP_PORT",
Property: env.SmtpConfigurationEnvPropertyPort,
},
env.SmtpConfigurationEnvItem{
Name: "SMTP_USER",
Property: env.SmtpConfigurationEnvPropertyUsername,
},
env.SmtpConfigurationEnvItem{
Name: "SMTP_PASSWORD",
Property: env.SmtpConfigurationEnvPropertyPassword,
Sensitive: &[]bool{true}[0],
},
env.SmtpConfigurationEnvItem{
Name: "MAIL_FROM",
Property: env.SmtpConfigurationEnvPropertyFromAddress,
},
},
},
)
The full API, with every type, field and constant documented, is in the Go package documentation.
Python
This package version is generated but not published to its registry yet.
pip install runtimeconditions-env-configuration
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
configuration on api · http: How the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
HttpConfiguration sets the configuration field of an api Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
HttpConfigurationAlternatives | None |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
HttpConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
HttpConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: baseUrl: The base URL that request paths are appended to, for example https://api.example.com/v1.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
HttpConfigurationEnv | None |
no | List at least one environment variable, without repeats. |
env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
HttpConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: baseUrl: The base URL that request paths are appended to, for example https://api.example.com/v1.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on api · smtp: How the platform passes the SMTP server details and email addresses to the workload, as environment variables.
SmtpConfiguration sets the configuration field of an api Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
SmtpConfigurationAlternatives | None |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
SmtpConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
SmtpConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: fromAddress: The email address that messages are sent from.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.tlsMode: How the SMTP connection uses TLS, for example starttls or tls.toAddress: The email address that messages are sent to.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
SmtpConfigurationEnv | None |
no | List at least one environment variable, without repeats. |
env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
SmtpConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: fromAddress: The email address that messages are sent from.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.tlsMode: How the SMTP connection uses TLS, for example starttls or tls.toAddress: The email address that messages are sent to.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on cache · key_value: How the platform passes the connection details of the cache to the workload, as environment variables.
KeyValueConfiguration sets the configuration field of a cache Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
KeyValueConfigurationAlternatives | None |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
KeyValueConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
KeyValueConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
KeyValueConfigurationEnv | None |
no | List at least one environment variable, without repeats. |
env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
KeyValueConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on datastore · document: How the platform passes the connection details of the database to the workload, as environment variables.
DocumentConfiguration sets the configuration field of a datastore Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
DocumentConfigurationAlternatives | None |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
DocumentConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
DocumentConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
DocumentConfigurationEnv | None |
no | List at least one environment variable, without repeats. |
env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
DocumentConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on datastore · relational: How the platform passes the connection details of the database to the workload, as environment variables.
RelationalConfiguration sets the configuration field of a datastore Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
RelationalConfigurationAlternatives | None |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
RelationalConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
RelationalConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
RelationalConfigurationEnv | None |
no | List at least one environment variable, without repeats. |
env[].name |
str |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
RelationalConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
bool | None |
no | True when the workload cannot start without this variable. |
env[].sensitive |
bool | None |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
DocumentConfiguration, RelationalConfiguration
DocumentConfiguration sets the configuration field of datastore Conditions with interface type document.
RelationalConfiguration sets the configuration field of datastore Conditions with interface type relational.
How the platform passes the connection details of the database to the workload, as environment variables.
Example: a workload that accepts either one PostgreSQL connection URL or separate host, port, user, password and database variables. The platform provides one of the two sets.
from runtimeconditions_common_integrations import (
Relational,
RelationalEngine,
datastore,
)
from runtimeconditions_env_configuration import (
RelationalConfiguration,
RelationalConfigurationAlternativesItem,
RelationalConfigurationAlternativesItemEnvItem,
RelationalConfigurationAlternativesItemEnvItemProperty,
)
datastore(
Relational(engine=RelationalEngine.POSTGRES),
RelationalConfiguration(
alternatives=[
RelationalConfigurationAlternativesItem(
env=[
RelationalConfigurationAlternativesItemEnvItem(
name="DATABASE_URL",
property=RelationalConfigurationAlternativesItemEnvItemProperty.URL,
sensitive=True,
),
],
),
RelationalConfigurationAlternativesItem(
env=[
RelationalConfigurationAlternativesItemEnvItem(
name="DB_HOST",
property=RelationalConfigurationAlternativesItemEnvItemProperty.HOSTNAME,
),
RelationalConfigurationAlternativesItemEnvItem(
name="DB_PORT",
property=RelationalConfigurationAlternativesItemEnvItemProperty.PORT,
),
RelationalConfigurationAlternativesItemEnvItem(
name="DB_USER",
property=RelationalConfigurationAlternativesItemEnvItemProperty.USERNAME,
),
RelationalConfigurationAlternativesItemEnvItem(
name="DB_PASSWORD",
property=RelationalConfigurationAlternativesItemEnvItemProperty.PASSWORD,
sensitive=True,
),
RelationalConfigurationAlternativesItemEnvItem(
name="DB_NAME",
property=RelationalConfigurationAlternativesItemEnvItemProperty.DATABASE,
),
],
),
],
),
)
HttpConfiguration
HttpConfiguration sets the configuration field of api Conditions with interface type http.
How the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
Example: a workload that reads the todos API base URL and an access token from its environment.
from runtimeconditions_common_integrations import Format, Http, Spec, api
from runtimeconditions_env_configuration import (
HttpConfiguration,
HttpConfigurationEnvItem,
HttpConfigurationEnvItemProperty,
)
api(
Http(spec=Spec(format=Format.OPENAPI, uri="catalog://api/default/todos-api")),
HttpConfiguration(
env=[
HttpConfigurationEnvItem(
name="TODOS_API_URL",
property=HttpConfigurationEnvItemProperty.BASE_URL,
required=True,
),
HttpConfigurationEnvItem(
name="TODOS_API_TOKEN",
property=HttpConfigurationEnvItemProperty.TOKEN,
sensitive=True,
),
],
),
)
KeyValueConfiguration
KeyValueConfiguration sets the configuration field of cache Conditions with interface type key_value.
How the platform passes the connection details of the cache to the workload, as environment variables.
Example: a workload that needs a Redis cache and cannot start without its URL.
from runtimeconditions_common_integrations import KeyValue, KeyValueEngine, cache
from runtimeconditions_env_configuration import (
KeyValueConfiguration,
KeyValueConfigurationEnvItem,
KeyValueConfigurationEnvItemProperty,
)
cache(
KeyValue(engine=KeyValueEngine.REDIS),
KeyValueConfiguration(
env=[
KeyValueConfigurationEnvItem(
name="REDIS_URL",
property=KeyValueConfigurationEnvItemProperty.URL,
required=True,
),
],
),
)
SmtpConfiguration
SmtpConfiguration sets the configuration field of api Conditions with interface type smtp.
How the platform passes the SMTP server details and email addresses to the workload, as environment variables.
Example: a workload that sends email through an SMTP server and reads the server, login and sender address from its environment.
from runtimeconditions_common_integrations import Smtp, SmtpOperationsItem, api
from runtimeconditions_env_configuration import (
SmtpConfiguration,
SmtpConfigurationEnvItem,
SmtpConfigurationEnvItemProperty,
)
api(
Smtp(operations=[SmtpOperationsItem.SEND]),
SmtpConfiguration(
env=[
SmtpConfigurationEnvItem(
name="SMTP_HOST",
property=SmtpConfigurationEnvItemProperty.HOSTNAME,
required=True,
),
SmtpConfigurationEnvItem(
name="SMTP_PORT",
property=SmtpConfigurationEnvItemProperty.PORT,
),
SmtpConfigurationEnvItem(
name="SMTP_USER",
property=SmtpConfigurationEnvItemProperty.USERNAME,
),
SmtpConfigurationEnvItem(
name="SMTP_PASSWORD",
property=SmtpConfigurationEnvItemProperty.PASSWORD,
sensitive=True,
),
SmtpConfigurationEnvItem(
name="MAIL_FROM",
property=SmtpConfigurationEnvItemProperty.FROM_ADDRESS,
),
],
),
)
Every class, field and enum member is documented in the package's docstrings.
TypeScript
This package version is generated but not published to its registry yet.
npm install @runtimeconditions/env-configuration
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
configuration on api · http: How the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
HttpConfiguration sets the configuration field of an api Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
HttpConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
HttpConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
HttpConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: baseUrl: The base URL that request paths are appended to, for example https://api.example.com/v1.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
HttpConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
HttpConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: baseUrl: The base URL that request paths are appended to, for example https://api.example.com/v1.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on api · smtp: How the platform passes the SMTP server details and email addresses to the workload, as environment variables.
SmtpConfiguration sets the configuration field of an api Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
SmtpConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
SmtpConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
SmtpConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: fromAddress: The email address that messages are sent from.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.tlsMode: How the SMTP connection uses TLS, for example starttls or tls.toAddress: The email address that messages are sent to.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
SmtpConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
SmtpConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: fromAddress: The email address that messages are sent from.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.tlsMode: How the SMTP connection uses TLS, for example starttls or tls.toAddress: The email address that messages are sent to.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on cache · key_value: How the platform passes the connection details of the cache to the workload, as environment variables.
KeyValueConfiguration sets the configuration field of a cache Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
KeyValueConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
KeyValueConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
KeyValueConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
KeyValueConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
KeyValueConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on datastore · document: How the platform passes the connection details of the database to the workload, as environment variables.
DocumentConfiguration sets the configuration field of a datastore Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
DocumentConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
DocumentConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
DocumentConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
DocumentConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
DocumentConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on datastore · relational: How the platform passes the connection details of the database to the workload, as environment variables.
RelationalConfiguration sets the configuration field of a datastore Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
RelationalConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
RelationalConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
RelationalConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
RelationalConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
string |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
RelationalConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
DocumentConfiguration, RelationalConfiguration
DocumentConfiguration sets the configuration field of datastore Conditions with interface type document.
RelationalConfiguration sets the configuration field of datastore Conditions with interface type relational.
How the platform passes the connection details of the database to the workload, as environment variables.
Example: a workload that accepts either one PostgreSQL connection URL or separate host, port, user, password and database variables. The platform provides one of the two sets.
import { Relational, RelationalEngine, datastore } from "@runtimeconditions/common-integrations";
import { RelationalConfiguration, RelationalConfigurationAlternativesItem, RelationalConfigurationAlternativesItemEnvItem, RelationalConfigurationAlternativesItemEnvItemProperty } from "@runtimeconditions/env-configuration";
datastore(
new Relational({ engine: RelationalEngine.Postgres }),
new RelationalConfiguration({
alternatives: [
new RelationalConfigurationAlternativesItem({
env: [
new RelationalConfigurationAlternativesItemEnvItem({
name: "DATABASE_URL",
property: RelationalConfigurationAlternativesItemEnvItemProperty.Url,
sensitive: true,
}),
],
}),
new RelationalConfigurationAlternativesItem({
env: [
new RelationalConfigurationAlternativesItemEnvItem({
name: "DB_HOST",
property: RelationalConfigurationAlternativesItemEnvItemProperty.Hostname,
}),
new RelationalConfigurationAlternativesItemEnvItem({
name: "DB_PORT",
property: RelationalConfigurationAlternativesItemEnvItemProperty.Port,
}),
new RelationalConfigurationAlternativesItemEnvItem({
name: "DB_USER",
property: RelationalConfigurationAlternativesItemEnvItemProperty.Username,
}),
new RelationalConfigurationAlternativesItemEnvItem({
name: "DB_PASSWORD",
property: RelationalConfigurationAlternativesItemEnvItemProperty.Password,
sensitive: true,
}),
new RelationalConfigurationAlternativesItemEnvItem({
name: "DB_NAME",
property: RelationalConfigurationAlternativesItemEnvItemProperty.Database,
}),
],
}),
],
}),
);
HttpConfiguration
HttpConfiguration sets the configuration field of api Conditions with interface type http.
How the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
Example: a workload that reads the todos API base URL and an access token from its environment.
import { Format, Http, Spec, api } from "@runtimeconditions/common-integrations";
import { HttpConfiguration, HttpConfigurationEnvItem, HttpConfigurationEnvItemProperty } from "@runtimeconditions/env-configuration";
api(
new Http({ spec: new Spec({ format: Format.Openapi, uri: "catalog://api/default/todos-api" }) }),
new HttpConfiguration({
env: [
new HttpConfigurationEnvItem({
name: "TODOS_API_URL",
property: HttpConfigurationEnvItemProperty.BaseUrl,
required: true,
}),
new HttpConfigurationEnvItem({
name: "TODOS_API_TOKEN",
property: HttpConfigurationEnvItemProperty.Token,
sensitive: true,
}),
],
}),
);
KeyValueConfiguration
KeyValueConfiguration sets the configuration field of cache Conditions with interface type key_value.
How the platform passes the connection details of the cache to the workload, as environment variables.
Example: a workload that needs a Redis cache and cannot start without its URL.
import { KeyValue, KeyValueEngine, cache } from "@runtimeconditions/common-integrations";
import { KeyValueConfiguration, KeyValueConfigurationEnvItem, KeyValueConfigurationEnvItemProperty } from "@runtimeconditions/env-configuration";
cache(
new KeyValue({ engine: KeyValueEngine.Redis }),
new KeyValueConfiguration({
env: [
new KeyValueConfigurationEnvItem({
name: "REDIS_URL",
property: KeyValueConfigurationEnvItemProperty.Url,
required: true,
}),
],
}),
);
SmtpConfiguration
SmtpConfiguration sets the configuration field of api Conditions with interface type smtp.
How the platform passes the SMTP server details and email addresses to the workload, as environment variables.
Example: a workload that sends email through an SMTP server and reads the server, login and sender address from its environment.
import { Smtp, SmtpOperationsItem, api } from "@runtimeconditions/common-integrations";
import { SmtpConfiguration, SmtpConfigurationEnvItem, SmtpConfigurationEnvItemProperty } from "@runtimeconditions/env-configuration";
api(
new Smtp({ operations: [SmtpOperationsItem.Send] }),
new SmtpConfiguration({
env: [
new SmtpConfigurationEnvItem({
name: "SMTP_HOST",
property: SmtpConfigurationEnvItemProperty.Hostname,
required: true,
}),
new SmtpConfigurationEnvItem({
name: "SMTP_PORT",
property: SmtpConfigurationEnvItemProperty.Port,
}),
new SmtpConfigurationEnvItem({
name: "SMTP_USER",
property: SmtpConfigurationEnvItemProperty.Username,
}),
new SmtpConfigurationEnvItem({
name: "SMTP_PASSWORD",
property: SmtpConfigurationEnvItemProperty.Password,
sensitive: true,
}),
new SmtpConfigurationEnvItem({
name: "MAIL_FROM",
property: SmtpConfigurationEnvItemProperty.FromAddress,
}),
],
}),
);
Every class, field and enum member is documented in the package's type declarations.
Java
This package version is generated but not published to its registry yet.
<dependency>
<groupId>io.runtimeconditions.bindings</groupId>
<artifactId>runtimeconditions-env-configuration</artifactId>
<version>0.2.0</version>
</dependency>
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
configuration on api · http: How the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
HttpConfiguration sets the configuration field of an api Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
HttpConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
HttpConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
HttpConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: baseUrl: The base URL that request paths are appended to, for example https://api.example.com/v1.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
HttpConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
HttpConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: baseUrl: The base URL that request paths are appended to, for example https://api.example.com/v1.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on api · smtp: How the platform passes the SMTP server details and email addresses to the workload, as environment variables.
SmtpConfiguration sets the configuration field of an api Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
SmtpConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
SmtpConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
SmtpConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: fromAddress: The email address that messages are sent from.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.tlsMode: How the SMTP connection uses TLS, for example starttls or tls.toAddress: The email address that messages are sent to.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
SmtpConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
SmtpConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: fromAddress: The email address that messages are sent from.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.tlsMode: How the SMTP connection uses TLS, for example starttls or tls.toAddress: The email address that messages are sent to.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on cache · key_value: How the platform passes the connection details of the cache to the workload, as environment variables.
KeyValueConfiguration sets the configuration field of a cache Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
KeyValueConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
KeyValueConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
KeyValueConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
KeyValueConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
KeyValueConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.token: A bearer token or API key to authenticate with. Usually marked sensitive.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on datastore · document: How the platform passes the connection details of the database to the workload, as environment variables.
DocumentConfiguration sets the configuration field of a datastore Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
DocumentConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
DocumentConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
DocumentConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
DocumentConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
DocumentConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
configuration on datastore · relational: How the platform passes the connection details of the database to the workload, as environment variables.
RelationalConfiguration sets the configuration field of a datastore Condition.
| Field | Type | Required | Description |
|---|---|---|---|
alternatives |
RelationalConfigurationAlternatives |
no | List at least two alternative sets of variables. The platform satisfies one of them. |
alternatives[].env |
RelationalConfigurationAlternativesItemEnv |
yes | List at least one environment variable, without repeats. |
alternatives[].env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
alternatives[].env[].property |
RelationalConfigurationAlternativesItemEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
alternatives[].env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
alternatives[].env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
env |
RelationalConfigurationEnv |
no | List at least one environment variable, without repeats. |
env[].name |
String |
yes | The environment variable name, for example REDIS_URL. Must start with a letter or underscore and contain only letters, digits and underscores. |
env[].property |
RelationalConfigurationEnvItemProperty |
yes | Must be one of the properties defined for this integration. Values: database: The name of the database, or the database number for a cache, to use.hostname: The host name or IP address to connect to.password: The password to authenticate with. Usually marked sensitive.port: The port number to connect to.scheme: The URL scheme or protocol, for example https or postgres.tls: Whether to use TLS, or TLS settings, for the connection.url: A full connection URL, for example https://api.example.com or redis://cache:6379.username: The user name to authenticate with. |
env[].required |
Boolean |
no | True when the workload cannot start without this variable. |
env[].sensitive |
Boolean |
no | True when the value is a secret, such as a password or token, so the platform can store and pass it securely. |
DocumentConfiguration, RelationalConfiguration
DocumentConfiguration sets the configuration field of datastore Conditions with interface type document.
RelationalConfiguration sets the configuration field of datastore Conditions with interface type relational.
How the platform passes the connection details of the database to the workload, as environment variables.
Example: a workload that accepts either one PostgreSQL connection URL or separate host, port, user, password and database variables. The platform provides one of the two sets.
import io.runtimeconditions.bindings.commonintegrations.Bindings;
import io.runtimeconditions.bindings.commonintegrations.Relational;
import io.runtimeconditions.bindings.commonintegrations.RelationalEngine;
import io.runtimeconditions.bindings.envconfiguration.RelationalConfiguration;
import io.runtimeconditions.bindings.envconfiguration.RelationalConfigurationAlternatives;
import io.runtimeconditions.bindings.envconfiguration.RelationalConfigurationAlternativesItem;
import io.runtimeconditions.bindings.envconfiguration.RelationalConfigurationAlternativesItemEnv;
import io.runtimeconditions.bindings.envconfiguration.RelationalConfigurationAlternativesItemEnvItem;
import io.runtimeconditions.bindings.envconfiguration.RelationalConfigurationAlternativesItemEnvItemProperty;
import java.util.List;
Bindings.datastore(
new Relational(RelationalEngine.POSTGRES),
new RelationalConfiguration(
new RelationalConfigurationAlternatives(
List.of(
new RelationalConfigurationAlternativesItem(
new RelationalConfigurationAlternativesItemEnv(
List.of(
new RelationalConfigurationAlternativesItemEnvItem(
"DATABASE_URL",
RelationalConfigurationAlternativesItemEnvItemProperty.URL,
null,
true)))),
new RelationalConfigurationAlternativesItem(
new RelationalConfigurationAlternativesItemEnv(
List.of(
new RelationalConfigurationAlternativesItemEnvItem(
"DB_HOST",
RelationalConfigurationAlternativesItemEnvItemProperty.HOSTNAME,
null,
null),
new RelationalConfigurationAlternativesItemEnvItem(
"DB_PORT",
RelationalConfigurationAlternativesItemEnvItemProperty.PORT,
null,
null),
new RelationalConfigurationAlternativesItemEnvItem(
"DB_USER",
RelationalConfigurationAlternativesItemEnvItemProperty.USERNAME,
null,
null),
new RelationalConfigurationAlternativesItemEnvItem(
"DB_PASSWORD",
RelationalConfigurationAlternativesItemEnvItemProperty.PASSWORD,
null,
true),
new RelationalConfigurationAlternativesItemEnvItem(
"DB_NAME",
RelationalConfigurationAlternativesItemEnvItemProperty.DATABASE,
null,
null)))))),
null));
HttpConfiguration
HttpConfiguration sets the configuration field of api Conditions with interface type http.
How the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
Example: a workload that reads the todos API base URL and an access token from its environment.
import io.runtimeconditions.bindings.commonintegrations.Bindings;
import io.runtimeconditions.bindings.commonintegrations.Format;
import io.runtimeconditions.bindings.commonintegrations.Http;
import io.runtimeconditions.bindings.commonintegrations.Spec;
import io.runtimeconditions.bindings.envconfiguration.HttpConfiguration;
import io.runtimeconditions.bindings.envconfiguration.HttpConfigurationEnv;
import io.runtimeconditions.bindings.envconfiguration.HttpConfigurationEnvItem;
import io.runtimeconditions.bindings.envconfiguration.HttpConfigurationEnvItemProperty;
import java.util.List;
Bindings.api(
new Http(null, new Spec(Format.OPENAPI, "catalog://api/default/todos-api", null)),
new HttpConfiguration(
null,
new HttpConfigurationEnv(
List.of(
new HttpConfigurationEnvItem(
"TODOS_API_URL",
HttpConfigurationEnvItemProperty.BASE_URL,
true,
null),
new HttpConfigurationEnvItem(
"TODOS_API_TOKEN",
HttpConfigurationEnvItemProperty.TOKEN,
null,
true)))));
KeyValueConfiguration
KeyValueConfiguration sets the configuration field of cache Conditions with interface type key_value.
How the platform passes the connection details of the cache to the workload, as environment variables.
Example: a workload that needs a Redis cache and cannot start without its URL.
import io.runtimeconditions.bindings.commonintegrations.Bindings;
import io.runtimeconditions.bindings.commonintegrations.KeyValue;
import io.runtimeconditions.bindings.commonintegrations.KeyValueEngine;
import io.runtimeconditions.bindings.envconfiguration.KeyValueConfiguration;
import io.runtimeconditions.bindings.envconfiguration.KeyValueConfigurationEnv;
import io.runtimeconditions.bindings.envconfiguration.KeyValueConfigurationEnvItem;
import io.runtimeconditions.bindings.envconfiguration.KeyValueConfigurationEnvItemProperty;
import java.util.List;
Bindings.cache(
new KeyValue(KeyValueEngine.REDIS),
new KeyValueConfiguration(
null,
new KeyValueConfigurationEnv(
List.of(
new KeyValueConfigurationEnvItem(
"REDIS_URL",
KeyValueConfigurationEnvItemProperty.URL,
true,
null)))));
SmtpConfiguration
SmtpConfiguration sets the configuration field of api Conditions with interface type smtp.
How the platform passes the SMTP server details and email addresses to the workload, as environment variables.
Example: a workload that sends email through an SMTP server and reads the server, login and sender address from its environment.
import io.runtimeconditions.bindings.commonintegrations.Bindings;
import io.runtimeconditions.bindings.commonintegrations.Smtp;
import io.runtimeconditions.bindings.commonintegrations.SmtpOperations;
import io.runtimeconditions.bindings.commonintegrations.SmtpOperationsItem;
import io.runtimeconditions.bindings.envconfiguration.SmtpConfiguration;
import io.runtimeconditions.bindings.envconfiguration.SmtpConfigurationEnv;
import io.runtimeconditions.bindings.envconfiguration.SmtpConfigurationEnvItem;
import io.runtimeconditions.bindings.envconfiguration.SmtpConfigurationEnvItemProperty;
import java.util.List;
Bindings.api(
new Smtp(new SmtpOperations(List.of(SmtpOperationsItem.SEND))),
new SmtpConfiguration(
null,
new SmtpConfigurationEnv(
List.of(
new SmtpConfigurationEnvItem(
"SMTP_HOST",
SmtpConfigurationEnvItemProperty.HOSTNAME,
true,
null),
new SmtpConfigurationEnvItem(
"SMTP_PORT",
SmtpConfigurationEnvItemProperty.PORT,
null,
null),
new SmtpConfigurationEnvItem(
"SMTP_USER",
SmtpConfigurationEnvItemProperty.USERNAME,
null,
null),
new SmtpConfigurationEnvItem(
"SMTP_PASSWORD",
SmtpConfigurationEnvItemProperty.PASSWORD,
null,
true),
new SmtpConfigurationEnvItem(
"MAIL_FROM",
SmtpConfigurationEnvItemProperty.FROM_ADDRESS,
null,
null)))));
Every record, component and enum constant is documented in the Javadoc.
Condition fields
configurationHow the platform passes the address and credentials of the HTTP API to the workload, as environment variables.
Example: a workload that reads the todos API base URL and an access token from its environment.
kind: api
interface:
type: http
spec:
format: openapi
uri: catalog://api/default/todos-api
configuration:
env:
- property: baseUrl
name: TODOS_API_URL
required: true
- property: token
name: TODOS_API_TOKEN
sensitive: true
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
baseUrl | The base URL that request paths are appended to, for example https://api.example.com/v1. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
scheme | The URL scheme or protocol, for example https or postgres. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
token | A bearer token or API key to authenticate with. Usually marked sensitive. |
tls | Whether to use TLS, or TLS settings, for the connection. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
baseUrl | The base URL that request paths are appended to, for example https://api.example.com/v1. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
scheme | The URL scheme or protocol, for example https or postgres. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
token | A bearer token or API key to authenticate with. Usually marked sensitive. |
tls | Whether to use TLS, or TLS settings, for the connection. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
scheme | The URL scheme or protocol, for example https or postgres. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
database | The name of the database, or the database number for a cache, to use. |
tls | Whether to use TLS, or TLS settings, for the connection. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
scheme | The URL scheme or protocol, for example https or postgres. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
database | The name of the database, or the database number for a cache, to use. |
tls | Whether to use TLS, or TLS settings, for the connection. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
scheme | The URL scheme or protocol, for example https or postgres. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
database | The name of the database, or the database number for a cache, to use. |
tls | Whether to use TLS, or TLS settings, for the connection. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
scheme | The URL scheme or protocol, for example https or postgres. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
database | The name of the database, or the database number for a cache, to use. |
tls | Whether to use TLS, or TLS settings, for the connection. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
scheme | The URL scheme or protocol, for example https or postgres. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
database | The name of the database, or the database number for a cache, to use. |
token | A bearer token or API key to authenticate with. Usually marked sensitive. |
tls | Whether to use TLS, or TLS settings, for the connection. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
scheme | The URL scheme or protocol, for example https or postgres. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
database | The name of the database, or the database number for a cache, to use. |
token | A bearer token or API key to authenticate with. Usually marked sensitive. |
tls | Whether to use TLS, or TLS settings, for the connection. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
tlsMode | How the SMTP connection uses TLS, for example starttls or tls. |
fromAddress | The email address that messages are sent from. |
toAddress | The email address that messages are sent to. |
| Value | Description |
|---|---|
url | A full connection URL, for example https://api.example.com or redis://cache:6379. |
hostname | The host name or IP address to connect to. |
port | The port number to connect to. |
username | The user name to authenticate with. |
password | The password to authenticate with. Usually marked sensitive. |
tlsMode | How the SMTP connection uses TLS, for example starttls or tls. |
fromAddress | The email address that messages are sent from. |
toAddress | The email address that messages are sent to. |
configurationHow the platform passes the connection details of the database to the workload, as environment variables.
Example: a workload that accepts either one PostgreSQL connection URL or separate host, port, user, password and database variables. The platform provides one of the two sets.
kind: datastore
interface:
type: relational
engine: postgres
configuration:
alternatives:
- env:
- property: url
name: DATABASE_URL
sensitive: true
- env:
- property: hostname
name: DB_HOST
- property: port
name: DB_PORT
- property: username
name: DB_USER
- property: password
name: DB_PASSWORD
sensitive: true
- property: database
name: DB_NAME
configurationHow the platform passes the connection details of the cache to the workload, as environment variables.
Example: a workload that needs a Redis cache and cannot start without its URL.
kind: cache
interface:
type: key_value
engine: redis
configuration:
env:
- property: url
name: REDIS_URL
required: true
configurationHow the platform passes the SMTP server details and email addresses to the workload, as environment variables.
Example: a workload that sends email through an SMTP server and reads the server, login and sender address from its environment.
kind: api
interface:
type: smtp
operations:
- send
configuration:
env:
- property: hostname
name: SMTP_HOST
required: true
- property: port
name: SMTP_PORT
- property: username
name: SMTP_USER
- property: password
name: SMTP_PASSWORD
sensitive: true
- property: fromAddress
name: MAIL_FROM
Dependencies
This extension adds to the extensions below. Declare them in the Profile too.
- rc/common-integrations v1alpha4