Skip to content

Commit

Permalink
Merge pull request #104 from volcengine/feat/iaas
Browse files Browse the repository at this point in the history
Feat/iaas
  • Loading branch information
zpp12354321 authored Jul 17, 2023
2 parents 44e8744 + 84cb034 commit 204c1ff
Show file tree
Hide file tree
Showing 95 changed files with 2,090 additions and 390 deletions.
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.87"
TerraformProviderVersion = "0.0.88"
)
3 changes: 2 additions & 1 deletion example/cen/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "volcengine_cen" "foo" {
cen_name = "tf-test"
cen_name = "tf-test-3"
description = "tf-test"
project_name = "default"
}
13 changes: 10 additions & 3 deletions example/cenAttachInstance/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
resource "volcengine_cen_attach_instance" "foo" {
cen_id = "cen-2bzrl3srxsv0g2dx0efyoojn3"
instance_id = "vpc-2d686ofu89pfk58ozfd8z9khe"
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
instance_id = "vpc-2fe5dpn0av2m859gp68rhk2dc"
instance_type = "VPC"
instance_region_id = "cn-guilin-boe"
instance_region_id = "cn-beijing"
}

resource "volcengine_cen_attach_instance" "foo1" {
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
instance_id = "vpc-in66ktl5t24g8gbssz0sqva1"
instance_type = "VPC"
instance_region_id = "cn-beijing"
}
1 change: 1 addition & 0 deletions example/cenBandwidthPackage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ resource "volcengine_cen_bandwidth_package" "foo" {
billing_type = "PrePaid"
period_unit = "Year"
period = 1
project_name = "default"
}
15 changes: 15 additions & 0 deletions example/cenRouteEntry/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "volcengine_cen_route_entry" "foo" {
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
destination_cidr_block = "192.168.0.0/24"
instance_type = "VPC"
instance_region_id = "cn-beijing"
instance_id = "vpc-im67wjcikxkw8gbssx8ufpj8"
}

resource "volcengine_cen_route_entry" "foo1" {
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
destination_cidr_block = "192.168.17.0/24"
instance_type = "VPC"
instance_region_id = "cn-beijing"
instance_id = "vpc-im67wjcikxkw8gbssx8ufpj8"
}
56 changes: 56 additions & 0 deletions example/cenServiceRouteEntry/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
resource "volcengine_cen_service_route_entry" "foo" {
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
destination_cidr_block = "100.64.0.0/11"
service_region_id = "cn-beijing"
service_vpc_id = "vpc-im67wjcikxkw8gbssx8ufpj8"
description = "test-tf"
publish_mode = "Custom"
publish_to_instances {
instance_region_id = "cn-beijing"
instance_type = "VPC"
instance_id = "vpc-2fepz36a5ra4g59gp67w197xo"
}
publish_to_instances {
instance_region_id = "cn-beijing"
instance_type = "VPC"
instance_id = "vpc-im67wjcikxkw8gbssx8ufpj8"
}
}

resource "volcengine_cen_service_route_entry" "foo1" {
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
destination_cidr_block = "100.64.0.0/10"
service_region_id = "cn-beijing"
service_vpc_id = "vpc-im67wjcikxkw8gbssx8ufpj8"
description = "test-tf"
publish_mode = "Custom"
publish_to_instances {
instance_region_id = "cn-beijing"
instance_type = "VPC"
instance_id = "vpc-2fepz36a5ra4g59gp67w197xo"
}
publish_to_instances {
instance_region_id = "cn-beijing"
instance_type = "VPC"
instance_id = "vpc-im67wjcikxkw8gbssx8ufpj8"
}
}

resource "volcengine_cen_service_route_entry" "foo2" {
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
destination_cidr_block = "100.64.0.0/12"
service_region_id = "cn-beijing"
service_vpc_id = "vpc-im67wjcikxkw8gbssx8ufpj8"
description = "test-tf"
publish_mode = "Custom"
publish_to_instances {
instance_region_id = "cn-beijing"
instance_type = "VPC"
instance_id = "vpc-2fepz36a5ra4g59gp67w197xo"
}
publish_to_instances {
instance_region_id = "cn-beijing"
instance_type = "VPC"
instance_id = "vpc-im67wjcikxkw8gbssx8ufpj8"
}
}
4 changes: 4 additions & 0 deletions example/certificate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ resource "volcengine_certificate" "foo" {
description = "This is a clb certificate"
public_key = "public-key"
private_key = "private-key"
tags {
key = "k1"
value = "v1"
}
}
31 changes: 30 additions & 1 deletion example/clb/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
resource "volcengine_clb" "foo" {
resource "volcengine_clb" "public_clb" {
type = "public"
subnet_id = "subnet-mj92ij84m5fk5smt1arvwrtw"
load_balancer_spec = "small_1"
description = "Demo"
load_balancer_name = "terraform-auto-create"
project_name = "yyy"
eip_billing_config {
isp = "BGP"
eip_billing_type = "PostPaidByBandwidth"
bandwidth = 1
}
}

resource "volcengine_clb" "private_clb" {
type = "private"
subnet_id = "subnet-mj92ij84m5fk5smt1arvwrtw"
load_balancer_spec = "small_1"
description = "Demo"
load_balancer_name = "terraform-auto-create"
project_name = "default"
}

resource "volcengine_eip_address" "eip" {
billing_type = "PostPaidByBandwidth"
bandwidth = 1
isp = "BGP"
name = "tf-eip"
description = "tf-test"
project_name = "default"
}

resource "volcengine_eip_associate" "associate" {
allocation_id = volcengine_eip_address.eip.id
instance_id = volcengine_clb.private_clb.id
instance_type = "ClbInstance"
}
2 changes: 1 addition & 1 deletion example/dataCenRouteEntries/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
data "volcengine_cen_route_entries" "foo" {
cen_id = "cen-12bjcqtr8ah3417q7y38h8t79"
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
}
3 changes: 3 additions & 0 deletions example/dataCenServiceRouteEntries/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "volcengine_cen_service_route_entries" "default" {
cen_id = "cen-12ar8uclj68sg17q7y20v9gil"
}
24 changes: 20 additions & 4 deletions example/ecsInstance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ resource "volcengine_security_group" "foo1" {
resource "volcengine_ecs_instance" "default" {
image_id = "image-aagd56zrw2jtdro3bnrl"
instance_type = "ecs.g1.large"
instance_name = "xym-tf-test-2"
description = "xym-tf-test-desc-1"
instance_name = "tf-ecs-test"
description = "tf-ecs-test-desc"
password = "93f0cb0614Aab12"
instance_charge_type = "PostPaid"
system_volume_type = "PTSSD"
Expand All @@ -31,10 +31,26 @@ resource "volcengine_ecs_instance" "default" {
size = 100
delete_with_instance = true
}
deployment_set_id = ""
ipv6_address_count = 1
data_volumes {
volume_type = "PTSSD"
size = 50
delete_with_instance = true
}
# deployment_set_id = ""
# ipv6_address_count = 1
# secondary_network_interfaces {
# subnet_id = volcengine_subnet.foo1.id
# security_group_ids = [volcengine_security_group.foo1.id]
# }

tags {
key = "tfk1"
value = "tfv1"
}

tags {
key = "tfk2"
value = "tfv2"
}

}
4 changes: 2 additions & 2 deletions example/eipAddress/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "volcengine_eip_address" "foo" {
billing_type = "PostPaidByBandwidth"
bandwidth = 1
isp = "ChinaUnicom"
name = "tf-project-1"
name = "tf-eip"
description = "tf-test"
project_name = "yuwenhao"
project_name = "default"
}
1 change: 1 addition & 0 deletions example/natGateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "volcengine_nat_gateway" "foo" {
subnet_id = "subnet-im67x70vxla88gbssz1hy1z2"
spec = "Medium"
nat_gateway_name = "tf-auto-demo-1"
billing_type = "PostPaid"
description = "This nat gateway auto-created by terraform. "
project_name = "default"
}
25 changes: 18 additions & 7 deletions example/networkAcl/main.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
resource "volcengine_network_acl" "foo" {
vpc_id = "vpc-12bk4qjc69reo17q7y36shv6z"
vpc_id = "vpc-2d6jskar243k058ozfdae13ne"
network_acl_name = "tf-test-acl"

ingress_acl_entries {
network_acl_entry_name = "ingress1"
policy = "accept"
protocol = "all"
source_cidr_ip = "192.168.0.0/24"
policy = "accept"
protocol = "all"
source_cidr_ip = "192.168.0.0/24"
}

egress_acl_entries {
network_acl_entry_name = "egress2"
policy = "accept"
protocol = "all"
destination_cidr_ip = "192.168.0.0/16"
policy = "accept"
protocol = "all"
destination_cidr_ip = "192.168.0.0/16"
}

ingress_acl_entries {
network_acl_entry_name = "ingress3"
policy = "accept"
protocol = "tcp"
port = "80/80"
source_cidr_ip = "192.168.0.0/24"
}

project_name = "default"
}
23 changes: 17 additions & 6 deletions example/scalingConfiguration/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
resource "volcengine_scaling_configuration" "foo" {
scaling_configuration_name = "tf-test"
scaling_group_id = "scg-ybru8pazhgl8j1di4tyd"
image_id = "image-ybpbrfay1gl8j1srwwyz"
instance_types = ["ecs.g1.4xlarge"]
scaling_group_id = "scg-ycinx27x25gh9y31p0fy"
image_id = "image-ycgud4t4hxgso0e27bdl"
instance_types = ["ecs.g2i.large"]
instance_name = "tf-test"
instance_description = ""
host_name = ""
password = ""
key_pair_name = "renhuaxi"
key_pair_name = "tf-keypair"
security_enhancement_strategy = "InActive"
volumes {
volume_type = "ESSD_PL0"
Expand All @@ -19,10 +19,21 @@ resource "volcengine_scaling_configuration" "foo" {
size = 20
delete_with_instance = true
}
security_group_ids = ["sg-2ff4fhdtlo8ao59gp67iiq9o3"]
eip_bandwidth = 0
security_group_ids = ["sg-2fepz3c793g1s59gp67y21r34"]
eip_bandwidth = 10
eip_isp = "ChinaMobile"
eip_billing_type = "PostPaidByBandwidth"
user_data = "IyEvYmluL2Jhc2gKZWNobyAidGVzdCI="
tags {
key = "tf-key1"
value = "tf-value1"
}
tags {
key = "tf-key2"
value = "tf-value2"
}
project_name = "default"
hpc_cluster_id = ""
spot_strategy = "NoSpot"
}

9 changes: 7 additions & 2 deletions example/scalingGroup/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
resource "volcengine_scaling_group" "foo" {
scaling_group_name = "tf-test"
subnet_ids = ["subnet-2ff1n75eyf08w59gp67qhnhqm"]
scaling_group_name = "test-tf"
subnet_ids = ["subnet-2fe79j7c8o5c059gp68ksxr93"]
multi_az_policy = "BALANCE"
desire_instance_number = 0
min_instance_number = 0
max_instance_number = 1
instance_terminate_policy = "OldestInstance"
default_cooldown = 10
project_name = "default"
tags {
key = "tf-key1"
value = "tf-value1"
}
}
4 changes: 2 additions & 2 deletions example/vpnConnection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ resource "volcengine_vpn_connection" "foo" {
ike_config_enc_alg = "aes"
ike_config_auth_alg = "md5"
ike_config_dh_group = "group2"
ike_config_lifetime = 100
ike_config_lifetime = 9000
ike_config_local_id = "tf_test"
ike_config_remote_id = "tf_test"
ipsec_config_enc_alg = "aes"
ipsec_config_auth_alg = "sha256"
ipsec_config_dh_group = "group2"
ipsec_config_lifetime = 100
ipsec_config_lifetime = 9000
project_name = "default"
}
6 changes: 3 additions & 3 deletions example/vpnGateway/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
resource "volcengine_vpn_gateway" "foo" {
vpc_id = "vpc-2fe19q1dn2g3k59gp68n7w3rr"
subnet_id = "subnet-2fe19qp20f3sw59gp67w8om25"
vpc_id = "vpc-12b31m7z2kc8w17q7y2fih9ts"
subnet_id = "subnet-12bh8g2d7fshs17q7y2nx82uk"
bandwidth = 20
vpn_gateway_name = "tf-test"
description = "tf-test"
period = 2
project_name = "yuwenhao"
project_name = "default"
}
Loading

0 comments on commit 204c1ff

Please sign in to comment.