-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathemr_serverless_full_deployment.yaml
More file actions
101 lines (97 loc) · 2.8 KB
/
emr_serverless_full_deployment.yaml
File metadata and controls
101 lines (97 loc) · 2.8 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
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
AWSTemplateFormatVersion: 2010-09-09
Description: EMR Serverless full deployment stack
Resources:
# S3 Bucket for logs
EMRServerlessLogBucket:
Type: AWS::S3::Bucket
# IAM resources
EMRServerlessJobRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- emr-serverless.amazonaws.com
Action:
- 'sts:AssumeRole'
Description: "Service role for EMR Studio"
RoleName: EMRServerless_Job_Execution_Role
Policies:
- PolicyName: GlueAccess
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "glue:GetDatabase"
- "glue:GetDataBases"
- "glue:CreateTable"
- "glue:GetTable"
- "glue:GetTables"
- "glue:GetPartition"
- "glue:GetPartitions"
- "glue:CreatePartition"
- "glue:BatchCreatePartition"
- "glue:GetUserDefinedFunctions"
Resource: '*'
- PolicyName: S3Access
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "s3:GetObject"
- "s3:ListBucket"
Resource: '*'
- Effect: Allow
Action:
- "s3:PutObject"
- "s3:DeleteObject"
Resource:
- !Sub 'arn:aws:s3:::${EMRServerlessLogBucket}/*'
SparkApplication:
Type: AWS::EMRServerless::Application
Properties:
Name: spark-3.2
ReleaseLabel: emr-6.6.0
Type: Spark
MaximumCapacity:
Cpu: 200 vCPU
Memory: 100 GB
AutoStartConfiguration:
Enabled: true
AutoStopConfiguration:
Enabled: true
IdleTimeoutMinutes: 100
InitialCapacity:
- Key: Driver
Value:
WorkerCount: 3
WorkerConfiguration:
Cpu: 2 vCPU
Memory: 4 GB
Disk: 21 GB
- Key: Executor
Value:
WorkerCount: 4
WorkerConfiguration:
Cpu: 1 vCPU
Memory: 4 GB
Disk: 20 GB
Tags:
- Key: tag-on-create-key
Value: tag-on-create-value
Outputs:
ApplicationId:
Value: !Ref SparkApplication
ApplicationArn:
Value: !GetAtt SparkApplication.Arn
JobRoleArn:
Value: !GetAtt EMRServerlessJobRole.Arn
S3Bucket:
Value: !Ref EMRServerlessLogBucket