当我将服务设置为SageMakerRuntime
或SageMaker
时,它引发了错误AWS Service of type SagemakerRuntime not supported (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException;
,我找不到有关受支持的服务的文档。但是,从控制台设置api网关时,我看到选项SageMaker Runtime
,其余配置正常。
const integration = new AwsIntegration({
service: "SageMakerRuntime",
path: "endpoints/{endpointName}/invocations",
integrationHttpMethod: "POST",
options: {
credentialsRole: Role.fromRoleArn(
this,
"Execution role",
"<arn>"
)
}
});
const postMethod = api.root
.addResource(this.node.tryGetContext("serviceVersion"))
.addResource("endpoints")
.addResource("{endpointName}")
.addResource("inferences")
.addMethod("POST", integration);
答案 0 :(得分:1)
CDK中的SageMaker Runtime服务名称为runtime.sagemaker
。将该参数传递给service参数,您应该会很好。
对于CDK,服务名称使用的格式与aws list-services
显示的格式不同。我在ServiceName
下找到了这种格式:
https://docs.aws.amazon.com/sdk-for-go/api/service/sagemakerruntime/