Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • ИИ для бизнеса
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Калькулятор цен
    • Тарифы
    • Промоакции и free tier
    • Правила тарификации
  • Истории успеха
  • Документация
  • Блог
Проект Яндекса
© 2025 ООО «Яндекс.Облако»
Terraform в Yandex Cloud
  • Начало работы
  • Библиотека решений
    • Обзор
    • История изменений (англ.)
          • storage_bucket
          • storage_bucket_grant
          • storage_bucket_iam_binding
          • storage_bucket_policy
          • storage_object

В этой статье:

  • Example usage
  • Schema
  • Required
  • Optional
  • Read-Only
  • Import
  1. Справочник Terraform
  2. Ресурсы (англ.)
  3. Object Storage (S3)
  4. Resources
  5. storage_object

yandex_storage_object (Resource)

Статья создана
Yandex Cloud
Обновлена 11 сентября 2025 г.
  • Example usage
  • Schema
    • Required
    • Optional
    • Read-Only
  • Import

Allows management of Yandex Cloud Storage Object.

Example usageExample usage

//
// Create a new Storage Object in Bucket.
//
resource "yandex_storage_object" "cute-cat-picture" {
  bucket = "cat-pictures"
  key    = "cute-cat"
  source = "/images/cats/cute-cat.jpg"
  tags = {
    test = "value"
  }
}

SchemaSchema

RequiredRequired

  • bucket (String) The name of the containing bucket.
  • key (String) The name of the object once it is in the bucket.

OptionalOptional

  • access_key (String) The access key to use when applying changes. This value can also be provided as storage_access_key specified in provider config (explicitly or within shared_credentials_file) is used.
  • acl (String) The predefined ACL to apply. Defaults to private.

Важно

To change ACL after creation, the service account to which used access and secret keys correspond should have storage.admin role, though this role is not necessary to be able to create an object with any ACL.

  • content (String) Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. Conflicts with source and content_base64.
  • content_base64 (String) Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file. Conflicts with source and content.
  • content_type (String) A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.
  • object_lock_legal_hold_status (String) Specifies a legal hold status of an object. Requires object_lock_configuration to be enabled on a bucket.
  • object_lock_mode (String) Specifies a type of object lock. One of ["GOVERNANCE", "COMPLIANCE"]. It must be set simultaneously with object_lock_retain_until_date. Requires object_lock_configuration to be enabled on a bucket.
  • object_lock_retain_until_date (String) Specifies date and time in RTC3339 format until which an object is to be locked. It must be set simultaneously with object_lock_mode. Requires object_lock_configuration to be enabled on a bucket.
  • secret_key (String, Sensitive) The secret key to use when applying changes. This value can also be provided as storage_secret_key specified in provider config (explicitly or within shared_credentials_file) is used.
  • source (String) The path to a file that will be read and uploaded as raw bytes for the object content. Conflicts with content and content_base64.
  • source_hash (String) Used to trigger object update when the source content changes. So the only meaningful value is `filemd5("path/to/source"). The value is only stored in state and not saved by Yandex Storage.
  • tags (Map of String) The tags object for setting tags (or labels) for bucket. See Tags for more information.

Read-OnlyRead-Only

  • id (String) The ID of this resource.

ImportImport

Важно

Import for this resource is not implemented yet.

Была ли статья полезна?

Предыдущая
storage_bucket_policy
Следующая
resourcemanager_cloud
Проект Яндекса
© 2025 ООО «Яндекс.Облако»