Skip to content

Latest commit

 

History

History
163 lines (116 loc) · 4.71 KB

cloud_project_storage.html.markdown

File metadata and controls

163 lines (116 loc) · 4.71 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.)

Example Usage

Create a S3™* compatible storage container in GRA region with versioning enabled:

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

Create a S3™* compatible storage container in GRA region with encryption in AES256:

resource "ovh_cloud_project_storage" "storage" {
  service_name = "<public cloud project ID>"
  region_name = "GRA"
  name = "my-storage-via-tf"
  encryption = {
    sse_algorithm = "AES256"
  }
}

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.