---
title: "ezgh iam policies attach"
description: "Attach a policy to a user, bot or group."
---

> 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 iam policies 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 iam policies attach <policy> (--user u | --bot b | --group g) [flags]
```

Attach one policy to a user, bot or group, leaving its other policies alone. Attaching one that's already attached changes nothing; detaching one that isn't is an error.

Part of [`ezgh iam policies`](/cli/reference/iam-policies).

## Examples

```sh
ezgh iam policies attach ReadOnlyAccess --bot deployer
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--bot` | string |  | a bot, by ID, slug or name |
| `--group` | string |  | a group, by ID, slug or name |
| `--user` | string |  | a user, by ID or email |

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

Source: https://docs.ezghcloud.com/cli/reference/iam-policies-attach/index.mdx
