alicloud_cloud_storage_gateway_gateway_cache_disk
更新时间:
Provides a Cloud Storage Gateway Gateway Cache Disk resource.
For information about Cloud Storage Gateway Gateway Cache Disk and how to use it, see What is Gateway Cache Disk.
-> NOTE: Available since v1.144.0.
Example Usage
Basic Usage
variable "name" {
default = "tf-example"
}
resource "random_uuid" "default" {
}
resource "alicloud_cloud_storage_gateway_storage_bundle" "default" {
storage_bundle_name = substr("tf-example-${replace(random_uuid.default.result, "-", "")}", 0, 16)
}
resource "alicloud_vpc" "default" {
vpc_name = var.name
cidr_block = "172.16.0.0/12"
}
data "alicloud_cloud_storage_gateway_stocks" "default" {
gateway_class = "Standard"
}
resource "alicloud_vswitch" "default" {
vpc_id = alicloud_vpc.default.id
cidr_block = "172.16.0.0/21"
zone_id = data.alicloud_cloud_storage_gateway_stocks.default.stocks.0.zone_id
vswitch_name = var.name
}
resource "alicloud_cloud_storage_gateway_gateway" "default" {
gateway_name = var.name
description = var.name
gateway_class = "Standard"
type = "File"
payment_type = "PayAsYouGo"
vswitch_id = alicloud_vswitch.default.id
release_after_expiration = true
public_network_bandwidth = 40
storage_bundle_id = alicloud_cloud_storage_gateway_storage_bundle.default.id
location = "Cloud"
}
resource "alicloud_cloud_storage_gateway_gateway_cache_disk" "default" {
cache_disk_category = "cloud_efficiency"
gateway_id = alicloud_cloud_storage_gateway_gateway.default.id
cache_disk_size_in_gb = 50
}
Argument Reference
The following arguments are supported:
gateway_id- (Required, ForceNew) The ID of the gateway.cache_disk_size_in_gb- (Required, Int) The capacity of the cache disk.cache_disk_category- (Optional, ForceNew) The type of the cache disk. Valid values:cloud_efficiency,cloud_ssd,cloud_essd. NOTE: From version 1.227.0,cache_disk_categorycan be set tocloud_essd.performance_level- (Optional, ForceNew, Available since v1.227.0) The performance level (PL) of the Enterprise SSD (ESSD). Valid values:PL1,PL2,PL3. NOTE: Ifcache_disk_categoryis set tocloud_essd,performance_levelis required.
Attributes Reference
The following attributes are exported:
id- The resource ID in terraform of Gateway Cache Disk. It formats as<gateway_id>:<cache_id>:<local_file_path>.cache_id- The ID of the cache disk.local_file_path- The path of the cache disk.status- The status of the Gateway Cache Disk.
Import
Cloud Storage Gateway Gateway Cache Disk can be imported using the id, e.g.
$ terraform import alicloud_cloud_storage_gateway_gateway_cache_disk.example <gateway_id>:<cache_id>:<local_file_path>
该文章对您有帮助吗?