Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Identity and Access Management
    • All guides
    • Handling secrets that are available in the public domain
    • Users
    • User groups
      • Getting a list of supported policy templates
      • Creating a policy for a resource
      • Viewing policies created for a resource
      • Delete policy
  • Secure use of Yandex Cloud
  • Access management
  • Pricing policy
  • Role reference
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Creating an access policy for a folder
  • Creating an access policy for a cloud
  • Creating an access policy for an organization
  • Examples
  • Creating the serverless.restrictPrivateNetworkInvocation policy for a folder
  • Creating the serverless.restrictPublicInvocation policy for a folder
  1. Step-by-step guides
  2. Access policies
  3. Creating a policy for a resource

Creating an access policy for a resource

Written by
Yandex Cloud
Updated at April 3, 2026
  • Creating an access policy for a folder
  • Creating an access policy for a cloud
  • Creating an access policy for an organization
  • Examples
    • Creating the serverless.restrictPrivateNetworkInvocation policy for a folder
    • Creating the serverless.restrictPublicInvocation policy for a folder

Note

This feature is in the Preview stage. To get access, contact tech support or your account manager.

Access policies are a Yandex Identity and Access Management mechanism that allows you to manage permissions for specific operations with Yandex Cloud resources. Access policies are based on templates and complement the role system for more flexible access management.

You can create an access policy for a folder, cloud, or organization.

Note

To manage access policies, a user must have one of the following roles:

  • resource-manager.admin or admin for the folder or cloud to manage access policies at the folder or cloud level, respectively.
  • organization-manager.admin or admin for the organization to manage access policies at the organization level.

Creating an access policy for a folderCreating an access policy for a folder

To create a folder access policy from a template without additional parameters:

CLI
API

If you do not have the Yandex Cloud CLI yet, install and initialize it.

  1. Get a list of supported access policy templates with their IDs.

  2. Run this command:

    yc resource-manager folder bind-access-policy \
      --name <folder_name> \
      --access-policy-template-id=<policy_template_ID>
    

    Where:

    • --name: Name of the folder to create the policy for. Instead of the folder name, you can provide its ID in the --id parameter.
    • --access-policy-template-id: ID of the template to use as the basis for the new access policy for the folder.
  3. Make sure the policy was created.

Use the bindAccessPolicy REST API method for the Folder resource or the FolderService/BindAccessPolicy gRPC API call.

The created access policy will apply to all resources in the specified folder.

Creating an access policy for a cloudCreating an access policy for a cloud

To create an access policy for a cloud based on a template without additional parameters:

CLI
API

If you do not have the Yandex Cloud CLI yet, install and initialize it.

  1. Get a list of supported access policy templates with their IDs.

  2. Run this command:

    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 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.
  3. Make sure the policy was created.

Use the bindAccessPolicy REST API method for the Cloud resource or the CloudService/BindAccessPolicy gRPC API call.

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

Creating an access policy for an organizationCreating an access policy for an organization

To create an access policy for an organization based on a template without optional parameters:

CLI
API

If you do not have the Yandex Cloud CLI yet, install and initialize it.

  1. Get a list of supported access policy templates with their IDs.

  2. Run this command:

    yc organization-manager organization bind-access-policy \
      --name <organization_name> \
      --access-policy-template-id=<policy_template_ID>
    

    Where:

    • --name: Name of the organization you want to create a policy for. Instead of the organization name, you can provide its ID in the --id parameter.
    • --access-policy-template-id: ID of the template you want to use as the basis for the new access policy for the organization.
  3. Make sure the policy was created.

Use the bindAccessPolicy REST API method for the Organization resource or the OrganizationService/BindAccessPolicy gRPC API call.

The new access policy will apply to resources within all clouds in the specified organization.

All access policy templates without additional parameters are assigned for resources in the same way. For information on how to assign a policy template with additional parameters for a resource, see Examples.

ExamplesExamples

Creating the serverless.restrictPrivateNetworkInvocation policy for a folderCreating the serverless.restrictPrivateNetworkInvocation policy for a folder

The serverless.restrictPrivateNetworkInvocation policy limits calling functions and containers from Yandex Virtual Private Cloud's private IP addresses to explicitly specified cloud networks or specific IP addresses within them.

Note

The serverless.restrictPrivateNetworkInvocation policy requires an active service connection from Yandex Cloud Functions and Yandex Serverless Containers to Yandex Virtual Private Cloud.

To assign the serverless.restrictPrivateNetworkInvocation policy template for a folder:

CLI

No IP-based restriction

yc resource-manager folder bind-access-policy \
  --name "my-folder" \
  --access-policy-template-id=serverless.restrictPrivateNetworkInvocation \
  --parameters '"allowed_vpc_network_ids=[<network_1_ID>,<network_2_ID>,<network_3_ID>]","src_ip_restricted_network_ids=[]","allowed_src_ips=[]"'

Where allowed_vpc_network_ids is a list of cloud network IDs from which you can call functions and containers. Function and container calls will be allowed from any IP addresses within the subnets forming part of the specified cloud networks. In addition, there must be a cloud network from the mentioned list linked to the function/container.

You can provide a zero value for this parameter; in which case you must set an IP-based restriction in src_ip_restricted_network_ids and allowed_src_ips.

After you apply the policy in my-folder, you will only be able to use the private IP addresses to call those functions/containers that have linked cloud networks with the following IDs: <network_1_ID>, <network_2_ID>, and <network_3_ID>, and only from the IP addresses of the subnets belonging to those cloud networks.

With an IP-based restriction

yc resource-manager folder bind-access-policy \
  --name "my-folder" \
  --access-policy-template-id=serverless.restrictPrivateNetworkInvocation \
  --parameters '"allowed_vpc_network_ids=[]","src_ip_restricted_network_ids=[<network_1_ID>,<network_2_ID>,<network_3_ID>]","allowed_src_ips=[10.1.2.0/24,172.16.17.0/28,192.168.1.2/32]"'

Where:

  • src_ip_restricted_network_ids is a list of cloud network IDs from which you can call functions and containers, with an additional restrictions on allowed IP addresses. Function and container calls will be allowed from specific IP addresses belonging to specified cloud networks and explicitly named in allowed_src_ips. In addition, there must be a cloud network from the mentioned list linked to the function/container.

  • allowed_src_ips is a list of private IP addresses or IP address ranges in CIDR notation you can call functions and containers from.

    These IP addresses must belong to the cloud networks specified in src_ip_restricted_network_ids.

After you apply the policy in my-folder, you will only be able to use the private IP addresses to call those functions/containers that have linked cloud networks with the following IDs: <network_ID_1>, <network_ID_2>, and <network_ID_3>, and only from the IP addresses that belong to those cloud networks and the 10.1.2.0/24, 172.16.17.0/28, and 192.168.1.2/32 ranges at the same time.

Note

If allowed_vpc_network_ids has a non-zero value, the list of IP addresses specified by src_ip_restricted_network_ids and allowed_src_ips will be ignored.

Creating the serverless.restrictPublicInvocation policy for a folderCreating the serverless.restrictPublicInvocation policy for a folder

The serverless.restrictPublicInvocation policy restricts the ability to call functions and containers from public IP addresses.

To assign the serverless.restrictPublicInvocation policy template for a folder:

CLI
yc resource-manager folder bind-access-policy \
  --name "my-folder" \
  --access-policy-template-id=serverless.restrictPublicInvocation \
  --parameters '"allowed_src_ips=[198.51.100.104/29,192.0.2.4/30]"'

Where allowed_src_ip is a list of public IP addresses or IP address ranges in CIDR notation you can call functions and containers from.

After you apply the policy in my-folder using public IP addresses, you will be able to call functions/containers only from the IP addresses belonging to the 198.51.100.104/29 and 192.0.2.4/30 ranges.

See alsoSee also

  • Access policies
  • Getting a list of supported access policy templates
  • Viewing access policies created for a resource
  • Deleting an access policy

Was the article helpful?

Previous
Getting a list of supported policy templates
Next
Viewing policies created for a resource
© 2026 Direct Cursus Technology L.L.C.