-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEMRCFTemplate.json
More file actions
181 lines (180 loc) · 6.57 KB
/
Copy pathEMRCFTemplate.json
File metadata and controls
181 lines (180 loc) · 6.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
{
"Description": "CloudFormation template for creating an EMR cluster",
"Outputs": {
"IPAddress": {
"Description": "IP address of EMR cluster MasterNode",
"Value": {
"Fn::GetAtt": [
"EMRSampleCluster",
"MasterPublicDNS"
]
}
}
},
"Parameters": {
"CoreInstanceCount": {
"Default": "3",
"Description": "Number of core instances",
"Type": "Number"
},
"CoreInstanceType": {
"Default": "m3.2xlarge",
"Description": "Instance Type of the core node",
"Type": "String"
},
"EMRClusterName": {
"Default": "EMRSampleCluster",
"Description": "Cluster name for the EMR",
"Type": "String"
},
"EMRLogDir": {
"Description": "Log Dir for the EMR cluster",
"Type": "String"
},
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH to the instances",
"Type": "AWS::EC2::KeyPair::KeyName"
},
"MasterInstanceType": {
"Default": "m3.2xlarge",
"Description": "Instance Type of the master node",
"Type": "String"
},
"Subnet": {
"Description": "Subnet ID for creating the EMR cluster",
"Type": "AWS::EC2::Subnet::Id"
},
"VPC": {
"Description": "VPC ID for creating the EMR cluster",
"Type": "AWS::EC2::VPC::Id"
},
"emrReleaseLabel": {
"Default": "emr-5.4.0",
"AllowedValues" : ["emr-5.0.0","emr-5.4.0", "emr-5.16.0", "emr-5.17.0"],
"Description": "Release label for the EMR cluster",
"Type": "String"
},
"s3artifactsRepo": {
"Default": "s3://aws-emrmsk-blog/artifacts",
"Description": "Git Repo URL for this blog.",
"Type": "String"
}
},
"Conditions" : {
"emr-5.4" : {"Fn::Equals" : [{"Ref" : "emrReleaseLabel"}, "emr-5.4.0"]},
"emr-5.0" : {"Fn::Equals" : [{"Ref" : "emrReleaseLabel"}, "emr-5.0.0"]},
"OlderEmrVersion": {"Fn::Or": [{"Condition": "emr-5.4"}, {"Condition": "emr-5.0" }]}
},
"Resources": {
"EMRSampleCluster": {
"Properties": {
"Applications": [
{
"Name": "Hive"
},
{
"Name": "Spark"
},
{
"Name": "Zepplin"
}
],
"BootstrapActions": [
{
"Name": "Download scripts",
"ScriptBootstrapAction": {
"Path": {
"Fn::Join": ["", [{"Ref" : "s3artifactsRepo"}, "/scripts/install-scripts.sh"]]},
"Args": [{ "Ref" : "s3artifactsRepo" }]
}
}
],
"Instances": {
"CoreInstanceGroup": {
"EbsConfiguration": {
"EbsBlockDeviceConfigs": [
{
"VolumeSpecification": {
"SizeInGB": "50",
"VolumeType": "gp2"
},
"VolumesPerInstance": "1"
}
],
"EbsOptimized": "true"
},
"InstanceCount": {
"Ref": "CoreInstanceCount"
},
"InstanceType": {
"Ref": "CoreInstanceType"
},
"Market": "ON_DEMAND",
"Name": "Core Instance"
},
"Ec2KeyName": {
"Ref": "KeyName"
},
"Ec2SubnetId": {
"Ref": "Subnet"
},
"AdditionalMasterSecurityGroups" : [ "sg-9cb487fb","sg-9cb4876b" ],
"AdditionalSlaveSecurityGroups" : [ "sg-9cb48144","sg-9cb48788" ],
"MasterInstanceGroup": {
"InstanceCount": "1",
"InstanceType": {
"Ref": "MasterInstanceType"
},
"Market": "ON_DEMAND",
"Name": "Master Instance"
},
"TerminationProtected": "false"
},
"JobFlowRole": "EMR_EC2_DefaultRole",
"LogUri": {
"Ref": "EMRLogDir"
},
"Name": {
"Ref": "EMRClusterName"
},
"ReleaseLabel": {
"Ref": "emrReleaseLabel"
},
"ServiceRole": "EMR_DefaultRole",
"Tags": [
{
"Key": "Name",
"Value": "EMR Sample Cluster"
}
],
"VisibleToAllUsers": "true"
},
"Type": "AWS::EMR::Cluster"
},
"SparkStep": {
"Properties": {
"ActionOnFailure": "CONTINUE",
"HadoopJarStep": {
"Args": [
"spark-submit",
"--deploy-mode",
"cluster",
"--class",
"org.apache.spark.examples.streaming.JavaDirectKafkaWordCount",
"/usr/lib/spark/examples/jars/spark-examples.jar",
"10"
],
"Jar": "command-runner.jar",
"MainClass": ""
},
"JobFlowId": {
"Ref": "EMRSampleCluster"
},
"Name": "SparkStep"
},
"Type": "AWS::EMR::Step"
}
}
}