subcategory |
---|
Object 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.)
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"
}
}
name
(String) Container nameregion_name
(String) Region nameservice_name
(String) Service name
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 objectsowner_id
(Number) Container owner user IDprefix
(String) List objects whose key begins with this prefixreplication
(Attributes) Replication configuration (see below for nested schema)versioning
(Attributes) Versioning configuration (see below for nested schema)
created_at
(String) The date and timestamp when the resource was createdobjects
(Attributes List) Container objects (see below for nested schema)objects_count
(Number) Container total objects countobjects_size
(Number) Container total objects size (bytes)region
(String) Container regionvirtual_host
(String) Container virtual host
Optional:
sse_algorithm
(String) Encryption algorithm
Optional:
rules
(Attributes List) Replication rules (see below for nested schema)
Optional:
delete_marker_replication
(String) Delete marker replicationdestination
(Attributes) Rule destination configuration (see below for nested schema)filter
(Attributes) Rule filters (see below for nested schema)id
(String) Rule IDpriority
(Number) Rule prioritystatus
(String) Rule status
Required:
name
(String) Destination bucket nameregion
(String) Destination region
Optional:
storage_class
(String) Destination storage class
Optional:
prefix
(String) Prefix filtertags
(Attributes List) Tags filter (see below for nested schema)
Required:
key
(String) Tag keyvalue
(String) Tag value
Optional:
status
(String) Versioning status
Read-Only:
etag
(String) ETagis_delete_marker
(Boolean) Whether this object is a delete markeris_latest
(Boolean) Whether this is the latest version of the objectkey
(String) Keylast_modified
(String) Last modification datesize
(Number) Size (bytes)storage_class
(String) Storage classversion_id
(String) Version ID of the object
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.