class Endpoint (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Sagemaker.Alpha.Endpoint |
Go | github.com/aws/aws-cdk-go/awscdksagemakeralpha/v2#Endpoint |
Java | software.amazon.awscdk.services.sagemaker.alpha.Endpoint |
Python | aws_cdk.aws_sagemaker_alpha.Endpoint |
TypeScript (source) | @aws-cdk/aws-sagemaker-alpha ยป Endpoint |
Implements
IConstruct, IDependable, IResource, IEndpoint, IEndpoint
Defines a SageMaker endpoint.
Example
import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';
declare const endpointConfig: sagemaker.EndpointConfig;
const endpoint = new sagemaker.Endpoint(this, 'Endpoint', { endpointConfig });
const productionVariant = endpoint.findInstanceProductionVariant('my-variant');
productionVariant.metricModelLatency().createAlarm(this, 'ModelLatencyAlarm', {
threshold: 100000,
evaluationPeriods: 3,
});
Initializer
new Endpoint(scope: Construct, id: string, props: EndpointProps)
Parameters
- scope
Construct - id
string - props
EndpointProps
Construct Props
| Name | Type | Description |
|---|---|---|
| endpoint | IEndpoint | The endpoint configuration to use for this endpoint. |
| endpoint | string | Name of the endpoint. |
endpointConfig
Type:
IEndpoint
The endpoint configuration to use for this endpoint.
endpointName?
Type:
string
(optional, default: AWS CloudFormation generates a unique physical ID and uses that ID for the
endpoint's name.)
Name of the endpoint.
Properties
| Name | Type | Description |
|---|---|---|
| endpoint | string | The ARN of the endpoint. |
| endpoint | string | The name of the endpoint. |
| env | Resource | The environment this resource belongs to. |
| instance | IEndpoint[] | Get instance production variants associated with endpoint. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
endpointArn
Type:
string
The ARN of the endpoint.
endpointName
Type:
string
The name of the endpoint.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
instanceProductionVariants
Type:
IEndpoint[]
Get instance production variants associated with endpoint.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| find | Find instance production variant based on variant name. |
| grant | Permits an IAM principal to invoke this endpoint. |
| to | Returns a string representation of this construct. |
| static from | Imports an Endpoint defined either outside the CDK or in a different CDK stack. |
| static from | Imports an Endpoint defined either outside the CDK or in a different CDK stack. |
| static from | Imports an Endpoint defined either outside the CDK or in a different CDK stack. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
findInstanceProductionVariant(name)
public findInstanceProductionVariant(name: string): IEndpointInstanceProductionVariant
Parameters
- name
stringโ Variant name from production variant.
Returns
Find instance production variant based on variant name.
grantInvoke(grantee)
public grantInvoke(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The principal to grant access to.
Returns
Permits an IAM principal to invoke this endpoint.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromEndpointArn(scope, id, endpointArn)
public static fromEndpointArn(scope: Construct, id: string, endpointArn: string): IEndpoint
Parameters
- scope
Constructโ the Construct scope. - id
stringโ the resource id. - endpointArn
stringโ the ARN of the endpoint.
Returns
Imports an Endpoint defined either outside the CDK or in a different CDK stack.
static fromEndpointAttributes(scope, id, attrs)
public static fromEndpointAttributes(scope: Construct, id: string, attrs: EndpointAttributes): IEndpoint
Parameters
- scope
Constructโ the Construct scope. - id
stringโ the resource id. - attrs
Endpointโ the attributes of the endpoint to import.Attributes
Returns
Imports an Endpoint defined either outside the CDK or in a different CDK stack.
static fromEndpointName(scope, id, endpointName)
public static fromEndpointName(scope: Construct, id: string, endpointName: string): IEndpoint
Parameters
- scope
Constructโ the Construct scope. - id
stringโ the resource id. - endpointName
stringโ the name of the endpoint.
Returns
Imports an Endpoint defined either outside the CDK or in a different CDK stack.

.NET
Go
Java
Python
TypeScript (