Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • 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
      • Managing static access keys
      • Managing API keys
      • Managing authorized keys
      • Creating a temporary access key using Security Token Service
      • Managing ephemeral access keys
  • 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 ephemeral access key
  • Testing bucket access
  1. Step-by-step guides
  2. Authentication
  3. Managing ephemeral access keys

Managing ephemeral access keys

Written by
Yandex Cloud
Updated at July 8, 2026
View in Markdown
  • Creating an ephemeral access key
  • Testing bucket access

Some Yandex Cloud services support authentication with ephemeral access keys.

Ephemeral access keys are created for Yandex accounts, federated accounts, local users, and service accounts.

To create an ephemeral access key, the user needs the iam.serviceAccounts.ephemeralAccessKeyAdmin role or higher for the folder.

Creating an ephemeral access keyCreating an ephemeral access key

Note

Creating ephemeral access keys for service accounts may be prohibited by access policies at the folder, cloud, or organization level.

Yandex Cloud CLI
API

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

The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. View the description of the command for creating an ephemeral access key:

    yc iam access-key issue-ephemeral --help
    
  2. Create an ephemeral access key:

    yc iam access-key issue-ephemeral \
      --subject-id <account_ID> \
      --session-name <session_name> \
      --policy <file_path> \
      --duration <lifespan>
    

    Where:

    • --subject-id: Service account ID. If this parameter is not specified, the system will generate the key for the user sending the request.
    • --session-name: Session name, 1 to 64 characters long. It is required for identifying a session if the service account is impersonated for multiple users. This is a required setting.
    • --policy: Path to the access policy file as a data schema in JSON format. It this parameter is not specified, the key will grant full bucket access.
    • --duration: Key lifespan, from 15m to 12h. It this parameter is not specified, the key lifespan will be limited to that of the current session's IAM token.

    Result:

    access_key_id: ajelprpohp8t********
    secret: YCOs05v-KRXqhYpUINdWArH4MINhMyJ6CGU********
    session_token: s1.9muilY********
    expires_at: "2025-12-16T06:23:51.383485065Z"
    
  3. Save access_key_id, the secret key, and session_token. You will not be able to get these values again.

Use the createEphemeral REST API method for the TemporaryAccessKey resource or the TemporaryAccessKeyService/CreateEphemeral gRPC API call.

Testing bucket accessTesting bucket access

AWS CLI
  1. Make sure the account you created the ephemeral access key for has access to the relevant bucket. If it does not, assign your account the required role, e.g., storage.viewer, for the bucket.

    Alternatively, you can use ACL permissions for a bucket.

  2. Add a new profile to ~/.aws/credentials:

    [<profile_name>]
    aws_access_key_id     = <key_ID>
    aws_secret_access_key = <secret_key>
    aws_session_token     = <session_token>
    

    Specify in your profile the values you got when creating the ephemeral access key:

    • aws_access_key_id: access_key_id key ID.
    • aws_secret_access_key: secret key.
    • aws_session_token: session_token.
  3. Save to the client device the object from the prefix of the bucket access was granted to:

    aws --endpoint https://storage.yandexcloud.net s3 cp \
      s3://<bucket_name>/<prefix><object_name> ./
    

    Result:

    download: s3://<bucket_name>/<prefix><object_name> to ./<object_name>
    

Useful linksUseful links

  • Access management methods in Object Storage: Overview
  • Creating a temporary access key using Security Token Service
  • Accessing a bucket using an ephemeral access key

Was the article helpful?

Previous
Creating a temporary access key using Security Token Service
Next
Viewing the status of services
© 2026 Direct Cursus Technology L.L.C.