arvancloud_iaas_file_storage_attachment (Resource)
Manages the attachment of a file storage volume to a compute server instance. This resource grants a server instance access to a file storage volume with specified permissions (read-only or read-write). Multiple server instances can be attached to the same file storage volume by creating multiple attachment resources.
Example Usage
# Attach a file storage volume to a compute server with read-write access
resource "arvancloud_iaas_file_storage_attachment" "example" {
file_storage_id = arvancloud_iaas_file_storage.shared.id
server_id = arvancloud_iaas_server.web1.id
availability_zone = "ir-central1-a"
access_level = "rw" # or "ro" for read-only access
}
# Attach the same file storage to another server (read-only)
resource "arvancloud_iaas_file_storage_attachment" "readonly" {
file_storage_id = arvancloud_iaas_file_storage.shared.id
server_id = arvancloud_iaas_server.web2.id
availability_zone = "ir-central1-a"
access_level = "ro"
}
output "attachment_id" {
value = arvancloud_iaas_file_storage_attachment.example.id
}
output "access_right_id" {
value = arvancloud_iaas_file_storage_attachment.example.access_right_id
}
output "server_private_ip" {
value = arvancloud_iaas_file_storage_attachment.example.private_ip
}
output "server_name" {
value = arvancloud_iaas_file_storage_attachment.example.server_name
}
Schema
Required
access_level(String) Access level for the attachment. Valid values:ro(read-only) orrw(read-write).availability_zone(String) Availability zone where the file storage and server instance reside (e.g.,ir-central1-a).file_storage_id(String) ID of the file storage volume to attach.server_id(String) ID of the compute server instance to attach the file storage to.