-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sagemaker role to CI isolation stack
- Loading branch information
1 parent
e4a3973
commit e815e2f
Showing
3 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ation/src/main/java/com/exasol/adapter/document/files/ciisolation/SageMakerRoleStack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.exasol.adapter.document.files.ciisolation; | ||
|
||
import com.exasol.ciisolation.aws.TaggedStack; | ||
import com.exasol.ciisolation.aws.ciuser.CiUserStack.CiUserStackProps; | ||
|
||
import software.amazon.awscdk.services.iam.*; | ||
import software.constructs.Construct; | ||
|
||
class SageMakerRoleStack extends TaggedStack { | ||
SageMakerRoleStack(final Construct scope, final String id, final CiUserStackProps props) { | ||
super(scope, id, null, props.projectName()); | ||
Role role = Role.Builder.create(this, "Role") | ||
.assumedBy(new CompositePrincipal(new ServicePrincipal("sagemaker.amazonaws.com"))) | ||
.description( | ||
"Allows SageMaker notebook instances, training jobs, and models to access S3, ECR, and CloudWatch on your behalf.") | ||
.build(); | ||
tagResource(role); | ||
role.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName("AmazonSageMakerFullAccess")); | ||
} | ||
} |