1. Packages
  2. Harness Provider
  3. API Docs
  4. platform
  5. PrometheusConnector
Harness v0.7.1 published on Saturday, Mar 29, 2025 by Pulumi

harness.platform.PrometheusConnector

Explore with Pulumi AI

Resource for creating a Prometheus connector.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";

const example = new harness.platform.PrometheusConnector("example", {
    identifier: "idntifier",
    name: "name",
    description: "test",
    tags: ["foo:bar"],
    url: "https://prometheus.com/",
    delegateSelectors: ["harness-delegate"],
    userName: "user_name",
    passwordRef: "account.secret_identifier",
    headers: [{
        encryptedValueRef: "account.secret_identifier",
        valueEncrypted: true,
        key: "key",
        value: "value",
    }],
});
Copy
import pulumi
import pulumi_harness as harness

example = harness.platform.PrometheusConnector("example",
    identifier="idntifier",
    name="name",
    description="test",
    tags=["foo:bar"],
    url="https://prometheus.com/",
    delegate_selectors=["harness-delegate"],
    user_name="user_name",
    password_ref="account.secret_identifier",
    headers=[{
        "encrypted_value_ref": "account.secret_identifier",
        "value_encrypted": True,
        "key": "key",
        "value": "value",
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := platform.NewPrometheusConnector(ctx, "example", &platform.PrometheusConnectorArgs{
			Identifier:  pulumi.String("idntifier"),
			Name:        pulumi.String("name"),
			Description: pulumi.String("test"),
			Tags: pulumi.StringArray{
				pulumi.String("foo:bar"),
			},
			Url: pulumi.String("https://prometheus.com/"),
			DelegateSelectors: pulumi.StringArray{
				pulumi.String("harness-delegate"),
			},
			UserName:    pulumi.String("user_name"),
			PasswordRef: pulumi.String("account.secret_identifier"),
			Headers: platform.PrometheusConnectorHeaderArray{
				&platform.PrometheusConnectorHeaderArgs{
					EncryptedValueRef: pulumi.String("account.secret_identifier"),
					ValueEncrypted:    pulumi.Bool(true),
					Key:               pulumi.String("key"),
					Value:             pulumi.String("value"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;

return await Deployment.RunAsync(() => 
{
    var example = new Harness.Platform.PrometheusConnector("example", new()
    {
        Identifier = "idntifier",
        Name = "name",
        Description = "test",
        Tags = new[]
        {
            "foo:bar",
        },
        Url = "https://prometheus.com/",
        DelegateSelectors = new[]
        {
            "harness-delegate",
        },
        UserName = "user_name",
        PasswordRef = "account.secret_identifier",
        Headers = new[]
        {
            new Harness.Platform.Inputs.PrometheusConnectorHeaderArgs
            {
                EncryptedValueRef = "account.secret_identifier",
                ValueEncrypted = true,
                Key = "key",
                Value = "value",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.PrometheusConnector;
import com.pulumi.harness.platform.PrometheusConnectorArgs;
import com.pulumi.harness.platform.inputs.PrometheusConnectorHeaderArgs;
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) {
        var example = new PrometheusConnector("example", PrometheusConnectorArgs.builder()
            .identifier("idntifier")
            .name("name")
            .description("test")
            .tags("foo:bar")
            .url("https://prometheus.com/")
            .delegateSelectors("harness-delegate")
            .userName("user_name")
            .passwordRef("account.secret_identifier")
            .headers(PrometheusConnectorHeaderArgs.builder()
                .encryptedValueRef("account.secret_identifier")
                .valueEncrypted(true)
                .key("key")
                .value("value")
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: harness:platform:PrometheusConnector
    properties:
      identifier: idntifier
      name: name
      description: test
      tags:
        - foo:bar
      url: https://prometheus.com/
      delegateSelectors:
        - harness-delegate
      userName: user_name
      passwordRef: account.secret_identifier
      headers:
        - encryptedValueRef: account.secret_identifier
          valueEncrypted: true
          key: key
          value: value
Copy

Create PrometheusConnector Resource

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

Constructor syntax

new PrometheusConnector(name: string, args: PrometheusConnectorArgs, opts?: CustomResourceOptions);
@overload
def PrometheusConnector(resource_name: str,
                        args: PrometheusConnectorArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def PrometheusConnector(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        identifier: Optional[str] = None,
                        url: Optional[str] = None,
                        delegate_selectors: Optional[Sequence[str]] = None,
                        description: Optional[str] = None,
                        headers: Optional[Sequence[PrometheusConnectorHeaderArgs]] = None,
                        name: Optional[str] = None,
                        org_id: Optional[str] = None,
                        password_ref: Optional[str] = None,
                        project_id: Optional[str] = None,
                        tags: Optional[Sequence[str]] = None,
                        user_name: Optional[str] = None)
func NewPrometheusConnector(ctx *Context, name string, args PrometheusConnectorArgs, opts ...ResourceOption) (*PrometheusConnector, error)
public PrometheusConnector(string name, PrometheusConnectorArgs args, CustomResourceOptions? opts = null)
public PrometheusConnector(String name, PrometheusConnectorArgs args)
public PrometheusConnector(String name, PrometheusConnectorArgs args, CustomResourceOptions options)
type: harness:platform:PrometheusConnector
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PrometheusConnectorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. PrometheusConnectorArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. PrometheusConnectorArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PrometheusConnectorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PrometheusConnectorArgs
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 prometheusConnectorResource = new Harness.Platform.PrometheusConnector("prometheusConnectorResource", new()
{
    Identifier = "string",
    Url = "string",
    DelegateSelectors = new[]
    {
        "string",
    },
    Description = "string",
    Headers = new[]
    {
        new Harness.Platform.Inputs.PrometheusConnectorHeaderArgs
        {
            Key = "string",
            EncryptedValueRef = "string",
            Value = "string",
            ValueEncrypted = false,
        },
    },
    Name = "string",
    OrgId = "string",
    PasswordRef = "string",
    ProjectId = "string",
    Tags = new[]
    {
        "string",
    },
    UserName = "string",
});
Copy
example, err := platform.NewPrometheusConnector(ctx, "prometheusConnectorResource", &platform.PrometheusConnectorArgs{
	Identifier: pulumi.String("string"),
	Url:        pulumi.String("string"),
	DelegateSelectors: pulumi.StringArray{
		pulumi.String("string"),
	},
	Description: pulumi.String("string"),
	Headers: platform.PrometheusConnectorHeaderArray{
		&platform.PrometheusConnectorHeaderArgs{
			Key:               pulumi.String("string"),
			EncryptedValueRef: pulumi.String("string"),
			Value:             pulumi.String("string"),
			ValueEncrypted:    pulumi.Bool(false),
		},
	},
	Name:        pulumi.String("string"),
	OrgId:       pulumi.String("string"),
	PasswordRef: pulumi.String("string"),
	ProjectId:   pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
	UserName: pulumi.String("string"),
})
Copy
var prometheusConnectorResource = new PrometheusConnector("prometheusConnectorResource", PrometheusConnectorArgs.builder()
    .identifier("string")
    .url("string")
    .delegateSelectors("string")
    .description("string")
    .headers(PrometheusConnectorHeaderArgs.builder()
        .key("string")
        .encryptedValueRef("string")
        .value("string")
        .valueEncrypted(false)
        .build())
    .name("string")
    .orgId("string")
    .passwordRef("string")
    .projectId("string")
    .tags("string")
    .userName("string")
    .build());
Copy
prometheus_connector_resource = harness.platform.PrometheusConnector("prometheusConnectorResource",
    identifier="string",
    url="string",
    delegate_selectors=["string"],
    description="string",
    headers=[{
        "key": "string",
        "encrypted_value_ref": "string",
        "value": "string",
        "value_encrypted": False,
    }],
    name="string",
    org_id="string",
    password_ref="string",
    project_id="string",
    tags=["string"],
    user_name="string")
Copy
const prometheusConnectorResource = new harness.platform.PrometheusConnector("prometheusConnectorResource", {
    identifier: "string",
    url: "string",
    delegateSelectors: ["string"],
    description: "string",
    headers: [{
        key: "string",
        encryptedValueRef: "string",
        value: "string",
        valueEncrypted: false,
    }],
    name: "string",
    orgId: "string",
    passwordRef: "string",
    projectId: "string",
    tags: ["string"],
    userName: "string",
});
Copy
type: harness:platform:PrometheusConnector
properties:
    delegateSelectors:
        - string
    description: string
    headers:
        - encryptedValueRef: string
          key: string
          value: string
          valueEncrypted: false
    identifier: string
    name: string
    orgId: string
    passwordRef: string
    projectId: string
    tags:
        - string
    url: string
    userName: string
Copy

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

Identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource.
Url This property is required. string
URL of the Prometheus server.
DelegateSelectors List<string>
Tags to filter delegates for connection.
Description string
Description of the resource.
Headers List<PrometheusConnectorHeader>
Headers.
Name string
Name of the resource.
OrgId string
Unique identifier of the organization.
PasswordRef string
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
ProjectId string
Unique identifier of the project.
Tags List<string>
Tags to associate with the resource.
UserName string
User name.
Identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource.
Url This property is required. string
URL of the Prometheus server.
DelegateSelectors []string
Tags to filter delegates for connection.
Description string
Description of the resource.
Headers []PrometheusConnectorHeaderArgs
Headers.
Name string
Name of the resource.
OrgId string
Unique identifier of the organization.
PasswordRef string
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
ProjectId string
Unique identifier of the project.
Tags []string
Tags to associate with the resource.
UserName string
User name.
identifier
This property is required.
Changes to this property will trigger replacement.
String
Unique identifier of the resource.
url This property is required. String
URL of the Prometheus server.
delegateSelectors List<String>
Tags to filter delegates for connection.
description String
Description of the resource.
headers List<PrometheusConnectorHeader>
Headers.
name String
Name of the resource.
orgId String
Unique identifier of the organization.
passwordRef String
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
projectId String
Unique identifier of the project.
tags List<String>
Tags to associate with the resource.
userName String
User name.
identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource.
url This property is required. string
URL of the Prometheus server.
delegateSelectors string[]
Tags to filter delegates for connection.
description string
Description of the resource.
headers PrometheusConnectorHeader[]
Headers.
name string
Name of the resource.
orgId string
Unique identifier of the organization.
passwordRef string
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
projectId string
Unique identifier of the project.
tags string[]
Tags to associate with the resource.
userName string
User name.
identifier
This property is required.
Changes to this property will trigger replacement.
str
Unique identifier of the resource.
url This property is required. str
URL of the Prometheus server.
delegate_selectors Sequence[str]
Tags to filter delegates for connection.
description str
Description of the resource.
headers Sequence[PrometheusConnectorHeaderArgs]
Headers.
name str
Name of the resource.
org_id str
Unique identifier of the organization.
password_ref str
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
project_id str
Unique identifier of the project.
tags Sequence[str]
Tags to associate with the resource.
user_name str
User name.
identifier
This property is required.
Changes to this property will trigger replacement.
String
Unique identifier of the resource.
url This property is required. String
URL of the Prometheus server.
delegateSelectors List<String>
Tags to filter delegates for connection.
description String
Description of the resource.
headers List<Property Map>
Headers.
name String
Name of the resource.
orgId String
Unique identifier of the organization.
passwordRef String
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
projectId String
Unique identifier of the project.
tags List<String>
Tags to associate with the resource.
userName String
User name.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing PrometheusConnector Resource

Get an existing PrometheusConnector 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?: PrometheusConnectorState, opts?: CustomResourceOptions): PrometheusConnector
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        delegate_selectors: Optional[Sequence[str]] = None,
        description: Optional[str] = None,
        headers: Optional[Sequence[PrometheusConnectorHeaderArgs]] = None,
        identifier: Optional[str] = None,
        name: Optional[str] = None,
        org_id: Optional[str] = None,
        password_ref: Optional[str] = None,
        project_id: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        url: Optional[str] = None,
        user_name: Optional[str] = None) -> PrometheusConnector
func GetPrometheusConnector(ctx *Context, name string, id IDInput, state *PrometheusConnectorState, opts ...ResourceOption) (*PrometheusConnector, error)
public static PrometheusConnector Get(string name, Input<string> id, PrometheusConnectorState? state, CustomResourceOptions? opts = null)
public static PrometheusConnector get(String name, Output<String> id, PrometheusConnectorState state, CustomResourceOptions options)
resources:  _:    type: harness:platform:PrometheusConnector    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DelegateSelectors List<string>
Tags to filter delegates for connection.
Description string
Description of the resource.
Headers List<PrometheusConnectorHeader>
Headers.
Identifier Changes to this property will trigger replacement. string
Unique identifier of the resource.
Name string
Name of the resource.
OrgId string
Unique identifier of the organization.
PasswordRef string
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
ProjectId string
Unique identifier of the project.
Tags List<string>
Tags to associate with the resource.
Url string
URL of the Prometheus server.
UserName string
User name.
DelegateSelectors []string
Tags to filter delegates for connection.
Description string
Description of the resource.
Headers []PrometheusConnectorHeaderArgs
Headers.
Identifier Changes to this property will trigger replacement. string
Unique identifier of the resource.
Name string
Name of the resource.
OrgId string
Unique identifier of the organization.
PasswordRef string
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
ProjectId string
Unique identifier of the project.
Tags []string
Tags to associate with the resource.
Url string
URL of the Prometheus server.
UserName string
User name.
delegateSelectors List<String>
Tags to filter delegates for connection.
description String
Description of the resource.
headers List<PrometheusConnectorHeader>
Headers.
identifier Changes to this property will trigger replacement. String
Unique identifier of the resource.
name String
Name of the resource.
orgId String
Unique identifier of the organization.
passwordRef String
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
projectId String
Unique identifier of the project.
tags List<String>
Tags to associate with the resource.
url String
URL of the Prometheus server.
userName String
User name.
delegateSelectors string[]
Tags to filter delegates for connection.
description string
Description of the resource.
headers PrometheusConnectorHeader[]
Headers.
identifier Changes to this property will trigger replacement. string
Unique identifier of the resource.
name string
Name of the resource.
orgId string
Unique identifier of the organization.
passwordRef string
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
projectId string
Unique identifier of the project.
tags string[]
Tags to associate with the resource.
url string
URL of the Prometheus server.
userName string
User name.
delegate_selectors Sequence[str]
Tags to filter delegates for connection.
description str
Description of the resource.
headers Sequence[PrometheusConnectorHeaderArgs]
Headers.
identifier Changes to this property will trigger replacement. str
Unique identifier of the resource.
name str
Name of the resource.
org_id str
Unique identifier of the organization.
password_ref str
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
project_id str
Unique identifier of the project.
tags Sequence[str]
Tags to associate with the resource.
url str
URL of the Prometheus server.
user_name str
User name.
delegateSelectors List<String>
Tags to filter delegates for connection.
description String
Description of the resource.
headers List<Property Map>
Headers.
identifier Changes to this property will trigger replacement. String
Unique identifier of the resource.
name String
Name of the resource.
orgId String
Unique identifier of the organization.
passwordRef String
Reference to the Harness secret containing the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
projectId String
Unique identifier of the project.
tags List<String>
Tags to associate with the resource.
url String
URL of the Prometheus server.
userName String
User name.

Supporting Types

PrometheusConnectorHeader
, PrometheusConnectorHeaderArgs

Key This property is required. string
Key.
EncryptedValueRef string
Reference to the Harness secret containing the encrypted value. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
Value string
Value.
ValueEncrypted bool
Encrypted value.
Key This property is required. string
Key.
EncryptedValueRef string
Reference to the Harness secret containing the encrypted value. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
Value string
Value.
ValueEncrypted bool
Encrypted value.
key This property is required. String
Key.
encryptedValueRef String
Reference to the Harness secret containing the encrypted value. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
value String
Value.
valueEncrypted Boolean
Encrypted value.
key This property is required. string
Key.
encryptedValueRef string
Reference to the Harness secret containing the encrypted value. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
value string
Value.
valueEncrypted boolean
Encrypted value.
key This property is required. str
Key.
encrypted_value_ref str
Reference to the Harness secret containing the encrypted value. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
value str
Value.
value_encrypted bool
Encrypted value.
key This property is required. String
Key.
encryptedValueRef String
Reference to the Harness secret containing the encrypted value. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
value String
Value.
valueEncrypted Boolean
Encrypted value.

Import

Import account level prometheus connector

$ pulumi import harness:platform/prometheusConnector:PrometheusConnector example <connector_id>
Copy

Import org level prometheus connector

$ pulumi import harness:platform/prometheusConnector:PrometheusConnector example <ord_id>/<connector_id>
Copy

Import project level prometheus connector

$ pulumi import harness:platform/prometheusConnector:PrometheusConnector example <org_id>/<project_id>/<connector_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
harness pulumi/pulumi-harness
License
Apache-2.0
Notes
This Pulumi package is based on the harness Terraform Provider.