Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial configuration dcs #191

Merged
merged 8 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions otc/dcs/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
data "opentelekomcloud_dcs_az_v1" "az_1" {
name = var.region_zone
}

data "opentelekomcloud_dcs_product_v1" "product_1" {
spec_code = var.spec_code
}

resource "opentelekomcloud_dcs_instance_v1" "instance_1" {
name = var.name
engine_version = var.engine_version
password = var.dcs_password
engine = "Redis"
capacity = var.capacity
vpc_id = var.vpc_id
subnet_id = var.subnet_id
available_zones = [data.opentelekomcloud_dcs_az_v1.az_1.id]
product_id = data.opentelekomcloud_dcs_product_v1.product_1.id
}
7 changes: 7 additions & 0 deletions otc/dcs/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "dcs_ip" {
value = opentelekomcloud_dcs_instance_v1.instance_1.ip
}

output "dcs_username" {
value = opentelekomcloud_dcs_instance_v1.instance_1.user_name
}
10 changes: 10 additions & 0 deletions otc/dcs/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = "v1.3.7"
required_providers {
opentelekomcloud = {
source = "opentelekomcloud/opentelekomcloud"
version = ">=1.29.0"
}
}
}

42 changes: 42 additions & 0 deletions otc/dcs/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
variable "name" {
type = string
description = "The name of the distributed cache system"
}

variable "spec_code" {
type = string
description = "The type of redis server that is going to be deployed"
default = "redis.single.xu1.tiny.128"
}

variable "engine_version" {
type = string
description = "The version of the redis engine"
default = "5.0"
}

variable "capacity" {
type = number
description = "The type instance values for stand-alone or cluster"
default = 0.125
}

variable "region_zone" {
type = string
description = "The region zone identifier: i.e. eu-de-01"
}

variable "vpc_id" {
type = string
description = "The ID of the VPC where to deploy the server"
}

variable "subnet_id" {
type = string
description = "The ID of the subnet where to deploy the server"
}

variable "dcs_password" {
type = string
description = "DCS password value"
}
Loading