---
title: "ezgh deploy resources attach"
description: "Have the environment manage an existing resource under a file key."
---

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

# ezgh deploy resources attach

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh deploy resources attach <key> <id>
```

Have the environment manage an existing resource (its product ID) under one of its file's keys, instead of creating one. You need the product's read and update rights on that resource.

Part of [`ezgh deploy resources`](/cli/reference/deploy-resources).

## Flags

Inherited from parent commands:

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--dir` | string | `.` | the repository's checkout (any directory inside it) |
| `--environment` | string |  | the environment, by ID (den\_…) or name (default: the stack's environment for the checked-out branch) |
| `--json` | boolean |  | print JSON, as -o json does |
| `--stack` | string |  | the stack, by ID (dps\_…) or name (default: the checkout's EZGHDeploy name) |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/deploy-resources-attach/index.mdx
