diff --git a/examples/gen-ai-xeon-opea-chatqna-falcon3/README.md b/examples/gen-ai-xeon-opea-chatqna-falcon3/README.md index 6b5abce..d01f0db 100644 --- a/examples/gen-ai-xeon-opea-chatqna-falcon3/README.md +++ b/examples/gen-ai-xeon-opea-chatqna-falcon3/README.md @@ -44,14 +44,26 @@ Use https://whatismyipaddress.com/ to find your Public IP. # Variable for Huggingface Token variable "huggingface_token" { description = "Huggingface Token" - default = "" #UPDATE + default = "" #UPDATE with your Huggingface Token type = string } variable "region" { description = "Target AWS region to deploy EC2 in." type = string - default = "us-east-1" #UPDATE if needed + default = "us-east-1" +} + +variable "availability_zone" { + description = "Target AWS availability zone to deploy EC2 in." + type = string + default = "us-east-1d" +} + +variable "instance_type" { + description = "Instance type to deploy." + type = string + default = "c7i.24xlarge" } # Variable to add ingress rules to the security group. Replace the default values with the required ports and CIDR ranges. @@ -72,33 +84,6 @@ variable "ingress_rules" { } ``` -### main.tf - -If there is a need to to modify the EC2 Instance, modify main.tf: - -`instance_type = "c7i.24xlarge"` - -```hcl -module "ec2-vm" { - source = "intel/aws-vm/intel" - key_name = aws_key_pair.TF_key.key_name - instance_type = "c7i.24xlarge" - availability_zone = "us-east-1a" - ami = data.aws_ami.ubuntu-linux-2204.id - user_data = data.cloudinit_config.ansible.rendered - - root_block_device = [{ - volume_size = "500" - }] - - tags = { - Name = "my-test-vm-${random_id.rid.dec}" - Owner = "OwnerName-${random_id.rid.dec}", - Duration = "2" - } -} -``` - ## Usage from command line - Assumes you have Git, AWS CLI, and Terraform installed ```bash @@ -108,6 +93,10 @@ git clone https://github.com/intel/terraform-intel-aws-vm.git # Change into the example folder cd terraform-intel-aws-vm/examples/gen-ai-xeon-opea-chatqna-falcon3 +######################################################## +# MODIFY VARIABLES.tf before continuing +######################################################## + # Run the Terraform Commands below to deploy the demo. terraform init terraform plan @@ -136,7 +125,9 @@ git clone https://github.com/intel/terraform-intel-aws-vm.git # Change into the example folder cd terraform-intel-aws-vm/examples/gen-ai-xeon-opea-chatqna-falcon3 -# MODIFY VARIABLES.tf before continuining +######################################################## +# MODIFY VARIABLES.tf before continuing +######################################################## # Run the Terraform Commands below to deploy the demo. terraform init diff --git a/examples/gen-ai-xeon-opea-chatqna-falcon3/main.tf b/examples/gen-ai-xeon-opea-chatqna-falcon3/main.tf index d8511de..ee11740 100644 --- a/examples/gen-ai-xeon-opea-chatqna-falcon3/main.tf +++ b/examples/gen-ai-xeon-opea-chatqna-falcon3/main.tf @@ -77,8 +77,8 @@ module "ec2-vm" { count = var.vm_count source = "intel/aws-vm/intel" key_name = aws_key_pair.TF_key.key_name - instance_type = "c7i.24xlarge" - availability_zone = "us-east-1d" + instance_type = var.instance_type + availability_zone = var.availability_zone ami = data.aws_ami.ubuntu-linux-2204.id user_data = data.cloudinit_config.ansible.rendered diff --git a/examples/gen-ai-xeon-opea-chatqna-falcon3/variables.tf b/examples/gen-ai-xeon-opea-chatqna-falcon3/variables.tf index e6529be..8cc43f6 100644 --- a/examples/gen-ai-xeon-opea-chatqna-falcon3/variables.tf +++ b/examples/gen-ai-xeon-opea-chatqna-falcon3/variables.tf @@ -2,7 +2,7 @@ variable "huggingface_token" { description = "Huggingface Token" #default = "hf_token" - type = string + type = string } variable "region" { @@ -11,6 +11,18 @@ variable "region" { default = "us-east-1" } +variable "availability_zone" { + description = "Target AWS availability zone to deploy EC2 in." + type = string + default = "us-east-1d" +} + +variable "instance_type" { + description = "Instance type to deploy." + type = string + default = "c7i.24xlarge" +} + # Variable to add ingress rules to the security group. Replace the default values with the required ports and CIDR ranges. variable "ingress_rules" { type = list(object({