Skip to content

Commit

Permalink
feat(ci): make instance_type configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
dakehero committed Mar 14, 2024
1 parent 5c2f074 commit b6890dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions ci/tf/example.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ access_key=""
secret_key=""
key_pair_name=""
key_pair_path=""
zone_id="cn-beijing-b"
region="cn-beijing"
zone_id=""
region=""
instance_type="ecs.g3i.xlarge"
vpc_name="my-ci-test"
vpc_cidr="172.16.0.0/16"
node_subnet_name="my-ci-node-subnet"
Expand Down
10 changes: 7 additions & 3 deletions ci/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ variable "zone_id" {
type = string
}

variable "instance_type" {
type = string
}

variable "vpc_name" {
type = string
}
Expand Down Expand Up @@ -127,7 +131,7 @@ resource "volcengine_security_group_rule" "sg_rule_allow_api_server" {
resource "volcengine_ecs_instance" "control_plane" {
zone_id = var.zone_id
image_id = "image-ybqi99s7yq8rx7mnk44b"
instance_type = "ecs.g3i.xlarge"
instance_type = var.instance_type
instance_name = var.control_plane_node_name
description = var.control_plane_node_name
host_name = var.control_plane_node_name
Expand All @@ -144,7 +148,7 @@ resource "volcengine_ecs_instance" "control_plane" {
resource "volcengine_ecs_instance" "worker" {
zone_id = var.zone_id
image_id = "image-ybqi99s7yq8rx7mnk44b"
instance_type = "ecs.g3i.xlarge"
instance_type = var.instance_type
instance_name = var.worker_node_name
description = var.worker_node_name
host_name = var.worker_node_name
Expand All @@ -161,7 +165,7 @@ resource "volcengine_ecs_instance" "worker" {
resource "volcengine_ecs_instance" "worker2" {
zone_id = var.zone_id
image_id = "image-ybqi99s7yq8rx7mnk44b"
instance_type = "ecs.g3i.xlarge"
instance_type = var.instance_type
instance_name = var.worker2_node_name
description = var.worker2_node_name
host_name = var.worker2_node_name
Expand Down

0 comments on commit b6890dd

Please sign in to comment.