> For the complete documentation index, see [llms.txt](https://docs.cloudeka.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudeka.ai/guideline-for-enterprise/cloudeka-api-list/command-reference/cldkctl-flexi/instance/attach-interface.md).

# attach-interface

Attach an interface to a flexi instance in your project. This command allows you to attach an interface to a flexi instance.

## Usage

```
cldkctl flexi instance attach-interface [name] [flags]
```

## Steps

Follow the steps below to run and view the result of this command:

#### Interactive Mode

1. Run the following command in your terminal:

```
cldkctl flexi instance attach-interface [instance-name] -i true
```

2. Replace **\[instance-name]** with the name of the instance.
3. Select the **interface type**: **By VPC** or **By Port**.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2Fb2gkPZcRXiN8KdKZzk17%2F1.jpg?alt=media&amp;token=5a5e9e67-af07-4de0-8fa5-5533d7264aa5" alt=""><figcaption></figcaption></figure>

4. If you select **By VPC**, select the **VPC**.
5. Enter the **IP address** for the interface.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FelshmCRtUYz11KS2nxwd%2F2.jpg?alt=media&amp;token=e1ab31c3-db4e-4220-84bf-0e1fc71587ba" alt=""><figcaption></figcaption></figure>

6. If you select **By Port**, select the **port**.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FmSXnb3AKvRUk5ZULAVyd%2F3.jpg?alt=media&amp;token=9838758e-d65b-4e42-b439-d14d39797b72" alt=""><figcaption></figcaption></figure>

7. If a port is available, confirm the interface attachment by selecting **Confirm**

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FktQVCKOgtzDc4wuVKPE4%2F4.jpg?alt=media&amp;token=7e673a2b-dbfc-4269-9644-d0f743e6f28b" alt=""><figcaption></figcaption></figure>

**Note:** If no port is available, the CLI displays **“no port available, please select By VPC”** and requires you to select **By VPC** instead.

8. Once completed successfully, the terminal displays the success message.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2Fgit-blob-a73ed6da059d71113dc6a631f696d8c799b39eb9%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Non-Interactive Mode

1. Provide all required values using command flags.
2. Add `--auto-confirm true` or `-y true` to skip confirmation prompts in non-interactive mode.
3. Run the command in your terminal.
4. Once completed successfully, the terminal displays the success message.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FVmCYBnsttcWTHeIhmPx1%2F6%20non%20interacive.jpg?alt=media&amp;token=ab8b9845-1610-439c-b0d3-bba00676ba6d" alt=""><figcaption></figcaption></figure>

## Flags

{% hint style="info" %}
This command supports [global flags](/guideline-for-enterprise/cloudeka-api-list/global-flags.md). Refer to the Global Flags section for details
{% endhint %}

| Flag           | Shorthand | Default | Description                                                    |
| -------------- | --------- | ------- | -------------------------------------------------------------- |
| --auto-confirm | -y        | false   | Skip confirmation prompt in non-interactive mode (true/false)  |
| --help         | -h        |         | help for attach-interface                                      |
| --interactive  | -i        | false   | Run in interactive/TUI mode (true/false)                       |
| --ip-address   |           |         | IP Address (required when --type is vpc)                       |
| --port-id      |           |         | Port ID or name (required when `--type` is port)               |
| --project      | -p        |         | Specify project ID                                             |
| --type         |           |         | Interface type: vpc or port (required in non-interactive mode) |
| --vpc-id       |           |         | VPC ID or Name (required when --type is vpc)                   |
