Skip to content

Add Deployments

Add a Deployment, one Service in one Environment on one Deployment Target, so readers find where the Service runs and its URL there.

  • The Service is in the Model. See Add a Service.
  • The Environment is defined in workspace.yaml. Every Project shares it, so agree on a new one with the other Teams first. See environments.

Under targets, declare where Services run, nested as they nest. A platform Team usually declares the shared ones:

platform/targets.yaml
targets:
aws-eu-west-2:
name: AWS eu-west-2 (London)
kind: region
targets:
eks-prod:
name: EKS prod
kind: eks
eks-staging:
name: EKS staging
kind: eks
msk-prod:
name: MSK prod
kind: msk
london-dc:
name: London data center
kind: dc
owner: core-banking
targets:
zos-prod:
name: z/OS production LPAR
kind: lpar
zos-test:
name: z/OS test LPAR
kind: lpar

Other Projects use a Deployment Target by its Qualified id, as platform:eks-prod. Every field is in the targets reference.

Under deployments, add one entry per Service, Environment and Target, with its url:

platform/deployments.yaml
deployments:
- service: email-system
environment: prod
target: eks-prod
url: https://mail.bigbank.example
- service: kafka
environment: prod
target: msk-prod
endpoints:
- name: bootstrap
url: https://kafka.bigbank.example:9094
- service: kafka
environment: staging
target: eks-staging

A Service that serves no HTTP, such as a database, has no url. The other fields, such as endpoints, are in the deployments reference.

Terminal window
archidocs check
0 errors, 0 warnings

Run archidocs dev, select the Service and use Where is it deployed?. Or open the Environment’s Deployment View, such as deployment/prod.

check catches an environment that workspace.yaml doesn’t define:

shop/deployments.yaml · fails check: unknown-environment
targets:
eu-west-1:
name: EU West 1
kind: region
deployments:
- service: web
environment: production
target: eu-west-1
url: https://shop.example.com
archidocs/shop/deployments.yaml:7:18 error unknown-environment Unknown Environment "production"; did you mean "prod"?
1 error, 0 warnings
Rule docs:
unknown-environment https://archidocs.dev/docs/reference/rules/unknown-environment/

That is unknown-environment: use the name it suggests.

check reports unknown-target when target names no Deployment Target. Check the Qualified id.

upsert_target and upsert_deployment write them. upsert_environment adds an Environment.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.