-
Notifications
You must be signed in to change notification settings - Fork 26
/
.ee.tpl.yaml
49 lines (46 loc) · 1.8 KB
/
.ee.tpl.yaml
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
# This basic CloudFormation template is used in temporary EventEngine accounts... The permissions are probably
# more generous than you'd want to grant in a production account!
AWSTemplateFormatVersion: '2010-09-09'
Resources:
SageMakerIamRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
-
Effect: Allow
Principal:
Service: sagemaker.amazonaws.com
Action: sts:AssumeRole
Path: /
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/AmazonSageMakerFullAccess'
- 'arn:aws:iam::aws:policy/AmazonS3FullAccess'
- 'arn:aws:iam::aws:policy/IAMFullAccess'
# SageMaker notebook
NotebookConfig:
Type: 'AWS::SageMaker::NotebookInstanceLifecycleConfig'
Properties:
NotebookInstanceLifecycleConfigName: !Sub '${AWS::StackName}-LifecycleConfig'
OnStart:
- Content:
Fn::Base64: !Sub |
#!/bin/bash
set -e
# Install extension for ipywidgets interactivity:
sudo -u ec2-user -i <<'EOF'
source /home/ec2-user/anaconda3/bin/activate JupyterSystemEnv
jupyter labextension install @jupyter-widgets/jupyterlab-manager
source /home/ec2-user/anaconda3/bin/deactivate
EOF
NotebookInstance:
Type: 'AWS::SageMaker::NotebookInstance'
Properties:
InstanceType: ml.t2.medium
LifecycleConfigName: !GetAtt NotebookConfig.NotebookInstanceLifecycleConfigName
# Otherwise it gets some garbage name by default:
NotebookInstanceName: !Sub '${AWS::StackName}-Notebook'
RoleArn: !GetAtt SageMakerIamRole.Arn
VolumeSizeInGB: 20
DefaultCodeRepository: https://github.com/apac-ml-tfc/sagemaker-workshop-101