Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Terraform in Yandex Cloud
  • Getting started
  • Solution library
    • Overview
    • Release notes
          • iam_oauth_client
          • iam_policy
          • iam_role
          • iam_service_account
          • iam_service_agent
          • iam_user
          • iam_workload_identity_federated_credential
          • iam_workload_identity_oidc_federation

In this article:

  • Example usage
  • Schema
  • Required
  • Read-Only
  • Nested Schema for binding
  1. Terraform reference
  2. Resources
  3. Identity and Access Management (IAM)
  4. Data Sources
  5. iam_policy

yandex_iam_policy (Data Source)

Written by
Yandex Cloud
Updated at September 11, 2025
  • Example usage
  • Schema
    • Required
    • Read-Only
    • Nested Schema for binding

Generates an IAM policy document that may be referenced by and applied to other Yandex Cloud Platform resources, such as the yandex_resourcemanager_folder resource.

This data source is used to define IAM policies to apply to other resources. Currently, defining a policy through a data source and referencing that policy from another resource is the only way to apply an IAM policy to a resource.

Example usageExample usage

//
// Get information about existing IAM Policy.
//
data "yandex_iam_policy" "admin" {
  binding {
    role = "admin"

    members = [
      "userAccount:user_id_1"
    ]
  }

  binding {
    role = "viewer"

    members = [
      "userAccount:user_id_2"
    ]
  }
}

SchemaSchema

RequiredRequired

  • binding (Block Set, Min: 1) Defines a binding to be included in the policy document. Multiple binding arguments are supported. (see below for nested schema)

Read-OnlyRead-Only

  • id (String) The ID of this resource.
  • policy_data (String) The above bindings serialized in a format suitable for referencing from a resource that supports IAM.

Nested Schema for Nested Schema for binding

Required:

  • members (Set of String) An array of identities that will be granted the privilege in the role. Each entry can have one of the following values:
  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
  • federatedUser:{federated_user_id}:: A unique saml federation user account ID.
  • group:{group_id}: A unique group ID.
  • system:group:federation:{federation_id}:users: All users in federation.
  • system:group:organization:{organization_id}:users: All users in organization.
  • system:allAuthenticatedUsers: All authenticated users.
  • system:allUsers: All users, including unauthenticated ones.

Warning

For more information about system groups, see the documentation.

  • role (String) The role/permission that will be granted to the members. See the IAM Roles documentation for a complete list of roles.

Was the article helpful?

Previous
iam_oauth_client
Next
iam_role
© 2025 Direct Cursus Technology L.L.C.