diff --git a/components/dependencies.mdx b/components/dependencies.mdx index 478786c..a70c791 100644 --- a/components/dependencies.mdx +++ b/components/dependencies.mdx @@ -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 diff --git a/deployments/secrets.mdx b/deployments/secrets.mdx index 1862ab3..ef9aa55 100644 --- a/deployments/secrets.mdx +++ b/deployments/secrets.mdx @@ -11,10 +11,12 @@ have registered the following two components: # ./component/architect.yml name: component dependencies: - dependency: latest + dependency: {} + secrets: secret_key: required: true + services: api: environment: @@ -22,11 +24,13 @@ services: # ./dependency/architect.yml name: dependency + secrets: username: required: true password: required: true + services: dependency: environment: @@ -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 diff --git a/reference/contexts-and-interpolation.mdx b/reference/contexts-and-interpolation.mdx index 19ea303..1c18b9f 100644 --- a/reference/contexts-and-interpolation.mdx +++ b/reference/contexts-and-interpolation.mdx @@ -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.` | `object` | Information on an ingress rule matching the interface. [See the interface values](/reference/contexts-and-interpolation/#interface-values) for more details. | ### `secrets` context @@ -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.` | `object` | | -| `databases..url` | `string` | Fully resolvable URL of the database (alias: `connection_string`) | -| `databases..host` | `string` | Hostname of the database | -| `databases..port` | `int` | Port the database is exposed on | -| `databases..protocol` | `string` | Protocol the database responds to | -| `databases..username` | `string` | Username used to authenticate with the database | -| `databases..password` | `string` | Password used to authenticate with the database | -| `databases..database` | `string` | The database (e.g. namespace) on the instance to be connected to | +| Property | Type | Description | +| --------------------------- | -------- | ----------------------------------------------------------------- | +| `databases` | `object` | | +| `databases.` | `object` | | +| `databases..url` | `string` | Fully resolvable URL of the database (alias: `connection_string`) | +| `databases..host` | `string` | Hostname of the database | +| `databases..port` | `int` | Port the database is exposed on | +| `databases..protocol` | `string` | Protocol the database responds to | +| `databases..username` | `string` | Username used to authenticate with the database | +| `databases..password` | `string` | Password used to authenticate with the database | +| `databases..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` | `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` | `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 @@ -127,7 +127,6 @@ services: app: environment: API_KEY: ${{ secrets.api_key }} -... ``` #### Referencing the internal address of another service @@ -148,7 +147,6 @@ services: interfaces: main: port: 8080 -... ``` #### Referencing the external address of another service @@ -172,7 +170,6 @@ services: port: 8080 ingress: subdomain: api -... ``` #### Referencing the address of a dependency @@ -191,7 +188,6 @@ services: port: 8080 ingress: subdomain: api -... ``` ```yml @@ -199,13 +195,12 @@ services: 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