Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
tweak
  • Loading branch information
go-to-k committed Feb 7, 2024
1 parent 319fcb3 commit d6d3c59
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Grant, IGrantable, ManagedPolicy, Role, ServicePrincipal } from 'aws-cd
import { Bucket } from 'aws-cdk-lib/aws-s3';
import { CfnPipeline, IPipeline } from 'aws-cdk-lib/aws-sagemaker';
import { SageMakerPipelineParameter, SageMakerStartPipelineExecution } from '../lib';
import { Construct } from 'constructs';

interface FakePipelineProps {
readonly pipelineName: string;
Expand All @@ -14,15 +15,17 @@ class FakePipeline extends cdk.Resource implements IPipeline {
public readonly pipelineArn;

public readonly pipelineName;
constructor(scope: cdk.Stack, id: string, props: FakePipelineProps) {
super(scope, id);
constructor(scope: Construct, id: string, props: FakePipelineProps) {
super(scope, id, {
physicalName: props.pipelineName,
});
this.pipelineName = props.pipelineName;

const sourceBucket = new Bucket(stack, 'SourceBucket', {
const sourceBucket = new Bucket(this, 'SourceBucket', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
autoDeleteObjects: true,
});
const outputBucket = new Bucket(stack, 'OutputBucket', {
const outputBucket = new Bucket(this, 'OutputBucket', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
autoDeleteObjects: true,
});
Expand Down Expand Up @@ -73,12 +76,12 @@ class FakePipeline extends cdk.Resource implements IPipeline {
}),
};

const pipelineRole = new Role(stack, 'SageMakerPipelineRole', {
const pipelineRole = new Role(this, 'SageMakerPipelineRole', {
assumedBy: new ServicePrincipal('sagemaker.amazonaws.com'),
});
pipelineRole.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName('AmazonSageMakerFullAccess'));

const pipeline = new CfnPipeline(stack, 'Resource', {
const pipeline = new CfnPipeline(this, 'Resource', {
pipelineName: this.pipelineName,
pipelineDefinition: pipelineDefinition,
roleArn: pipelineRole.roleArn,
Expand Down

0 comments on commit d6d3c59

Please sign in to comment.