From 4325e29e4fdd7f9b9b7fd7a00b047715e3afe1ef Mon Sep 17 00:00:00 2001 From: Hongbo Miao <3375461+hongbo-miao@users.noreply.github.com> Date: Wed, 8 Nov 2023 01:07:09 -0800 Subject: [PATCH] refactor(terraform): emr studio (#12493) --- terraform/main.tf | 16 ++++++---------- terraform/modules/hm_amazon_emr_studio/main.tf | 8 ++++---- .../modules/hm_amazon_emr_studio/variables.tf | 12 ------------ 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index 389a7e77bb..967e986f63 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -156,16 +156,12 @@ module "hm_sedona_emr_managed_scaling_policy" { max_capacity_units = 10 } module "hm_sedona_emr_studio" { - source = "./modules/hm_amazon_emr_studio" - amazon_emr_studio_name = "hm-sedona-emr-studio" - s3_bucket = "hongbomiao-bucket" - s3_uri = "s3://hongbomiao-bucket/amazon-emr/studio/hm-sedona-emr-studio" - engine_security_group_id = "sg-xxxxxxxxxxxxxxxxx" - workspace_security_group_id = "sg-xxxxxxxxxxxxxxxxx" - vpc_id = "vpc-xxxxxxxxxxxxxxxxx" - subnet_ids = ["subnet-xxxxxxxxxxxxxxxxx"] - environment = var.environment - team = var.team + source = "./modules/hm_amazon_emr_studio" + amazon_emr_studio_name = "hm-sedona-emr-studio" + s3_bucket = "hongbomiao-bucket" + s3_uri = "s3://hongbomiao-bucket/amazon-emr/studio/hm-sedona-emr-studio" + environment = var.environment + team = var.team } # AWS Glue DataBrew job diff --git a/terraform/modules/hm_amazon_emr_studio/main.tf b/terraform/modules/hm_amazon_emr_studio/main.tf index 9916e9e7c0..0a842ad4fd 100644 --- a/terraform/modules/hm_amazon_emr_studio/main.tf +++ b/terraform/modules/hm_amazon_emr_studio/main.tf @@ -63,11 +63,11 @@ resource "aws_emr_studio" "hm_amazon_emr_studio" { name = var.amazon_emr_studio_name auth_mode = "IAM" default_s3_location = var.s3_uri - engine_security_group_id = var.engine_security_group_id - workspace_security_group_id = var.workspace_security_group_id - vpc_id = var.vpc_id - subnet_ids = var.subnet_ids service_role = aws_iam_role.hm_amazon_emr_studio_iam_role.arn + engine_security_group_id = "sg-xxxxxxxxxxxxxxxxx" + workspace_security_group_id = "sg-xxxxxxxxxxxxxxxxx" + vpc_id = "vpc-xxxxxxxxxxxxxxxxx" + subnet_ids = ["subnet-xxxxxxxxxxxxxxxxx"] tags = { Environment = var.environment Team = var.team diff --git a/terraform/modules/hm_amazon_emr_studio/variables.tf b/terraform/modules/hm_amazon_emr_studio/variables.tf index 6929053c08..ae5a1ac6b9 100644 --- a/terraform/modules/hm_amazon_emr_studio/variables.tf +++ b/terraform/modules/hm_amazon_emr_studio/variables.tf @@ -7,18 +7,6 @@ variable "s3_bucket" { variable "s3_uri" { type = string } -variable "engine_security_group_id" { - type = string -} -variable "subnet_ids" { - type = list(string) -} -variable "vpc_id" { - type = string -} -variable "workspace_security_group_id" { - type = string -} variable "environment" { type = string }