Skip to content

Commit b70c244

Browse files
authored
Adding the emr cluster version as a variable (#79)
* Adding the emr cluster version as a variable
1 parent 037d02f commit b70c244

File tree

5 files changed

+10
-112
lines changed

5 files changed

+10
-112
lines changed

aws_datalake/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ mkdir segment-datalakes-tf
5454
* **Note - Existing users** may be using the `sourceID` here instead of the `workspaceID`, which was the previous configuration. Setting this value as the `sourceID` is still supported for existing users for backwards compatibility. Follow instructions [here](#Using-workspaceID-as-the-externalID) to migrate to `workspaceID`. This will ensure you do not need to update this value for each source you want to add.
5555
* Update the `name` in the `aws_s3_bucket` resource to the desired name of your S3 bucket
5656
* Update the `subnet_id` in the `emr` module to the subnet in which to create the EMR cluster
57+
* Update the `emr_cluster_version` in the `emr` module to the version that you want to use. We recommend using any 6.x or 7.x versions.
5758

5859
```hcl
5960
provider "aws" {
@@ -111,6 +112,7 @@ module "emr" {
111112
112113
s3_bucket = aws_s3_bucket.segment_datalake_s3.id
113114
subnet_id = "subnet-XXX" # Replace this with the subnet ID you want the EMR cluster to run in.
115+
emr_cluster_version = "7.0.0"
114116
115117
# LEAVE THIS AS-IS
116118
iam_emr_autoscaling_role = module.iam.iam_emr_autoscaling_role

aws_datalake/modules/emr/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://www.terraform.io/docs/providers/aws/r/emr_cluster.html
33
resource "aws_emr_cluster" "segment_data_lake_emr_cluster" {
44
name = var.cluster_name
5-
release_label = "emr-5.33.0"
5+
release_label = "emr-${var.emr_cluster_version}"
66
applications = ["Hadoop", "Hive", "Spark"]
77

88
log_uri = "s3://${var.s3_bucket}/${var.emr_logs_s3_prefix}"

aws_datalake/modules/emr/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ variable "task_instance_max_count" {
9595
default = "4"
9696
}
9797

98+
variable "emr_cluster_version" {
99+
description = "Version of emr cluster"
100+
type = string
101+
default = "6.5.0"
102+
}
103+
98104
locals {
99105
tags = merge(tomap({"vendor" = "segment"}), var.tags)
100106
}

aws_datalake/test/test_fixture/aws_main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module "emr" {
3131
subnet_id = "subnet-00f137e4f3a6f8356"
3232
tags = local.tags
3333
cluster_name = "test-cluster"
34+
emr_cluster_version = "7.0.0"
3435

3536
# LEAVE THIS AS-IS
3637
iam_emr_autoscaling_role = module.iam.iam_emr_autoscaling_role

aws_datalake/test/test_fixture/azure_main.tf

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)