-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstep1a-hub-sagemaker-domain-userprofile.yaml
93 lines (83 loc) · 2.41 KB
/
step1a-hub-sagemaker-domain-userprofile.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
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
AWSTemplateFormatVersion: '2010-09-09'
Description: 'CloudFormation template for creating SageMaker Domain and User Profile'
# step1b <-- creates SM domain and user profile in Hub Account
Parameters:
DomainName:
Type: String
Description: Name of the SageMaker Domain
UserProfileName:
Type: String
Description: Name of the User Profile
Resources:
SageMakerDomain:
Type: AWS::SageMaker::Domain
Properties:
DomainName: !Ref DomainName
AuthMode: IAM
DefaultUserSettings:
ExecutionRole: !GetAtt SageMakerExecutionRole.Arn
AppNetworkAccessType: PublicInternetOnly
VpcId: !Ref SageMakerVPC
SubnetIds:
- !Ref SageMakerSubnet
SageMakerUserProfile:
Type: AWS::SageMaker::UserProfile
Properties:
DomainId: !GetAtt SageMakerDomain.DomainId
UserProfileName: !Ref UserProfileName
UserSettings:
ExecutionRole: !GetAtt SageMakerExecutionRole.Arn
SageMakerExecutionRole:
Type: AWS::IAM::Role
Properties:
RoleName: HubAccountSagemakerExecutionRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- sagemaker.amazonaws.com
Action:
- 'sts:AssumeRole'
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonSageMakerFullAccess
SageMakerVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsHostnames: true
EnableDnsSupport: true
InstanceTenancy: default
Tags:
- Key: Name
Value: SageMaker VPC
SageMakerSubnet:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref SageMakerVPC
AvailabilityZone: !Select
- 0
- !GetAZs
Ref: 'AWS::Region'
CidrBlock: 10.0.0.0/24
MapPublicIpOnLaunch: false
Tags:
- Key: Name
Value: SageMaker Subnet
Outputs:
DomainId:
Description: ID of the created SageMaker Domain
Value: !GetAtt SageMakerDomain.DomainId
Export:
Name: SagemakerDomainId
UserProfileArn:
Description: ARN of the created User Profile
Value: !GetAtt SageMakerUserProfile.UserProfileArn
Export:
Name: SagemakerUserProfileArn
SageMakerExecutionRole:
Description: Name of the SageMaker Execution Role
Value: !GetAtt SageMakerExecutionRole.Arn
Export:
Name: SageMakerExecutionRole