# Import & Export YAML Configuration The Zerops YAML configuration provides powerful capabilities for both importing and exporting projects and services. This documentation covers how to define your infrastructure as code and move configurations between environments. ## YAML Configuration Basics The Zerops YAML configuration can be used to create or replicate services in Zerops. You can import configurations in two ways: - **Using the GUI**: - **For projects**: In the Zerops dashboard, click on **Import a project** in the Projects section - **For services**: Navigate to a project's details page and click **Import services** in the services section - **Using the [CLI](/references/cli)**: Run `zcli project project-import` for projects or `zcli project service-import` for individual services Both methods provide straightforward ways to migrate or replicate infrastructure as needed. :::note The example above is a general guideline; not all keys are valid for every service type. For technology-specific details, refer to the **Create service** page in the **How To** section of the Zerops documentation. - `REQUIRED.` If a parent object is defined, the key-value pair is required to be filled. All other key-value pairs are optional. ::: ## Project Configuration The project configuration is used to define the project you want to import. ### Usage
| Field | Type | Description |
|---|---|---|
| project | object | _REQUIRED, if a whole project is imported_ Only one project can be defined. |
| name | string, REQUIRED | The name of the new project. Duplicates are allowed. |
| description | string | Description of the new project. |
| corePackage | string | [Core package](/features/infrastructure#project-core-options) of the new project. Values: LIGHT/SERIOUS (default LIGHT) |
| tags | list of strings | One or more string tags. Tags provide better orientation in projects. |
| envVariables | map[string]string | [Project-level environment variables](/features/env-variables#project-variables) that are available to all services in the project. |
| Field | Type | Description |
|---|---|---|
| services | list of objects, REQUIRED | At least one service is required. |
| hostname | string, REQUIRED | The unique service identifier. Limitations: - duplicates in the same project forbidden - maximum 25 characters, lowercase ASCII letters (a-z) or numbers (0-9) only |
| type | enum, REQUIRED | Specifies the service type and version. See [supported types](/references/import-yaml/type-list). |
| mode | enum | Values: HA / NON_HA (default NON_HA) Defines the operation mode of the service. |
| envSecrets | map[string]string | Environment variables that are blurred by default in Zerops GUI. Can be edited or deleted in Zerops GUI. |
| dotEnvSecrets | string (multiline) | Environment variables in .env file format that are automatically created as secret envs. |
| objectStorageSize | integer | Object storage size in GB. |
| objectStoragePolicy | enum | Values: **private / public-read / public-objects-read / public-write / public-read-write / custom** Select a predefined AWS S3 bucket access policy. |
| objectStorageRawPolicy | json | Define your own AWS S3 bucket access policy. See [AWS docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html) for details. Use `{{ .BucketName }}` placeholder if you need to use bucket name in your custom policy rules. |
| buildFromGit | string (URL) | A URL of a Github or Gitlab repository used for a one-time build of your service. |
| enableSubdomainAccess | boolean | Default: `false` Set `true`, if you want to enable a public access to your service via a Zerops subdomain. Not suitable for production. |
| priority | integer | Services are sorted before creation by priority in descending order, i.e. the higher the priority the sooner the service is created. |
| override | boolean | Default: `false` This only works for **runtime** services. The parameter allows you to replace an existing runtime service with the same hostname byt triggering a redeploy if the service already exists. |
| Field | Type | Description |
|---|---|---|
| minCpu | integer | Minimum number of virtual CPUs |
| maxCpu | integer | Maximum number of virtual CPUs |
| cpuMode | enum | Values: **SHARED / DEDICATED** |
| minRam | float | Minimum RAM in GB that each container of the service can scale down to. |
| maxRam | float | Maximum RAM in GB that each container of the service can scale up to. |
| minDisk | float | Minimum disk space in GB that each container of the service can scale down to. |
| maxDisk | float | Maximum disk space in GB that each container of the service can scale up to. |
| startCpuCoreCount | integer | Number of CPU cores with which each container starts. |
| minFreeCpuCores | float | Minimum number of unused CPU cores before a container starts scaling. |
| minFreeCpuPercent | float | Minimum percentage of unused CPU cores before a container starts scaling. |
| minFreeRamGB | float | Minimum unused memory in GB before a container starts scaling. |
| minFreeRamPercent | float | Minimum percentage of unused memory before a container starts scaling. |
| Field | Type | Description |
|---|---|---|
| minContainers | integer | Minimum number of containers of the service. Default: 1, maximum value: 10 |
| maxContainers | integer | Maximum number of containers of the service. Maximum value: 10 |
| Field | Type | Description |
|---|---|---|
| mount | list of strings | Mount shared storage to the service. `buildFromGit` must be filled. |
| Field | Type | Description |
|---|---|---|
| nginxConfig | string (multiline) | Insert full nginx config. |
| Field | Type | Description |
|---|---|---|
| zeropsSetup | string | Specifies which service setup to use. This should match a setup name found in either the `zeropsYaml` parameter (if provided) or the `zerops.yaml` file in the repository root. If not specified, defaults to the service hostname. |
| zeropsYaml | object | Contains the full [zerops.yaml configuration](/zerops-yaml/specification). If provided, this will be used instead of looking for a `zerops.yaml` file in the repository. |