diff --git a/envs/qa.tfvars b/envs/qa.tfvars index 68f4041..d930fec 100644 --- a/envs/qa.tfvars +++ b/envs/qa.tfvars @@ -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" diff --git a/tf/2-variables.tf b/tf/2-variables.tf index 9f93fe8..c2a0eb2 100644 --- a/tf/2-variables.tf +++ b/tf/2-variables.tf @@ -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 */ diff --git a/tf/4-outputs.tf b/tf/4-outputs.tf index 1e8c2a4..4baa9cc 100644 --- a/tf/4-outputs.tf +++ b/tf/4-outputs.tf @@ -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 */ diff --git a/tf/redshift.tf b/tf/redshift.tf new file mode 100644 index 0000000..41ad2b9 --- /dev/null +++ b/tf/redshift.tf @@ -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 +}