• Application Load Balancer (ALB)
  • Audit Trails
  • Beta Resources
  • Certificate Manager
  • Client Config
  • Cloud Backup
  • Cloud Billing
  • Cloud Content Delivery Network (CDN)
  • Cloud Domain Name System (DNS)
  • Cloud Logging
  • Cloud Organization
  • Compute Cloud
  • Container Registry
  • Data Processing
  • Data Transfer
  • Datasphere
  • Identity and Access Management (IAM)
  • IoT Core
  • Key Management Service (KMS)
  • Load Testing
  • Lockbox (Secret Management)
  • Managed Kubernetes (MK8S) Marketplace
  • Managed Service for Apache Airflow
  • Managed Service for Apache Kafka
  • Managed Service for ClickHouse
  • Managed Service for Elasticsearch
  • Managed Service for Greenplum
  • Managed Service for Kubernetes (MK8S)
  • Managed Service for MongoDB
  • Managed Service for MySQL
  • Managed Service for OpenSearch
  • Managed Service for PostgreSQL
  • Managed Service for Redis
  • Managed Service for SQLServer
  • Managed Service for YDB
  • Message Queue
  • Monitoring
  • Network Load Balancer (NLB)
  • Object Storage (S3)
  • Resource Manager
  • Serverless Cloud Functions
  • Serverless Containers
  • Serverless Integrations
  • Smart Captcha
  • Smart Web Security (SWS)
  • Virtual Private Cloud (VPC)
  • Yandex API Gateway

yandex_storage_object (Resource)

Allows management of Yandex Cloud Storage Object.

Example 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"
  }
}

Argument Reference

The following arguments are supported:

  • bucket - (Required) The name of the containing bucket.

  • key - (Required) The name of the object once it is in the bucket.

  • source - (Optional, conflicts with content and content_base64) The path to a file that will be read and uploaded as raw bytes for the object content.

  • source_hash - (Optional) 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).

  • content - (Optional, conflicts with source and content_base64) Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

  • content_base64 - (Optional, conflicts with source and content) 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.

  • content_type - (Optional) 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.

  • access_key - (Optional) 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.

  • secret_key - (Optional) 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.

  • acl - (Optional) 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.

  • object_lock_legal_hold_status - (Optional) Specifies a legal hold status of an object. Requires object_lock_configuration to be enabled on a bucket.

  • object_lock_mode - (Optional) 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 - (Optional) 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.

  • tags - (Optional) Specifies an object tags.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - The key of the resource.

Import

~> Import for this resource is not implemented yet.

Предыдущая
Следующая