Skip to content

Commit

Permalink
Add TF Cloud instance provision
Browse files Browse the repository at this point in the history
  • Loading branch information
slvrtrn committed Jul 18, 2024
1 parent a332672 commit 67f90e5
Show file tree
Hide file tree
Showing 2 changed files with 391 additions and 233 deletions.
68 changes: 68 additions & 0 deletions .github/cloud/service.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
terraform {
required_providers {
clickhouse = {
source = "ClickHouse/clickhouse"
version = "0.0.6"
}
}
}

variable "organization_id" {
type = string
}

variable "token_key" {
type = string
}

variable "token_secret" {
type = string
}

variable "service_name" {
type = string
default = "clickhouse-js-tests"
}

variable "service_password" {
type = string
}

variable "api_url" {
type = string
}

variable "allowed_cidr" {
type = string
default = "0.0.0.0/0"
}

provider "clickhouse" {
organization_id = var.organization_id
token_key = var.token_key
token_secret = var.token_secret
api_url = var.api_url
}

resource "clickhouse_service" "service" {
name = var.service_name
cloud_provider = "aws"
region = "us-east-2"
tier = "development"
password = var.service_password

ip_access = [
{
source = var.allowed_cidr
description = "Allowed CIDR"
}
]
}

output "CLICKHOUSE_HOST" {
value = clickhouse_service.service.endpoints.0.host
}

output "SERVICE_ID" {
value = clickhouse_service.service.id
}
Loading

0 comments on commit 67f90e5

Please sign in to comment.