Ai Endpoint
Models are deployed into it, and afterwards Endpoint is called to obtain predictions and explanations. To get more information about Endpoint, see:
How-to Guides
Example Usage
Vertex Ai Endpoint Network
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.compute.GlobalAddress;
import com.pulumi.gcp.compute.GlobalAddressArgs;
import com.pulumi.gcp.servicenetworking.Connection;
import com.pulumi.gcp.servicenetworking.ConnectionArgs;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.vertex.AiEndpoint;
import com.pulumi.gcp.vertex.AiEndpointArgs;
import com.pulumi.gcp.vertex.inputs.AiEndpointEncryptionSpecArgs;
import com.pulumi.gcp.kms.CryptoKeyIAMMember;
import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var vertexNetwork = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
.name("network-name")
.build());
var vertexRange = new GlobalAddress("vertexRange", GlobalAddressArgs.builder()
.purpose("VPC_PEERING")
.addressType("INTERNAL")
.prefixLength(24)
.network(vertexNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
.build());
var vertexVpcConnection = new Connection("vertexVpcConnection", ConnectionArgs.builder()
.network(vertexNetwork.applyValue(getNetworkResult -> getNetworkResult.id()))
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(vertexRange.name())
.build());
final var project = OrganizationsFunctions.getProject();
var endpoint = new AiEndpoint("endpoint", AiEndpointArgs.builder()
.displayName("sample-endpoint")
.description("A sample vertex endpoint")
.location("us-central1")
.region("us-central1")
.labels(Map.of("label-one", "value-one"))
.network(String.format("projects/%s/global/networks/%s", project.applyValue(getProjectResult -> getProjectResult.number()),vertexNetwork.applyValue(getNetworkResult -> getNetworkResult.name())))
.encryptionSpec(AiEndpointEncryptionSpecArgs.builder()
.kmsKeyName("kms-name")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(vertexVpcConnection)
.build());
var cryptoKey = new CryptoKeyIAMMember("cryptoKey", CryptoKeyIAMMemberArgs.builder()
.cryptoKeyId("kms-name")
.role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
.member(String.format("serviceAccount:service-%s@gcp-sa-aiplatform.iam.gserviceaccount.com", project.applyValue(getProjectResult -> getProjectResult.number())))
.build());
}
}
Import
Endpoint can be imported using any of these accepted formats
$ pulumi import gcp:vertex/aiEndpoint:AiEndpoint default projects/{{project}}/locations/{{location}}/endpoints/{{name}}
$ pulumi import gcp:vertex/aiEndpoint:AiEndpoint default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:vertex/aiEndpoint:AiEndpoint default {{location}}/{{name}}
Properties
(Output) Output only. Timestamp when the DeployedModel was created.
Output only. The models deployed in this Endpoint. To add or remove DeployedModels use EndpointService.DeployModel and EndpointService.UndeployModel respectively. Models can also be deployed and undeployed using the Cloud Console. Structure is documented below.
The description of the Endpoint.
Required. The display name of the Endpoint. The name can be up to 128 characters long and can consist of any UTF-8 characters.
Customer-managed encryption key spec for an Endpoint. If set, this Endpoint and all sub-resources of this Endpoint will be secured by this key. Structure is documented below.
The labels with user-defined metadata to organize your Endpoints. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
Output only. Resource name of the Model Monitoring job associated with this Endpoint if monitoring is enabled by CreateModelDeploymentMonitoringJob. Format: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}
The full name of the Google Compute Engine network to which the Endpoint should be peered. Private services access must already be configured for the network. If left unspecified, the Endpoint is not peered with any network. Only one of the fields, network or enable_private_service_connect, can be set. Format: projects/{project}/global/networks/{network}
. Where {project}
is a project number, as in 12345
, and {network}
is network name.
Output only. Timestamp when this Endpoint was last updated.