> Index of every page on this site: [llms.txt](https://docs.a-line.cloud/llms.txt)

# Import

> Create projects and organization resources from a Git repository or a pasted document, and what an export leaves out.

The dashboard's Import dialog has two options.

## From a Git repository

Pick a repository, a branch and the directory that holds a
[`project.yaml`](/iac/reference/project-file). A-Line.cloud creates the
project, links it to that directory and runs the first apply. From then on
the repository is the project's source of truth, as described in
[GitOps](/iac/gitops).

Before creating anything, the dialog shows a preview that writes nothing.
The import is refused when the project name is taken in the environment
(`409`), when the GitHub connection can't read the repository's contents,
and when the branch or the `project.yaml` doesn't exist. Importing only
reads the repository, so write access is not needed.

Previewing and importing need the member role in the target environment.
See [who can do what](/iac/permissions) for the other link actions.

## Paste or upload a document

Paste or upload a single project file, or an organization bundle that holds
organization resources and several projects. An export of an organization
has the same shape, so you can copy resources from one organization to
another.

```yaml title="a-line-org.yaml" iac
# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1
kind: org
tenant:
  buckets:
    - name: assets
      quota_gb: 50
  storages:
    - name: archive
      endpoint: https://s3.example.net
      region: eu-central-1
      bucket: archive
  domains:
    - name: example.com
      scope: domain
projects:
  - name: shop
    environment: prod
    egress:
      mode: public
```

| Key | Meaning |
| --- | --- |
| `kind` | Always `org`. |
| `tenant` | `buckets`, `storages`, `domains` (with `name` and `scope`) and `dns_zones`. |
| `projects` | Projects, each with the [project file](/iac/reference/project-file) keys plus `environment`, the environment to create it in. It can be left out when the organization has one environment. |

The document is at most 512 KiB, and an organization can plan at most 10
imports an hour (`import_rate_limited`).

### Plan, then apply

An import first shows a plan: one row per resource with what will happen.
Nothing is written until you confirm it.

| Row | Meaning |
| --- | --- |
| Create | The resource is created. |
| Pending verification | The domain is claimed and must be [verified](/iac/domains#verify) before it can be used. |
| Reuse | A resource with that name exists and is kept as it is. |
| Conflict | A resource with that name exists; the import is refused with `name_taken`. |
| Skip | Apps are listed but not created: add them through a link or in the dashboard. |

A name that already exists is a conflict by default. Choose to reuse
existing resources to keep them instead. Other refusals:

| Code | Why |
| --- | --- |
| `zones_unsupported` | DNS zones can't be imported yet. Create them in the dashboard or with a [zone file](/iac/domains#zones). |
| `environment_not_found`, `environment_required` | The project's environment doesn't exist, or is missing while the organization has several. |
| `no_cluster` | The environment has no cluster to create the project in. |
| `forbidden` | Organization resources and project quotas need an organization admin; projects need an environment admin. |

An import only creates. The resources it creates are not managed by a link:
a link that later declares one with the same name adopts it.

## Secrets stay out

Neither format carries credentials: a storage entry has no access keys, and
its connection waits for them to be entered in the dashboard.

## What an export leaves out

An export writes what is stored and applied, as files. Exporting a project
needs an environment admin, exporting the organization an organization admin.
Linking an existing project writes the same files to its directory: as a
commit in direct mode, or as an "Add A-Line config" pull request in
pull-request mode, with the link pending until it is merged. A read-only link
exports through the same pull request (the export needs the write-back App);
after that, the console only shows the project (see
[change modes](/iac/gitops#write-back)). Creating a project from a
repository in read-only mode writes nothing and needs no write-back App.

| Left out | Instead |
| --- | --- |
| Environment variable values | Each key is written as its reference, or as `external: true` for a plain value. |
| Secret values | Only the names of the app's secret groups are listed. |
| Storage credentials | The storage is listed without access keys. |
| Held changes that are not confirmed yet | Only applied state is written. |
| A workload namespace's on switch | It has no file form; the egress and quota keys are written. |
| Default settings | Public outbound traffic, unset quotas, `isolated: false`, no connections and an app's default DNS target are left out, so the file doesn't take ownership of them. A single HTTP port is written as `port`. |
