1. Registry
  2. Packages
  3. CAST AI
  4. API Docs
  5. WorkloadCustomMetricsDataSource
Viewing docs for CAST AI v8.60.0
published on Wednesday, Aug 19, 2026 by CAST AI
castai logo
Viewing docs for CAST AI v8.60.0
published on Wednesday, Aug 19, 2026 by CAST AI

    Create WorkloadCustomMetricsDataSource Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new WorkloadCustomMetricsDataSource(name: string, args: WorkloadCustomMetricsDataSourceArgs, opts?: CustomResourceOptions);
    @overload
    def WorkloadCustomMetricsDataSource(resource_name: str,
                                        args: WorkloadCustomMetricsDataSourceArgs,
                                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def WorkloadCustomMetricsDataSource(resource_name: str,
                                        opts: Optional[ResourceOptions] = None,
                                        cluster_id: Optional[str] = None,
                                        prometheus: Optional[_workload.WorkloadCustomMetricsDataSourcePrometheusArgs] = None,
                                        name: Optional[str] = None)
    func NewWorkloadCustomMetricsDataSource(ctx *Context, name string, args WorkloadCustomMetricsDataSourceArgs, opts ...ResourceOption) (*WorkloadCustomMetricsDataSource, error)
    public WorkloadCustomMetricsDataSource(string name, WorkloadCustomMetricsDataSourceArgs args, CustomResourceOptions? opts = null)
    public WorkloadCustomMetricsDataSource(String name, WorkloadCustomMetricsDataSourceArgs args)
    public WorkloadCustomMetricsDataSource(String name, WorkloadCustomMetricsDataSourceArgs args, CustomResourceOptions options)
    
    type: castai:workload:WorkloadCustomMetricsDataSource
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "castai_workload_custom_metrics_data_source" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args WorkloadCustomMetricsDataSourceArgs
    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 WorkloadCustomMetricsDataSourceArgs
    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 WorkloadCustomMetricsDataSourceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkloadCustomMetricsDataSourceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkloadCustomMetricsDataSourceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    WorkloadCustomMetricsDataSource 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 WorkloadCustomMetricsDataSource resource accepts the following input properties:

    ClusterId string
    CAST AI cluster ID.
    Prometheus Pulumi.CastAI.Workload.Inputs.WorkloadCustomMetricsDataSourcePrometheus
    Prometheus data source configuration.
    Name string
    Name of the custom metrics data source (1-63 characters).
    ClusterId string
    CAST AI cluster ID.
    Prometheus WorkloadCustomMetricsDataSourcePrometheusArgs
    Prometheus data source configuration.
    Name string
    Name of the custom metrics data source (1-63 characters).
    cluster_id string
    CAST AI cluster ID.
    prometheus object
    Prometheus data source configuration.
    name string
    Name of the custom metrics data source (1-63 characters).
    clusterId String
    CAST AI cluster ID.
    prometheus WorkloadCustomMetricsDataSourcePrometheus
    Prometheus data source configuration.
    name String
    Name of the custom metrics data source (1-63 characters).
    clusterId string
    CAST AI cluster ID.
    prometheus workloadWorkloadCustomMetricsDataSourcePrometheus
    Prometheus data source configuration.
    name string
    Name of the custom metrics data source (1-63 characters).
    cluster_id str
    CAST AI cluster ID.
    prometheus workload.WorkloadCustomMetricsDataSourcePrometheusArgs
    Prometheus data source configuration.
    name str
    Name of the custom metrics data source (1-63 characters).
    clusterId String
    CAST AI cluster ID.
    prometheus Property Map
    Prometheus data source configuration.
    name String
    Name of the custom metrics data source (1-63 characters).

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WorkloadCustomMetricsDataSource resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    KubeResourceName string
    Name of the corresponding Kubernetes resource.
    ManagedByCast bool
    Whether the data source is managed by CAST AI.
    Status string
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    Id string
    The provider-assigned unique ID for this managed resource.
    KubeResourceName string
    Name of the corresponding Kubernetes resource.
    ManagedByCast bool
    Whether the data source is managed by CAST AI.
    Status string
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    id string
    The provider-assigned unique ID for this managed resource.
    kube_resource_name string
    Name of the corresponding Kubernetes resource.
    managed_by_cast bool
    Whether the data source is managed by CAST AI.
    status string
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    id String
    The provider-assigned unique ID for this managed resource.
    kubeResourceName String
    Name of the corresponding Kubernetes resource.
    managedByCast Boolean
    Whether the data source is managed by CAST AI.
    status String
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    id string
    The provider-assigned unique ID for this managed resource.
    kubeResourceName string
    Name of the corresponding Kubernetes resource.
    managedByCast boolean
    Whether the data source is managed by CAST AI.
    status string
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    id str
    The provider-assigned unique ID for this managed resource.
    kube_resource_name str
    Name of the corresponding Kubernetes resource.
    managed_by_cast bool
    Whether the data source is managed by CAST AI.
    status str
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    id String
    The provider-assigned unique ID for this managed resource.
    kubeResourceName String
    Name of the corresponding Kubernetes resource.
    managedByCast Boolean
    Whether the data source is managed by CAST AI.
    status String
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).

    Look up Existing WorkloadCustomMetricsDataSource Resource

    Get an existing WorkloadCustomMetricsDataSource 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?: WorkloadCustomMetricsDataSourceState, opts?: CustomResourceOptions): WorkloadCustomMetricsDataSource
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            kube_resource_name: Optional[str] = None,
            managed_by_cast: Optional[bool] = None,
            name: Optional[str] = None,
            prometheus: Optional[_workload.WorkloadCustomMetricsDataSourcePrometheusArgs] = None,
            status: Optional[str] = None) -> WorkloadCustomMetricsDataSource
    func GetWorkloadCustomMetricsDataSource(ctx *Context, name string, id IDInput, state *WorkloadCustomMetricsDataSourceState, opts ...ResourceOption) (*WorkloadCustomMetricsDataSource, error)
    public static WorkloadCustomMetricsDataSource Get(string name, Input<string> id, WorkloadCustomMetricsDataSourceState? state, CustomResourceOptions? opts = null)
    public static WorkloadCustomMetricsDataSource get(String name, Output<String> id, WorkloadCustomMetricsDataSourceState state, CustomResourceOptions options)
    resources:  _:    type: castai:workload:WorkloadCustomMetricsDataSource    get:      id: ${id}
    import {
      to = castai_workload_custom_metrics_data_source.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.
    The following state arguments are supported:
    ClusterId string
    CAST AI cluster ID.
    KubeResourceName string
    Name of the corresponding Kubernetes resource.
    ManagedByCast bool
    Whether the data source is managed by CAST AI.
    Name string
    Name of the custom metrics data source (1-63 characters).
    Prometheus Pulumi.CastAI.Workload.Inputs.WorkloadCustomMetricsDataSourcePrometheus
    Prometheus data source configuration.
    Status string
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    ClusterId string
    CAST AI cluster ID.
    KubeResourceName string
    Name of the corresponding Kubernetes resource.
    ManagedByCast bool
    Whether the data source is managed by CAST AI.
    Name string
    Name of the custom metrics data source (1-63 characters).
    Prometheus WorkloadCustomMetricsDataSourcePrometheusArgs
    Prometheus data source configuration.
    Status string
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    cluster_id string
    CAST AI cluster ID.
    kube_resource_name string
    Name of the corresponding Kubernetes resource.
    managed_by_cast bool
    Whether the data source is managed by CAST AI.
    name string
    Name of the custom metrics data source (1-63 characters).
    prometheus object
    Prometheus data source configuration.
    status string
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    clusterId String
    CAST AI cluster ID.
    kubeResourceName String
    Name of the corresponding Kubernetes resource.
    managedByCast Boolean
    Whether the data source is managed by CAST AI.
    name String
    Name of the custom metrics data source (1-63 characters).
    prometheus WorkloadCustomMetricsDataSourcePrometheus
    Prometheus data source configuration.
    status String
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    clusterId string
    CAST AI cluster ID.
    kubeResourceName string
    Name of the corresponding Kubernetes resource.
    managedByCast boolean
    Whether the data source is managed by CAST AI.
    name string
    Name of the custom metrics data source (1-63 characters).
    prometheus workloadWorkloadCustomMetricsDataSourcePrometheus
    Prometheus data source configuration.
    status string
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    cluster_id str
    CAST AI cluster ID.
    kube_resource_name str
    Name of the corresponding Kubernetes resource.
    managed_by_cast bool
    Whether the data source is managed by CAST AI.
    name str
    Name of the custom metrics data source (1-63 characters).
    prometheus workload.WorkloadCustomMetricsDataSourcePrometheusArgs
    Prometheus data source configuration.
    status str
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).
    clusterId String
    CAST AI cluster ID.
    kubeResourceName String
    Name of the corresponding Kubernetes resource.
    managedByCast Boolean
    Whether the data source is managed by CAST AI.
    name String
    Name of the custom metrics data source (1-63 characters).
    prometheus Property Map
    Prometheus data source configuration.
    status String
    Synchronization status of the data source (CONNECTING, CONNECTED, SYNCING, FAILED).

    Supporting Types

    WorkloadCustomMetricsDataSourcePrometheus, WorkloadCustomMetricsDataSourcePrometheusArgs

    Url string
    URL of the Prometheus server.
    Metrics List<Pulumi.CastAI.Workload.Inputs.WorkloadCustomMetricsDataSourcePrometheusMetric>
    Manually defined metrics. Use this for advanced use cases where presets don't cover your needs. Each entry defines a single metric name and PromQL query. To specify multiple queries for the same metric, use multiple entries with the same name.
    Presets List<string>
    List of metric presets managed by CAST AI. Presets provide curated metric definitions that are kept up to date automatically. This is the recommended approach for most users. Currently available: "jvm".
    Timeout string
    Timeout for Prometheus queries (e.g. "30s").
    Url string
    URL of the Prometheus server.
    Metrics WorkloadCustomMetricsDataSourcePrometheusMetric
    Manually defined metrics. Use this for advanced use cases where presets don't cover your needs. Each entry defines a single metric name and PromQL query. To specify multiple queries for the same metric, use multiple entries with the same name.
    Presets []string
    List of metric presets managed by CAST AI. Presets provide curated metric definitions that are kept up to date automatically. This is the recommended approach for most users. Currently available: "jvm".
    Timeout string
    Timeout for Prometheus queries (e.g. "30s").
    url string
    URL of the Prometheus server.
    metrics list(object)
    Manually defined metrics. Use this for advanced use cases where presets don't cover your needs. Each entry defines a single metric name and PromQL query. To specify multiple queries for the same metric, use multiple entries with the same name.
    presets list(string)
    List of metric presets managed by CAST AI. Presets provide curated metric definitions that are kept up to date automatically. This is the recommended approach for most users. Currently available: "jvm".
    timeout string
    Timeout for Prometheus queries (e.g. "30s").
    url String
    URL of the Prometheus server.
    metrics List<WorkloadCustomMetricsDataSourcePrometheusMetric>
    Manually defined metrics. Use this for advanced use cases where presets don't cover your needs. Each entry defines a single metric name and PromQL query. To specify multiple queries for the same metric, use multiple entries with the same name.
    presets List<String>
    List of metric presets managed by CAST AI. Presets provide curated metric definitions that are kept up to date automatically. This is the recommended approach for most users. Currently available: "jvm".
    timeout String
    Timeout for Prometheus queries (e.g. "30s").
    url string
    URL of the Prometheus server.
    metrics workloadWorkloadCustomMetricsDataSourcePrometheusMetric[]
    Manually defined metrics. Use this for advanced use cases where presets don't cover your needs. Each entry defines a single metric name and PromQL query. To specify multiple queries for the same metric, use multiple entries with the same name.
    presets string[]
    List of metric presets managed by CAST AI. Presets provide curated metric definitions that are kept up to date automatically. This is the recommended approach for most users. Currently available: "jvm".
    timeout string
    Timeout for Prometheus queries (e.g. "30s").
    url str
    URL of the Prometheus server.
    metrics Sequence[workload.WorkloadCustomMetricsDataSourcePrometheusMetric]
    Manually defined metrics. Use this for advanced use cases where presets don't cover your needs. Each entry defines a single metric name and PromQL query. To specify multiple queries for the same metric, use multiple entries with the same name.
    presets Sequence[str]
    List of metric presets managed by CAST AI. Presets provide curated metric definitions that are kept up to date automatically. This is the recommended approach for most users. Currently available: "jvm".
    timeout str
    Timeout for Prometheus queries (e.g. "30s").
    url String
    URL of the Prometheus server.
    metrics List<Property Map>
    Manually defined metrics. Use this for advanced use cases where presets don't cover your needs. Each entry defines a single metric name and PromQL query. To specify multiple queries for the same metric, use multiple entries with the same name.
    presets List<String>
    List of metric presets managed by CAST AI. Presets provide curated metric definitions that are kept up to date automatically. This is the recommended approach for most users. Currently available: "jvm".
    timeout String
    Timeout for Prometheus queries (e.g. "30s").

    WorkloadCustomMetricsDataSourcePrometheusMetric, WorkloadCustomMetricsDataSourcePrometheusMetricArgs

    Name string
    Name of the metric.
    Query string
    PromQL query for this metric.
    Name string
    Name of the metric.
    Query string
    PromQL query for this metric.
    name string
    Name of the metric.
    query string
    PromQL query for this metric.
    name String
    Name of the metric.
    query String
    PromQL query for this metric.
    name string
    Name of the metric.
    query string
    PromQL query for this metric.
    name str
    Name of the metric.
    query str
    PromQL query for this metric.
    name String
    Name of the metric.
    query String
    PromQL query for this metric.

    Package Details

    Repository
    castai castai/pulumi-castai
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the castai Terraform Provider.
    castai logo
    Viewing docs for CAST AI v8.60.0
    published on Wednesday, Aug 19, 2026 by CAST AI

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial