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
Endpoint
Props
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. |
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.
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. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
).
InstanceProductionVariant(name)
findpublic findInstanceProductionVariant(name: string): IEndpointInstanceProductionVariant
Parameters
- name
string
โ Variant name from production variant.
Returns
Find instance production variant based on variant name.
Invoke(grantee)
grantpublic grantInvoke(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
โ The principal to grant access to.
Returns
Permits an IAM principal to invoke this endpoint.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
EndpointArn(scope, id, endpointArn)
static frompublic 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.
EndpointAttributes(scope, id, attrs)
static frompublic 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.
EndpointName(scope, id, endpointName)
static frompublic 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.