Skip to content

Commit

Permalink
Merge pull request #174 from volcengine/Feat/vepfs
Browse files Browse the repository at this point in the history
Feat/vepfs
  • Loading branch information
msq177 authored Aug 30, 2024
2 parents ff364fa + b8b371b commit 505f7eb
Show file tree
Hide file tree
Showing 29 changed files with 3,822 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/common_volcengine_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package common

const (
TerraformProviderName = "terraform-provider-volcengine"
TerraformProviderVersion = "0.0.150"
TerraformProviderVersion = "0.0.151"
)
1 change: 1 addition & 0 deletions docgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ var resourceKeys = map[string]string{
"cloud_identity": "CLOUD_IDENTITY",
"kafka": "KAFKA",
"private_zone": "PRIVATE_ZONE",
"vepfs": "VEPFS",
}

type Products struct {
Expand Down
29 changes: 29 additions & 0 deletions example/dataVepfsFileSystems/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = "cn-beijing-a"
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vepfs_file_system" "foo" {
file_system_name = "acc-test-file-system"
subnet_id = volcengine_subnet.foo.id
store_type = "Advance_100"
description = "tf-test"
capacity = 12
project = "default"
enable_restripe = false
tags {
key = "k1"
value = "v1"
}
}

data "volcengine_vepfs_file_systems" "foo" {
ids = [volcengine_vepfs_file_system.foo.id]
}
40 changes: 40 additions & 0 deletions example/dataVepfsFilesets/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = "cn-beijing-a"
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vepfs_file_system" "foo" {
file_system_name = "acc-test-file-system"
subnet_id = volcengine_subnet.foo.id
store_type = "Advance_100"
description = "tf-test"
capacity = 12
project = "default"
enable_restripe = false
tags {
key = "k1"
value = "v1"
}
}

resource "volcengine_vepfs_fileset" "foo" {
file_system_id = volcengine_vepfs_file_system.foo.id
fileset_name = "acc-test-fileset"
fileset_path = "/tf-test/"
max_iops = 100
max_bandwidth = 10
file_limit = 20
capacity_limit = 30
}

data "volcengine_vepfs_filesets" "foo" {
file_system_id = volcengine_vepfs_file_system.foo.id
fileset_id = volcengine_vepfs_fileset.foo.id
}
22 changes: 22 additions & 0 deletions example/dataVepfsMountServices/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = "cn-beijing-a"
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vepfs_mount_service" "foo" {
mount_service_name = "acc-test-mount-service"
subnet_id = volcengine_subnet.foo.id
node_type = "ecs.g1ie.large"
project = "default"
}

data "volcengine_vepfs_mount_services" "foo" {
mount_service_id = volcengine_vepfs_mount_service.foo.id
}
25 changes: 25 additions & 0 deletions example/vepfsFileSystem/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = "cn-beijing-a"
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vepfs_file_system" "foo" {
file_system_name = "acc-test-file-system"
subnet_id = volcengine_subnet.foo.id
store_type = "Advance_100"
description = "tf-test"
capacity = 12
project = "default"
enable_restripe = false
tags {
key = "k1"
value = "v1"
}
}
35 changes: 35 additions & 0 deletions example/vepfsFileset/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = "cn-beijing-a"
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vepfs_file_system" "foo" {
file_system_name = "acc-test-file-system"
subnet_id = volcengine_subnet.foo.id
store_type = "Advance_100"
description = "tf-test"
capacity = 12
project = "default"
enable_restripe = false
tags {
key = "k1"
value = "v1"
}
}

resource "volcengine_vepfs_fileset" "foo" {
file_system_id = volcengine_vepfs_file_system.foo.id
fileset_name = "acc-test-fileset"
fileset_path = "/tf-test/"
max_iops = 100
max_bandwidth = 10
file_limit = 20
capacity_limit = 30
}
18 changes: 18 additions & 0 deletions example/vepfsMountService/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = "cn-beijing-a"
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vepfs_mount_service" "foo" {
mount_service_name = "acc-test-mount-service"
subnet_id = volcengine_subnet.foo.id
node_type = "ecs.g1ie.large"
project = "default"
}
37 changes: 37 additions & 0 deletions example/vepfsMountServiceAttachment/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = "cn-beijing-a"
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vepfs_file_system" "foo" {
file_system_name = "acc-test-file-system"
subnet_id = volcengine_subnet.foo.id
store_type = "Advance_100"
description = "tf-test"
capacity = 12
project = "default"
enable_restripe = false
tags {
key = "k1"
value = "v1"
}
}

resource "volcengine_vepfs_mount_service" "foo" {
mount_service_name = "acc-test-mount-service"
subnet_id = volcengine_subnet.foo.id
node_type = "ecs.g1ie.large"
project = "default"
}

resource "volcengine_vepfs_mount_service_attachment" "foo" {
mount_service_id = volcengine_vepfs_mount_service.foo.id
file_system_id = volcengine_vepfs_file_system.foo.id
}
16 changes: 16 additions & 0 deletions volcengine/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import (
"strings"
"time"

"github.com/volcengine/terraform-provider-volcengine/volcengine/vepfs/vepfs_file_system"
"github.com/volcengine/terraform-provider-volcengine/volcengine/vepfs/vepfs_fileset"
"github.com/volcengine/terraform-provider-volcengine/volcengine/vepfs/vepfs_mount_service"
"github.com/volcengine/terraform-provider-volcengine/volcengine/vepfs/vepfs_mount_service_attachment"

"github.com/volcengine/terraform-provider-volcengine/volcengine/private_zone/private_zone"
"github.com/volcengine/terraform-provider-volcengine/volcengine/private_zone/private_zone_record"
"github.com/volcengine/terraform-provider-volcengine/volcengine/private_zone/private_zone_record_set"
Expand Down Expand Up @@ -683,6 +688,11 @@ func Provider() terraform.ResourceProvider {
"volcengine_private_zone_resolver_rules": private_zone_resolver_rule.DataSourceVolcenginePrivateZoneResolverRules(),
"volcengine_private_zone_records": private_zone_record.DataSourceVolcenginePrivateZoneRecords(),
"volcengine_private_zone_record_sets": private_zone_record_set.DataSourceVolcenginePrivateZoneRecordSets(),

// ================ Vepfs ================
"volcengine_vepfs_file_systems": vepfs_file_system.DataSourceVolcengineVepfsFileSystems(),
"volcengine_vepfs_mount_services": vepfs_mount_service.DataSourceVolcengineVepfsMountServices(),
"volcengine_vepfs_filesets": vepfs_fileset.DataSourceVolcengineVepfsFilesets(),
},
ResourcesMap: map[string]*schema.Resource{
"volcengine_vpc": vpc.ResourceVolcengineVpc(),
Expand Down Expand Up @@ -977,6 +987,12 @@ func Provider() terraform.ResourceProvider {
"volcengine_private_zone_record": private_zone_record.ResourceVolcenginePrivateZoneRecord(),
"volcengine_private_zone_record_weight_enabler": private_zone_record_weight_enabler.ResourceVolcenginePrivateZoneRecordWeightEnabler(),
"volcengine_private_zone_user_vpc_authorization": private_zone_user_vpc_authorization.ResourceVolcenginePrivateZoneUserVpcAuthorization(),

// ================ Vepfs ================
"volcengine_vepfs_file_system": vepfs_file_system.ResourceVolcengineVepfsFileSystem(),
"volcengine_vepfs_mount_service": vepfs_mount_service.ResourceVolcengineVepfsMountService(),
"volcengine_vepfs_mount_service_attachment": vepfs_mount_service_attachment.ResourceVolcengineVepfsMountServiceAttachment(),
"volcengine_vepfs_fileset": vepfs_fileset.ResourceVolcengineVepfsFileset(),
},
ConfigureFunc: ProviderConfigure,
}
Expand Down
Loading

0 comments on commit 505f7eb

Please sign in to comment.