Amazon web services Aws CDK:Api网关、sagemaker集成、SageMakerRuntime类型的Aws服务不受支持错误

Amazon web services Aws CDK:Api网关、sagemaker集成、SageMakerRuntime类型的Aws服务不受支持错误,amazon-web-services,amazon-cloudformation,aws-api-gateway,amazon-sagemaker,aws-cdk,Amazon Web Services,Amazon Cloudformation,Aws Api Gateway,Amazon Sagemaker,Aws Cdk,当我将服务设置为SageMakerRuntime或SageMakerRuntime时,它抛出错误SageMakerRuntime类型的AWS服务不受支持(服务:AmazonApiGateway;状态代码:400;错误代码:BadRequestException;我找不到支持的服务的文档。但是,当从控制台设置api网关时,我看到选项SageMaker Runtime,其余配置工作正常 const integration = new AwsIntegration({ service: "

当我将服务设置为
SageMakerRuntime
SageMakerRuntime
时,它抛出错误
SageMakerRuntime类型的AWS服务不受支持(服务:AmazonApiGateway;状态代码:400;错误代码: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);
const integration=新的AWS集成({
服务:“SAGEMAKERROUNTIME”,
路径:“端点/{endpointName}/invocations”,
integrationHttpMethod:“发布”,
选项:{
credentialsRole:Role.fromRoleArn(
这
“执行角色”,
""
)
}
});
const postMethod=api.root
.addResource(this.node.tryGetContext(“serviceVersion”))
.addResource(“端点”)
.addResource(“{endpointName}”)
.addResource(“推论”)
.addMethod(“POST”,集成);

SageMaker Runtime在CDK中的服务名称是
Runtime.SageMaker
。将该名称传递给服务参数,您就可以开始了

对于CDK,服务名称使用的格式与aws列表服务所示格式不同。我在这里的
ServiceName
下找到了这种格式: