Skip to content

Latest commit

 

History

History
155 lines (102 loc) · 4.63 KB

cloud_project_storage.md

File metadata and controls

155 lines (102 loc) · 4.63 KB
subcategory
Object Storage

ovh_cloud_project_storage

Create S3™* compatible storage container (* S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.)

~> When destroying a storage container, the provider will try to remove all objects it contains beforehand. This process can fail if the bucket contains locked objects. In this case, you will have to remove these objects manually before being able to run terraform destroy again.

Example Usage

resource "ovh_cloud_project_storage" "storage" {
  service_name = "<public cloud project ID>"
  region_name = "GRA"
  name = "my-storage"
  versioning = {
    status = "enabled"
  }
}

Schema

Required

  • name (String) Container name
  • region_name (String) Region name
  • service_name (String) Service name

Optional

  • encryption (Attributes) Encryption configuration (see below for nested schema)
  • limit (Number) Limit the number of objects returned (1000 maximum, defaults to 1000)
  • marker (String) Key to start with when listing objects
  • owner_id (Number) Container owner user ID
  • prefix (String) List objects whose key begins with this prefix
  • replication (Attributes) Replication configuration (see below for nested schema)
  • versioning (Attributes) Versioning configuration (see below for nested schema)

Read-Only

  • created_at (String) The date and timestamp when the resource was created
  • objects (Attributes List) Container objects (see below for nested schema)
  • objects_count (Number) Container total objects count
  • objects_size (Number) Container total objects size (bytes)
  • region (String) Container region
  • virtual_host (String) Container virtual host

Nested Schema for encryption

Optional:

  • sse_algorithm (String) Encryption algorithm

Nested Schema for replication

Optional:

Nested Schema for replication.rules

Optional:

  • delete_marker_replication (String) Delete marker replication
  • destination (Attributes) Rule destination configuration (see below for nested schema)
  • filter (Attributes) Rule filters (see below for nested schema)
  • id (String) Rule ID
  • priority (Number) Rule priority
  • status (String) Rule status

Nested Schema for replication.rules.destination

Required:

  • name (String) Destination bucket name
  • region (String) Destination region

Optional:

  • storage_class (String) Destination storage class

Nested Schema for replication.rules.filter

Optional:

Nested Schema for replication.rules.filter.tags

Required:

  • key (String) Tag key
  • value (String) Tag value

Nested Schema for versioning

Optional:

  • status (String) Versioning status

Nested Schema for objects

Read-Only:

  • etag (String) ETag
  • is_delete_marker (Boolean) Whether this object is a delete marker
  • is_latest (Boolean) Whether this is the latest version of the object
  • key (String) Key
  • last_modified (String) Last modification date
  • size (Number) Size (bytes)
  • storage_class (String) Storage class
  • version_id (String) Version ID of the object

Import

A storage in a public cloud project can be imported using the service_name, region_name and name attributes. Using the following configuration:

import {
  id = "<service_name>/<region_name>/<name>"
  to = ovh_cloud_project_storage.storage
}

You can then run:

$ terraform plan -generate-config-out=storage.tf
$ terraform apply

The file storage.tf will then contain the imported resource's configuration, that can be copied next to the import block above. See https://developer.hashicorp.com/terraform/language/import/generating-configuration for more details.