Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions components/dependencies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,26 @@ easier than ever for developers to extend cloud services.

```yaml
dependencies:
authentication: latest
authentication: {}

services:
my-api:
interfaces:
http: 8080
environment:
AUTH_INTERNAL: ${{ dependencies['authentication'].services.auth.interfaces.main.url }}
AUTH_INTERNAL: ${{ dependencies.authentication.services.auth.interfaces.main.url }}
AUTH_EXTERNAL: ${{
dependencies['authentication'].services.auth.interfaces.main.ingress.url
dependencies.authentication.services.auth.interfaces.main.ingress.url
}}
```

Just like with your favorite package manager, developers can cite the names and
versions of the components that they need to make calls to. Not only will this
allow Architect to provision the dependency automatically, it will also allow
developers to pin to specific versions and ensure that the APIs don't change out
from under them.
Just like with your favorite package manager, developers can cite the names
of the components that they need to make calls to. A tagged version of the dependency
can optionally be included as part of the `architect deploy` command. If no tag is
specified, the `latest` tag is implied. If the dependency already is deployed to the
remote environment, instead of deploying the version specified in the `architect.yml`, the currently
deployed version is used. This behavior can be overriden by specifying the tag in the
`deploy` command (e.g. `architect deploy my-app:latest my-dependency:my-tag`).

## Dependency referencing syntax

Expand Down
7 changes: 6 additions & 1 deletion deployments/secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ have registered the following two components:
# ./component/architect.yml
name: component
dependencies:
dependency: latest
dependency: {}

secrets:
secret_key:
required: true

services:
api:
environment:
SECRET_KEY: ${{ secrets.secret_key }}

# ./dependency/architect.yml
name: dependency

secrets:
username:
required: true
password:
required: true

services:
dependency:
environment:
Expand Down Expand Up @@ -57,6 +61,7 @@ in .yml format, or a .env file.
# secrets.yml
component:
secret_key: my-secret-key

dependency:
username: my-username
password: my-password
Expand Down
53 changes: 24 additions & 29 deletions reference/contexts-and-interpolation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ addresses of dependency interfaces.
The `ingresses` context contains information about the external exposed
interfaces.

| Property | Type | Description |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `ingresses` | `object` | Information on the ingress rules of the component |
| Property | Type | Description |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ingresses` | `object` | Information on the ingress rules of the component |
| `ingresses.<interface>` | `object` | Information on an ingress rule matching the interface. [See the interface values](/reference/contexts-and-interpolation/#interface-values) for more details. |

### `secrets` context
Expand Down Expand Up @@ -75,31 +75,31 @@ The `databases` context contains dynamic information about all the databases
inside the component. This context is primarily used to refer to the address
and credentials of each database instance.

| Property | Type | Description |
| ----------------------------- | ----------- | ---------------------------------------------- |
| `databases` | `object` | |
| `databases.<name>` | `object` | |
| `databases.<name>.url` | `string` | Fully resolvable URL of the database (alias: `connection_string`) |
| `databases.<name>.host` | `string` | Hostname of the database |
| `databases.<name>.port` | `int` | Port the database is exposed on |
| `databases.<name>.protocol` | `string` | Protocol the database responds to |
| `databases.<name>.username` | `string` | Username used to authenticate with the database |
| `databases.<name>.password` | `string` | Password used to authenticate with the database |
| `databases.<name>.database` | `string` | The database (e.g. namespace) on the instance to be connected to |
| Property | Type | Description |
| --------------------------- | -------- | ----------------------------------------------------------------- |
| `databases` | `object` | |
| `databases.<name>` | `object` | |
| `databases.<name>.url` | `string` | Fully resolvable URL of the database (alias: `connection_string`) |
| `databases.<name>.host` | `string` | Hostname of the database |
| `databases.<name>.port` | `int` | Port the database is exposed on |
| `databases.<name>.protocol` | `string` | Protocol the database responds to |
| `databases.<name>.username` | `string` | Username used to authenticate with the database |
| `databases.<name>.password` | `string` | Password used to authenticate with the database |
| `databases.<name>.database` | `string` | The database (e.g. namespace) on the instance to be connected to |

### `interface values`

Interface values are referenced in many places, `dependencies` and `services` with a set of uniform values available to reference. These values include:

| Property | Type | Description |
| ---------- | ----------- | ---------------------------------- |
| `url` | `string` | The fully composed URL of the reference interface. This will take the format, `<protocol>://<username>:<password>@<host>:<port><path>`. |
| `protocol` | `string` | The protocol of the interface being referenced. This will always be the specific value assigned to the interface by the developer. |
| `username` | `string` | The username of the interface being referenced. Not all interfaces have usernames, so this will be an empty string if none is set. |
| `password` | `string` | The password of the interface being referenced. Not all interfaces have passwords, so this will be an empty string if none is set. |
| `host` | `string` | The host value of the interface being referenced. This value is usually dynamic to accomodate the differences between service discovery solutions available to each environment. |
| `port` | `int` | The port value of the interface being referenced. This will not always be the specific port that the interface is listening on as many container clusters leverage port mapping to ensure that there are no port collisions when sharing hardware in a cluster. |
| `path` | `string` | The path value of the interface being referenced. Not all interfaces have paths, so this will be an empty string if none is set. |
| Property | Type | Description |
| ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `url` | `string` | The fully composed URL of the reference interface. This will take the format, `<protocol>://<username>:<password>@<host>:<port><path>`. |
| `protocol` | `string` | The protocol of the interface being referenced. This will always be the specific value assigned to the interface by the developer. |
| `username` | `string` | The username of the interface being referenced. Not all interfaces have usernames, so this will be an empty string if none is set. |
| `password` | `string` | The password of the interface being referenced. Not all interfaces have passwords, so this will be an empty string if none is set. |
| `host` | `string` | The host value of the interface being referenced. This value is usually dynamic to accomodate the differences between service discovery solutions available to each environment. |
| `port` | `int` | The port value of the interface being referenced. This will not always be the specific port that the interface is listening on as many container clusters leverage port mapping to ensure that there are no port collisions when sharing hardware in a cluster. |
| `path` | `string` | The path value of the interface being referenced. Not all interfaces have paths, so this will be an empty string if none is set. |

## Interpolation

Expand Down Expand Up @@ -127,7 +127,6 @@ services:
app:
environment:
API_KEY: ${{ secrets.api_key }}
...
```

#### Referencing the internal address of another service
Expand All @@ -148,7 +147,6 @@ services:
interfaces:
main:
port: 8080
...
```

#### Referencing the external address of another service
Expand All @@ -172,7 +170,6 @@ services:
port: 8080
ingress:
subdomain: api
...
```

#### Referencing the address of a dependency
Expand All @@ -191,21 +188,19 @@ services:
port: 8080
ingress:
subdomain: api
...
```

```yml
# architect.yml of the app component
name: app

dependencies:
api: latest
api: {}

services:
app:
environment:
API_ADDRESS: ${{ dependencies.api.services.api.interfaces.main.ingress.url }}
...
```

### Example of a simple component with interpolation
Expand Down