[Yandex Cloud documentation](../../../index.md) > [Yandex Resource Manager](../../index.md) > [Step-by-step guides](../index.md) > Cloud > Managing access policies

# Managing cloud access policies

{% note info %}

This feature is in the [Preview](../../../overview/concepts/launch-stages.md) stage. To get access, contact [tech support](https://center.yandex.cloud/support) or your account manager.

{% endnote %}

[Access policies](../../../iam/concepts/access-control/access-policies.md) are a Yandex Identity and Access Management mechanism that allows you to manage permissions for specific operations with [Yandex Cloud resources](../../../overview/roles-and-resources.md). Access policies are based on [templates](../../../iam/concepts/access-control/access-policies.md#supported-policies) and complement the [role](../../../iam/concepts/access-control/roles.md) system for more flexible [access management](../../../iam/concepts/access-control/index.md).

The [cloud](../../concepts/resources-hierarchy.md#cloud) access policies can be managed by users with the [`resource-manager.admin`](../../security/index.md#resource-manager-admin) or [`admin`](../../../iam/roles-reference.md#admin) role for the cloud.

## Creating an access policy for a cloud {#assign}

To create an access policy for a [cloud](../../concepts/resources-hierarchy.md#cloud) based on a [template without parameters](../../../iam/concepts/access-control/access-policies.md#fixed):

{% list tabs group=instructions %}

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  1. [Get](../../../iam/operations/access-policies/list.md) a list of supported access policy templates with their IDs.
  1. Run this command:

      ```bash
      yc resource-manager cloud bind-access-policy \
        --name <cloud_name> \
        --access-policy-template-id=<policy_template_ID>
      ```

      Where:

      * `--name`: Name of the cloud to create the policy for. Instead of the cloud name, you can provide its [ID](get-id.md) in the `--id` parameter.
      * `--access-policy-template-id`: ID of the template to use as the basis for the new access policy for the cloud.
  1. [Make sure](manage-access-policies.md#view-assigned) the policy was created.

- API {#api}

  Use the [bindAccessPolicy](../../api-ref/Cloud/bindAccessPolicy.md) REST API method for the [Cloud](../../api-ref/Cloud/index.md) resource or the [CloudService/BindAccessPolicy](../../api-ref/grpc/Cloud/bindAccessPolicy.md) gRPC API call.

{% endlist %}

The new access policy will apply to resources within all folders in the specified cloud.

## Viewing the list of your cloud's access policies {#view-assigned}

To view the list of [cloud](../../concepts/resources-hierarchy.md#cloud) access policies:

{% list tabs group=instructions %}

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  Run the command, specifying the name or [ID](get-id.md) of the cloud for which you want to view the created policies:

  ```bash
  yc resource-manager cloud list-access-policy-bindings <cloud_name_or_ID>
  ```

  Result:

  ```
  +---------------------------------------------+-------------------------------------------------+
  |          ACCESS POLICY TEMPLATE ID          |                   PARAMETERS                    |
  +---------------------------------------------+-------------------------------------------------+
  | backup.denyRemoveProtection                 |                                                 |
  | serverless.containers.restrictNetworkAccess | allowed_vpc_network_ids=[enphfcfseu9i********], |
  |                                             | allowed_src_ips=[192.168.1.12/24]               |
  +---------------------------------------------+-------------------------------------------------+
  ```

- API {#api}

  Use the [listAccessPolicyBindings](../../api-ref/Cloud/listAccessPolicyBindings.md) REST API method for the [Cloud](../../api-ref/Cloud/index.md) resource or the [CloudService/ListAccessPolicyBindings](../../api-ref/grpc/Cloud/listAccessPolicyBindings.md) gRPC API call.

{% endlist %}

## Deleting an access policy created for a cloud {#revoke}

To delete an access policy created for a [cloud](../../concepts/resources-hierarchy.md#cloud):

{% list tabs group=instructions %}

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  1. [Get](manage-access-policies.md#view-assigned) a list of IDs of access policy templates assigned for the cloud.
  1. Run this command:

      ```bash
      yc resource-manager cloud unbind-access-policy \
        --name <cloud_name> \
        --access-policy-template-id=<policy_template_ID>
      ```

      Where:

      * `--name`: Name of the cloud that you want to delete the policy for. Instead of the cloud name, you can provide its [ID](get-id.md) in the `--id` parameter.
      * `--access-policy-template-id`: ID of the access policy template you want to delete from the specified cloud.
  1. [Make sure](manage-access-policies.md#view-assigned) the policy was deleted.

- API {#api}

  Use the [unbindAccessPolicy](../../api-ref/Cloud/unbindAccessPolicy.md) REST API method for the [Cloud](../../api-ref/Cloud/index.md) resource or the [CloudService/UnbindAccessPolicy](../../api-ref/grpc/Cloud/unbindAccessPolicy.md) gRPC API call.

{% endlist %}

The specified access policy will no longer apply to resources within all folders in the given cloud.

#### Useful links {#see-also}

* [Access policies](../../../iam/concepts/access-control/access-policies.md)