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

Redshift #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions envs/qa.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ lambda_handler = "lambda.handler_test"
lambda_runtime = "python3.8"
// -- RDS
rds_name = "boilerplate"
// -- Redshift
redshift_cluster_name = "boilerplate"
// -- Route53
// -- VPC
vpc_name = "boilerplate"
40 changes: 40 additions & 0 deletions tf/2-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,46 @@ variable "final_snapshot_identifier" {
default = "demodb"
}

/*
// Redshift variables
*/

variable "redshift_cluster_name" {
type = string
description = "Name for redshift cluster."
default = "redshift-boilerplate"
}

variable "redshift_node_type" {
type = string
description = "Node type for redshift cluster."
default = "dc1.large"
}

variable "redshift_node_amount" {
type = number
description = "Node amount for redshift cluster."
default = 1
}

variable "redshift_db_name" {
type = string
description = "Database name for redshift cluster."
default = "db_name"
}

variable "redshift_db_user" {
type = string
description = "Database user for redshift cluster."
default = "db_user"
}

variable "redshift_db_master_password" {
type = string
description = "Database master password for redshift cluster."
default = "D8_m4st3r_p4ssword"
}

/*
// Route53 variables
*/
Expand Down
11 changes: 11 additions & 0 deletions tf/4-outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ output "route53" {
}
*/

/*
// Redshift outputs
*/

output "reshift" {
value = {
id = module.redshift.this_redshift_cluster_id
arn = module.redshift.this_redshift_cluster_arn
}
}

/*
// SNS outputs
*/
Expand Down
19 changes: 19 additions & 0 deletions tf/redshift.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module "redshift" {
source = "terraform-aws-modules/redshift/aws"
version = "~> 2.7"

cluster_identifier = var.redshift_cluster_name
cluster_node_type = var.redshift_node_type
cluster_number_of_nodes = var.redshift_node_amount

cluster_database_name = var.redshift_db_name
cluster_master_username = var.redshift_db_user
cluster_master_password = var.redshift_db_master_password

final_snapshot_identifier = "1"

subnets = module.vpc.private_subnets
vpc_security_group_ids = [module.vpc.default_security_group_id]

tags = local.tags
}