Files
kubevela/references/cli/test-data/redis.tf
Zheng Xi Zhou 947455adb9 Fix: support generate Terraform ComponentDefinition from local HCL file (#3132)
Besides generating a Terraform ComponentDefinition from a remote git repo,
support generate one from local HCL file

Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
2022-01-20 14:15:22 +08:00

59 lines
1.2 KiB
HCL

terraform {
required_providers {
tencentcloud = {
source = "tencentcloudstack/tencentcloud"
}
}
}
resource "tencentcloud_redis_instance" "main" {
type_id = 8
availability_zone = var.availability_zone
name = var.instance_name
password = var.user_password
mem_size = var.mem_size
port = var.port
}
output "DB_IP" {
value = tencentcloud_redis_instance.main.ip
}
output "DB_PASSWORD" {
value = var.user_password
}
output "DB_PORT" {
value = var.port
}
variable "availability_zone" {
description = "The available zone ID of an instance to be created."
type = string
default = "ap-chengdu-1"
}
variable "instance_name" {
description = "redis instance name"
type = string
default = "sample"
}
variable "user_password" {
description = "redis instance password"
type = string
default = "IEfewjf2342rfwfwYYfaked"
}
variable "mem_size" {
description = "redis instance memory size"
type = number
default = 1024
}
variable "port" {
description = "The port used to access a redis instance."
type = number
default = 6379
}