Yandex Cloud
Search
Contact UsTry it for free
  • 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
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Object Storage
    • All guides
      • Creating a bucket
      • Deleting a bucket
      • Limiting the maximum size of a bucket
      • Encrypting a bucket
      • Managing object lifecycles
      • Managing CORS configurations
      • Configuring access permissions using IAM
      • Editing a bucket's ACL
      • Managing access policies
      • Configuring public access to a bucket
      • Accessing a bucket using Security Token Service
      • Accessing a bucket using a service connection from VPC
      • Managing bucket versioning
      • Enabling logging
      • Managing object locks
      • Managing bucket labels
      • Getting bucket information and statistics
      • Viewing bucket metrics
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Bucket logs
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Buckets
  3. Configuring access permissions using IAM

Configuring access permissions for a bucket using Identity and Access Management

Written by
Yandex Cloud
Improved by
Tania L.
Updated at December 3, 2025

Object Storage incorporates several access management mechanisms. To learn how these mechanisms interact, see Access management methods in Object Storage: Overview.

To configure access to a bucket using Identity and Access Management, assign a user, user group, or service account a role for that bucket:

Management console
Terraform
API
  1. In the management console, select a folder.
  2. Go to Object Storage.
  3. Click the name of the bucket you want to grant access to.
  4. In the left-hand menu, select Security.
  5. Navigate to the Access bindings tab.
  6. Click Assign roles.
  7. Select a user from the list or use the user search option.
  8. Click Add role.
  9. Select a role for the user.
  10. Click Save.

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the relevant documentation on the Terraform website or its mirror.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

To assign a role for a bucket using Terraform:

  1. In the Terraform configuration file, describe the resources you want to create:

    resource "yandex_storage_bucket_iam_binding" "mybucket-viewers" {
      bucket  = "<bucket_name>"
      role    = "<role>"
      members = [
                  "<subject_type>:<subject_ID>",
                  "serviceAccount:<service_account_ID>",
                  "userAccount:<user_ID>"
                ]
    }
    
    # Example of assigning the `storage.editor` role to service accounts
    resource "yandex_storage_bucket_iam_binding" "sa-editors" {
      bucket  = "<bucket_name>"
      role    = "storage.editor"
      members = [
                  "serviceAccount:<service_account_1_ID>",
                  "serviceAccount:<service_account_2_ID>"
                ]
    }
    
    # Example of assigning the `storage.admin` role to users 
    resource "yandex_storage_bucket_iam_binding" "users-admins" {
      bucket  = "<bucket_name>"
      role    = "storage.admin"
      members = [
                  "userAccount:<user_1_ID>",
                  "userAccount:<user_2_ID>"
                ]
    }
    

    Where:

    • bucket: Bucket name.

    • role: Role.

      Warning

      You cannot use the yandex_storage_bucket_iam_binding resource to assign primitive roles, such as viewer, editor, or admin for a bucket if the yandex_storage_bucket_grant resource or the acl or grant parameters of the yandex_storage_bucket resource are used simultaneously.

    • members: Types and IDs of entities assigned the role. Specify it as userAccount:<user_ID> or serviceAccount:<service_account_ID>.

    For more information about yandex_storage_bucket_iam_binding resource properties, see this provider guide.

  2. If you intend to use the yandex_storage_bucket_iam_binding resource together with yandex_storage_bucket_grant for the same bucket, we recommend creating them sequentially. To do this, add a dependency on the yandex_storage_bucket_grant resource to the yandex_storage_bucket_iam_binding section.

    resource "yandex_storage_bucket_iam_binding" "mybucket-viewers" {
      ...
    
      depends_on = [
        yandex_storage_bucket_grant.my_bucket_grant
      ]
    }
    
  3. Apply the configuration:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. Make sure the configuration file is correct using this command:

      terraform validate
      

      If the configuration is correct, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

    You can check the resource update using the management console.

Use the updateAccessBindings REST API method for the Bucket resource or the BucketService/UpdateAccessBindings gRPC API call.

You can also assign a role for a bucket in Identity and Access Management.

Was the article helpful?

Previous
Managing CORS configurations
Next
Editing a bucket's ACL
© 2025 Direct Cursus Technology L.L.C.