Skip to content

Commit d0b6c53

Browse files
committed
Initial Commit
1 parent b58fd40 commit d0b6c53

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

README copy.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Bigtable Module
2+
This module is used to provision a basic bigtable instance with a single cluster in it.
3+
NOTE: this is only meant for internal usage, as it has some logic that is specific to Tamr's GCP setup.
4+
This repo follows the [terraform standard module structure](https://www.terraform.io/docs/modules/index.html#standard-module-structure).
5+
6+
# Examples
7+
## Basic
8+
Inline example implementation of the module. This is the most basic example of what it would look like to use this module.
9+
```
10+
module "bigtable" {
11+
source = "./shared_files/modules/gcp-bigtable"
12+
name = "tamr"
13+
}
14+
```
15+
16+
# Resources Created
17+
* A production bigtable instance
18+
19+
# Variables
20+
## Inputs
21+
Write your Terraform module inputs.
22+
* `name` (required): The name of the bigtable instance
23+
* `initial_num_nodes` (optional): The number nodes to start the cluster with
24+
* `zone` (optional): The zone for the cluster to be created in
25+
* `storage_type` (optional): The storage type for the cluster
26+
27+
# References
28+
This repo is based on:
29+
* [terraform standard module structure](https://www.terraform.io/docs/modules/index.html#standard-module-structure)
30+
* [templated terraform module](https://github.com/tmknom/template-terraform-module)

main.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
locals {
2+
cluster_name = "${var.name}-${var.zone}"
3+
}
4+
5+
resource "google_bigtable_instance" "bigtable_instance" {
6+
name = var.name
7+
instance_type = "PRODUCTION"
8+
project = var.project
9+
10+
cluster {
11+
cluster_id = local.cluster_name
12+
zone = var.zone
13+
num_nodes = var.initial_num_nodes
14+
storage_type = var.storage_type
15+
}
16+
17+
lifecycle {
18+
ignore_changes = [cluster]
19+
}
20+
}

variables.tf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# required variables
3+
#
4+
variable "name" {
5+
type = string
6+
description = "The name of the bigtable instance. NOTE Length should be between [6,33]"
7+
}
8+
9+
variable "project" {
10+
type = string
11+
description = "The project the cluster should be deployed to"
12+
}
13+
14+
#
15+
# optional variables
16+
#
17+
variable "initial_num_nodes" {
18+
type = number
19+
description = "The number nodes to start the cluster with"
20+
# NOTE: if using a newer provider you can set to this 1
21+
default = 3
22+
}
23+
24+
variable "zone" {
25+
type = string
26+
description = "The zone for the cluster to be created in"
27+
default = "us-east1-b"
28+
}
29+
30+
# storage_type
31+
variable "storage_type" {
32+
type = string
33+
description = "The storage type for the cluster"
34+
default = "SSD"
35+
}

0 commit comments

Comments
 (0)