> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validio.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Validio Code FAQ

> Find answers to common questions about Validio Code, including namespaces, apply behavior, and resource naming.

Find answers to common questions about using [Validio Code](https://docs.validio.io/v10.3/developer/validio-code.md), including namespaces, apply behavior, and resource naming.

## What namespace does the Validio GUI use?

Resources created in the GUI are assigned to the namespace `default`. To avoid conflicts, you should **not** use this namespace in your Validio Code (IaC) projects.

> [!NOTE]
>
> A project's namespace is displayed in the `validio.json` file in the project directory.

## What happens if I run `apply` multiple times?

Running `apply` multiple times is fine because each run is an independent operation. Before any changes are applied, Validio compares the contents of your manifest with the contents on the server. If they contain the same configuration, no changes are made.

## What is the difference between name and resource name?

"Name" and "resource name" are effectively the same in the context of IaC. They represent a globally unique name that you give the resource, and can be used to identify a resource without looking up the generated ID.

Since every IaC object is a resource, calling it "resource name" would be redundant, so it is just called "name". This is not to be confused with the **Name** field in the GUI, which represents a display name.

## How can I move all resources from the GUI into code?

You can move all resources from any namespace into a new Validio Code project. Because all GUI resources use the `default` namespace, you can move everything from that namespace into a new or existing project.

The following example creates a new Validio Code project and moves the GUI resources into it using the `import` command:

```bash title="Bash" theme={null}
validio code init --namespace my-iac-namespace
validio code import --import-namespace default --output main.py
```

> [!NOTE]
>
> The file specified with `--output` is overwritten. Ensure that it doesn't contain code you want to keep.

## Why do I get the error "Resource \<resource\_name> already exists"?

This error happens when a resource with the same name exists in a different namespace. Resource names need to be unique across the Validio platform, because the value is used to identify an exact resource and link it to other related resources.

One way to manage resource names is to create a function that generates a unique prefix or suffix for your current project, as shown in the following example:

```python title="Python" theme={null}
PROJECT_NAME = "my_project"

def name(resource_name: str) -> str:
    return f"{resource_name}_{PROJECT_NAME}"
```

## Can I change the name of a validator or source using IaC?

No. The name is a unique global identifier and cannot be changed. Resource names are also used to link related resources together. Changing the name would be equivalent to removing the resource, creating a new resource, and then stitching together all of the relationships with the new resource.

## Why are my sources not started after I created them?

Sources cannot be started when they don't have any validators. Because new sources do not have validators, sources are not started after they're created by default. With IaC you can specify validators, but these resources are applied asynchronously, and there's no guarantee that all validators exist when the source is created.

To start your sources after applying your manifest, use the CLI:

```bash title="Bash" theme={null}
validio code apply --auto-approve && validio sources start my_source
```

## How do I import and use credentials if I don't know their secret values?

For security reasons, when you import resources into your IaC project, Validio does not expose any encrypted or sensitive data. Instead, the credential is moved and added to your manifest with the flag `ignore_changes` set to `True`. This flag ensures that the import ignores the fact that the secret value changes from its set value to an empty value in your manifest.
