published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Provides a APIG Ai Model Provider resource.
AI Model Provider.
For information about APIG Ai Model Provider and how to use it, see What is Ai Model Provider.
NOTE: Available since v1.286.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
// The ID of an existing AI-type APIG gateway
const gatewayId = config.require("gatewayId");
const _default = new alicloud.apig.AiModelProvider("default", {
gatewayId: gatewayId,
modelProvider: "openai",
displayName: name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
# The ID of an existing AI-type APIG gateway
gateway_id = config.require("gatewayId")
default = alicloud.apig.AiModelProvider("default",
gateway_id=gateway_id,
model_provider="openai",
display_name=name)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apig"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
// The ID of an existing AI-type APIG gateway
gatewayId := cfg.Require("gatewayId")
_, err := apig.NewAiModelProvider(ctx, "default", &apig.AiModelProviderArgs{
GatewayId: pulumi.String(gatewayId),
ModelProvider: pulumi.String("openai"),
DisplayName: pulumi.String(name),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
// The ID of an existing AI-type APIG gateway
var gatewayId = config.Require("gatewayId");
var @default = new AliCloud.Apig.AiModelProvider("default", new()
{
GatewayId = gatewayId,
ModelProvider = "openai",
DisplayName = name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.apig.AiModelProvider;
import com.pulumi.alicloud.apig.AiModelProviderArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var gatewayId = config.require("gatewayId");
var default_ = new AiModelProvider("default", AiModelProviderArgs.builder()
.gatewayId(gatewayId)
.modelProvider("openai")
.displayName(name)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
# AiModelProvider must be bound to an existing AI-type APIG gateway.
# Set the gateway_id variable to your own AI gateway.
gatewayId:
type: string
resources:
default:
type: alicloud:apig:AiModelProvider
properties:
gatewayId: ${gatewayId}
modelProvider: openai
displayName: ${name}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
resource "alicloud_apig_aimodelprovider" "default" {
gateway_id = var.gatewayId
model_provider = "openai"
display_name = var.name
}
variable "name" {
type = string
default = "terraform-example"
}
# AiModelProvider must be bound to an existing AI-type APIG gateway.
# Set the gateway_id variable to your own AI gateway.
variable "gatewayId" {
type = string
description = "The ID of an existing AI-type APIG gateway"
}
📚 Need more examples? VIEW MORE EXAMPLES
Create AiModelProvider Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AiModelProvider(name: string, args: AiModelProviderArgs, opts?: CustomResourceOptions);@overload
def AiModelProvider(resource_name: str,
args: AiModelProviderArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AiModelProvider(resource_name: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
gateway_id: Optional[str] = None,
model_provider: Optional[str] = None,
service_ids: Optional[Sequence[str]] = None)func NewAiModelProvider(ctx *Context, name string, args AiModelProviderArgs, opts ...ResourceOption) (*AiModelProvider, error)public AiModelProvider(string name, AiModelProviderArgs args, CustomResourceOptions? opts = null)
public AiModelProvider(String name, AiModelProviderArgs args)
public AiModelProvider(String name, AiModelProviderArgs args, CustomResourceOptions options)
type: alicloud:apig:AiModelProvider
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "alicloud_apig_ai_model_provider" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args AiModelProviderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AiModelProviderArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AiModelProviderArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AiModelProviderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AiModelProviderArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var aiModelProviderResource = new AliCloud.Apig.AiModelProvider("aiModelProviderResource", new()
{
DisplayName = "string",
GatewayId = "string",
ModelProvider = "string",
ServiceIds = new[]
{
"string",
},
});
example, err := apig.NewAiModelProvider(ctx, "aiModelProviderResource", &apig.AiModelProviderArgs{
DisplayName: pulumi.String("string"),
GatewayId: pulumi.String("string"),
ModelProvider: pulumi.String("string"),
ServiceIds: pulumi.StringArray{
pulumi.String("string"),
},
})
resource "alicloud_apig_ai_model_provider" "aiModelProviderResource" {
lifecycle {
create_before_destroy = true
}
display_name = "string"
gateway_id = "string"
model_provider = "string"
service_ids = ["string"]
}
var aiModelProviderResource = new AiModelProvider("aiModelProviderResource", AiModelProviderArgs.builder()
.displayName("string")
.gatewayId("string")
.modelProvider("string")
.serviceIds("string")
.build());
ai_model_provider_resource = alicloud.apig.AiModelProvider("aiModelProviderResource",
display_name="string",
gateway_id="string",
model_provider="string",
service_ids=["string"])
const aiModelProviderResource = new alicloud.apig.AiModelProvider("aiModelProviderResource", {
displayName: "string",
gatewayId: "string",
modelProvider: "string",
serviceIds: ["string"],
});
type: alicloud:apig:AiModelProvider
properties:
displayName: string
gatewayId: string
modelProvider: string
serviceIds:
- string
AiModelProvider Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AiModelProvider resource accepts the following input properties:
- Display
Name string - Model supplier presentation name. Required, no more than 128 characters in length.
- Gateway
Id string - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- Model
Provider string - Stable model vendor ID, no more than 128 characters in length.
- Service
Ids List<string> - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- Display
Name string - Model supplier presentation name. Required, no more than 128 characters in length.
- Gateway
Id string - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- Model
Provider string - Stable model vendor ID, no more than 128 characters in length.
- Service
Ids []string - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- display_
name string - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway_
id string - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model_
provider string - Stable model vendor ID, no more than 128 characters in length.
- service_
ids list(string) - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- display
Name String - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway
Id String - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model
Provider String - Stable model vendor ID, no more than 128 characters in length.
- service
Ids List<String> - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- display
Name string - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway
Id string - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model
Provider string - Stable model vendor ID, no more than 128 characters in length.
- service
Ids string[] - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- display_
name str - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway_
id str - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model_
provider str - Stable model vendor ID, no more than 128 characters in length.
- service_
ids Sequence[str] - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- display
Name String - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway
Id String - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model
Provider String - Stable model vendor ID, no more than 128 characters in length.
- service
Ids List<String> - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
Outputs
All input properties are implicitly available as output properties. Additionally, the AiModelProvider resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Model
Count int - The number of model cards currently associated with the model supplier.
- Source string
- Model supplier source.
- Update
Time string - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- Id string
- The provider-assigned unique ID for this managed resource.
- Model
Count int - The number of model cards currently associated with the model supplier.
- Source string
- Model supplier source.
- Update
Time string - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- id string
- The provider-assigned unique ID for this managed resource.
- model_
count number - The number of model cards currently associated with the model supplier.
- source string
- Model supplier source.
- update_
time string - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- id String
- The provider-assigned unique ID for this managed resource.
- model
Count Integer - The number of model cards currently associated with the model supplier.
- source String
- Model supplier source.
- update
Time String - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- id string
- The provider-assigned unique ID for this managed resource.
- model
Count number - The number of model cards currently associated with the model supplier.
- source string
- Model supplier source.
- update
Time string - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- id str
- The provider-assigned unique ID for this managed resource.
- model_
count int - The number of model cards currently associated with the model supplier.
- source str
- Model supplier source.
- update_
time str - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- id String
- The provider-assigned unique ID for this managed resource.
- model
Count Number - The number of model cards currently associated with the model supplier.
- source String
- Model supplier source.
- update
Time String - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
Look up Existing AiModelProvider Resource
Get an existing AiModelProvider resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AiModelProviderState, opts?: CustomResourceOptions): AiModelProvider@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
gateway_id: Optional[str] = None,
model_count: Optional[int] = None,
model_provider: Optional[str] = None,
service_ids: Optional[Sequence[str]] = None,
source: Optional[str] = None,
update_time: Optional[str] = None) -> AiModelProviderfunc GetAiModelProvider(ctx *Context, name string, id IDInput, state *AiModelProviderState, opts ...ResourceOption) (*AiModelProvider, error)public static AiModelProvider Get(string name, Input<string> id, AiModelProviderState? state, CustomResourceOptions? opts = null)public static AiModelProvider get(String name, Output<String> id, AiModelProviderState state, CustomResourceOptions options)resources: _: type: alicloud:apig:AiModelProvider get: id: ${id}import {
to = alicloud_apig_ai_model_provider.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Display
Name string - Model supplier presentation name. Required, no more than 128 characters in length.
- Gateway
Id string - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- Model
Count int - The number of model cards currently associated with the model supplier.
- Model
Provider string - Stable model vendor ID, no more than 128 characters in length.
- Service
Ids List<string> - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- Source string
- Model supplier source.
- Update
Time string - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- Display
Name string - Model supplier presentation name. Required, no more than 128 characters in length.
- Gateway
Id string - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- Model
Count int - The number of model cards currently associated with the model supplier.
- Model
Provider string - Stable model vendor ID, no more than 128 characters in length.
- Service
Ids []string - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- Source string
- Model supplier source.
- Update
Time string - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- display_
name string - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway_
id string - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model_
count number - The number of model cards currently associated with the model supplier.
- model_
provider string - Stable model vendor ID, no more than 128 characters in length.
- service_
ids list(string) - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- source string
- Model supplier source.
- update_
time string - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- display
Name String - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway
Id String - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model
Count Integer - The number of model cards currently associated with the model supplier.
- model
Provider String - Stable model vendor ID, no more than 128 characters in length.
- service
Ids List<String> - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- source String
- Model supplier source.
- update
Time String - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- display
Name string - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway
Id string - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model
Count number - The number of model cards currently associated with the model supplier.
- model
Provider string - Stable model vendor ID, no more than 128 characters in length.
- service
Ids string[] - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- source string
- Model supplier source.
- update
Time string - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- display_
name str - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway_
id str - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model_
count int - The number of model cards currently associated with the model supplier.
- model_
provider str - Stable model vendor ID, no more than 128 characters in length.
- service_
ids Sequence[str] - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- source str
- Model supplier source.
- update_
time str - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
- display
Name String - Model supplier presentation name. Required, no more than 128 characters in length.
- gateway
Id String - The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
- model
Count Number - The number of model cards currently associated with the model supplier.
- model
Provider String - Stable model vendor ID, no more than 128 characters in length.
- service
Ids List<String> - The full collection of AI service IDs to bind to the model vendor. If not passed, existing bindings are retained; if empty array, all bindings are cleared.
- source String
- Model supplier source.
- update
Time String - The last update time of the model vendor, in the format of yyyy-MM-dd HH:mm:ss.
Import
APIG Ai Model Provider can be imported using the id, e.g.
$ pulumi import alicloud:apig/aiModelProvider:AiModelProvider example <model_provider_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
published on Thursday, Sep 17, 2026 by Pulumi