Skip to content

Instantly share code, notes, and snippets.

@schosterbarak
Last active April 22, 2022 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schosterbarak/18697e82cff59baef11dc63139afa601 to your computer and use it in GitHub Desktop.
Save schosterbarak/18697e82cff59baef11dc63139afa601 to your computer and use it in GitHub Desktop.
resource "aws_emr_cluster" "production_data_engineering" {
name = "emr-test-arn"
release_label = "emr-4.6.0"
applications = ["Spark"]
ec2_attributes {
emr_managed_master_security_group = aws_security_group.dev.id
emr_managed_slave_security_group = aws_security_group.dev.id
instance_profile = "connected_to_aws_iam_instance_profile"
}
}
resource "aws_security_group" "dev" {
name = "block_access"
description = "Block all traffic"
ingress {
from_port = 0
to_port = 65535
protocol = "-1"
cidr_blocks = [var.dev_cidr_block]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = [var.dev_cidr_block]
}
}
variable "dev_cidr_block" {
default = "0.0.0.0/0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment