Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ class FakePipeline extends cdk.Resource implements sagemaker.IPipeline {
});
}

public get pipelineRef(): cdk.aws_sagemaker.PipelineReference {
return { pipelineName: this.pipelineName };
}

public grantStartPipelineExecution(grantee: IGrantable): Grant {
return Grant.addToPrincipal({
grantee,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ interface FakePipelineProps {
}

class FakePipeline extends cdk.Resource implements sagemaker.IPipeline {
public readonly pipelineRef: sagemaker.PipelineReference;
public readonly pipelineArn;
public readonly pipelineName;

Expand Down Expand Up @@ -125,6 +126,8 @@ class FakePipeline extends cdk.Resource implements sagemaker.IPipeline {
resourceName: pipeline.pipelineName,
arnFormat: cdk.ArnFormat.SLASH_RESOURCE_NAME,
});

this.pipelineRef = { pipelineName: this.pipelineName };
}

public grantStartPipelineExecution(grantee: iam.IGrantable): iam.Grant {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { InputTransformation, Pipe } from '@aws-cdk/aws-pipes-alpha';
import { App, Stack, Resource } from 'aws-cdk-lib';
import { Template } from 'aws-cdk-lib/assertions';
import * as iam from 'aws-cdk-lib/aws-iam';
import { IPipeline } from 'aws-cdk-lib/aws-sagemaker';
import { IPipeline, PipelineReference } from 'aws-cdk-lib/aws-sagemaker';
import { TestSource } from './test-classes';
import { SageMakerTarget } from '../lib';

Expand Down Expand Up @@ -131,4 +131,8 @@ class FakePipeline extends Resource implements IPipeline {
resourceArns: [this.pipelineArn],
});
}

public get pipelineRef(): PipelineReference {
return { pipelineName: this.pipelineName };
}
}
6 changes: 6 additions & 0 deletions packages/@aws-cdk/aws-sagemaker-alpha/lib/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ abstract class EndpointBase extends cdk.Resource implements IEndpoint {
resourceArns: [this.endpointArn],
});
}

public get endpointRef(): sagemaker.EndpointReference {
return {
endpointArn: this.endpointArn,
};
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ class FakeEndpoint extends cdk.Resource implements sagemaker.IEndpoint {
resourceArns: [this.endpointArn],
});
}

public get endpointRef(): sagemaker.EndpointReference {
return { endpointArn: this.endpointArn };
}
}
3 changes: 2 additions & 1 deletion packages/aws-cdk-lib/aws-sagemaker/lib/endpoint.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import * as iam from '../../aws-iam';
import { IResource } from '../../core';
import { IEndpointRef } from '../../interfaces/generated/aws-sagemaker-interfaces.generated';

/**
* The interface for a SageMaker Endpoint resource.
*/
export interface IEndpoint extends IResource {
export interface IEndpoint extends IResource, IEndpointRef {
/**
* The ARN of the endpoint.
*
Expand Down
3 changes: 2 additions & 1 deletion packages/aws-cdk-lib/aws-sagemaker/lib/pipeline.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Grant, IGrantable } from '../../aws-iam';
import { IResource } from '../../core';
import { IPipelineRef } from '../../interfaces/generated/aws-sagemaker-interfaces.generated';

/**
* The interface for a SageMaker Pipeline resource.
*/
export interface IPipeline extends IResource {
export interface IPipeline extends IResource, IPipelineRef {
/**
* The ARN of the pipeline.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Template } from '../../assertions';
import { AccountRootPrincipal, Grant, IGrantable, Role } from '../../aws-iam';
import { IPipeline } from '../../aws-sagemaker';
import { IPipeline, PipelineReference } from '../../aws-sagemaker';
import { ScheduleExpression, Schedule, ScheduleGroup } from '../../aws-scheduler';
import * as sqs from '../../aws-sqs';
import { App, Duration, Resource, Stack } from '../../core';
Expand Down Expand Up @@ -592,6 +592,10 @@ class FakePipeline extends Resource implements IPipeline {
this.pipelineName = props.pipelineName;
}

public get pipelineRef(): PipelineReference {
return { pipelineName: this.pipelineName };
}

public grantStartPipelineExecution(grantee: IGrantable): Grant {
return Grant.addToPrincipal({
grantee,
Expand Down
Loading