Guest User

Untitled

a guest
Jan 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. {
  2. "Description": "CloudFormation template for creating an EMR cluster",
  3. "Outputs": {
  4. "IPAddress": {
  5. "Description": "IP address of EMR cluster MasterNode",
  6. "Value": {
  7. "Fn::GetAtt": [
  8. "EMRSampleCluster",
  9. "MasterPublicDNS"
  10. ]
  11. }
  12. }
  13. },
  14. "Parameters": {
  15.  
  16. "CoreInstanceCount": {
  17. "Default": "3",
  18. "Description": "Number of core instances",
  19. "Type": "Number"
  20. },
  21. "CoreInstanceType": {
  22. "Default": "m4.xlarge",
  23. "Description": "Instance Type of the core node",
  24. "Type": "String"
  25. },
  26. "EMRClusterName": {
  27. "Default": "SecurityPOCCluster",
  28. "Description": "Cluster name for the EMR",
  29. "Type": "String"
  30. },
  31. "EMRLogDir": {
  32. "Description": "Log Dir for the EMR cluster",
  33. "Type": "String"
  34. },
  35. "KeyName": {
  36. "Description": "Name of an existing EC2 KeyPair to enable SSH to the instances",
  37. "Type": "AWS::EC2::KeyPair::KeyName"
  38. },
  39.  
  40. "MasterInstanceType": {
  41. "Default": "m4.xlarge",
  42. "Description": "Instance Type of the master node",
  43. "Type": "String"
  44. },
  45.  
  46. "Subnet": {
  47. "Description": "Subnet ID for creating the EMR cluster",
  48. "Type": "AWS::EC2::Subnet::Id"
  49. },
  50. "VPC": {
  51. "Description": "VPC ID for creating the EMR cluster",
  52. "Type": "AWS::EC2::VPC::Id"
  53. },
  54. "emrReleaseLabel": {
  55. "Default": "emr-5.9.0",
  56. "Description": "Release label for the EMR cluster",
  57. "Type": "String"
  58. }
  59. },
  60. "Resources": {
  61. "EMRSampleCluster": {
  62. "Properties": {
  63. "Applications": [{
  64. "Name": "Hive"
  65. },
  66. {
  67. "Name": "Spark"
  68. },
  69. {
  70. "Name": "Sqoop"
  71. },
  72. {
  73. "Name": "Hue"
  74. }
  75. ],
  76.  
  77.  
  78. "Instances": {
  79. "CoreInstanceGroup": {
  80.  
  81. "InstanceCount": {
  82. "Ref": "CoreInstanceCount"
  83. },
  84. "InstanceType": {
  85. "Ref": "CoreInstanceType"
  86. },
  87. "Market": "ON_DEMAND",
  88. "Name": "Core Instance"
  89. },
  90. "Ec2KeyName": {
  91. "Ref": "KeyName"
  92. },
  93. "Ec2SubnetId": {
  94. "Ref": "Subnet"
  95. },
  96. "MasterInstanceGroup": {
  97. "InstanceCount": "1",
  98. "InstanceType": {
  99. "Ref": "MasterInstanceType"
  100. },
  101. "Market": "ON_DEMAND",
  102. "Name": "Master Instance"
  103. },
  104. "TerminationProtected": "false"
  105. },
  106. "JobFlowRole": "EMR_EC2_DefaultRole",
  107. "LogUri": {
  108. "Ref": "EMRLogDir"
  109. },
  110. "Name": {
  111. "Ref": "EMRClusterName"
  112. },
  113. "ReleaseLabel": {
  114. "Ref": "emrReleaseLabel"
  115. },
  116. "ServiceRole": "EMR_DefaultRole",
  117. "Tags": [{
  118. "Key": "Name",
  119. "Value": "EMR Sample Cluster"
  120. }],
  121. "VisibleToAllUsers": "true"
  122. },
  123. "Type": "AWS::EMR::Cluster"
  124. },
  125. "LoadHDFSData": {
  126. "Properties": {
  127. "ActionOnFailure": "CONTINUE",
  128. "HadoopJarStep": {
  129. "Args": [
  130. "s3://mahis3bucket/moodys/loadloads3.sh"
  131. ],
  132. "Jar": "s3://elasticmapreduce/libs/script-runner/script-runner.jar",
  133. "MainClass": ""
  134. },
  135. "JobFlowId": {
  136. "Ref": "EMRSampleCluster"
  137. },
  138. "Name": "LoadHDFSData"
  139. },
  140. "Type": "AWS::EMR::Step"
  141. },
  142.  
  143. "SparkStep": {
  144. "Properties": {
  145. "ActionOnFailure": "CONTINUE",
  146. "HadoopJarStep": {
  147. "Args": [
  148. "spark-submit",
  149. "--deploy-mode",
  150. "cluster",
  151. "s3://mahis3bucket/moodys/py5.py",
  152. "10"
  153. ],
  154. "Jar": "command-runner.jar",
  155. "MainClass": ""
  156. },
  157. "JobFlowId": {
  158. "Ref": "EMRSampleCluster"
  159. },
  160. "Name": "SparkStep"
  161. },
  162. "Type": "AWS::EMR::Step"
  163. }
  164. }
  165. }
Add Comment
Please, Sign In to add comment