UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

410 lines (409 loc) 13.7 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Resource for managing a Harness Service Discovery Agent. * * This resource allows you to create, read, update, and delete a Service Discovery Agent in Harness. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * const example = new harness.service.DiscoveryAgent("example", { * name: "ExampleAgent", * orgIdentifier: "your_org_id", * projectIdentifier: "your_project_id", * environmentIdentifier: "your_environment_id", * infraIdentifier: "your_infra_id", * configs: [{ * collectorImage: "harness/service-discovery-collector:main-latest", * logWatcherImage: "harness/chaos-log-watcher:main-latest", * kubernetes: [{ * namespace: "harness-sd", * }], * }], * }); * ``` * * ### Additional Examples * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * // Create a new service discovery agent with minimal configuration * const example = new harness.service.DiscoveryAgent("example", { * name: "example-agent", * orgIdentifier: orgIdentifier, * projectIdentifier: projectIdentifier, * environmentIdentifier: environmentIdentifier, * infraIdentifier: "example-infra", * configs: [{ * kubernetes: [{ * namespace: "harness-sd", * }], * }], * }); * // Create a new service discovery agent with node agent enabled * const nodeAgent = new harness.service.DiscoveryAgent("node_agent", { * name: "node-agent-example", * orgIdentifier: orgIdentifier, * projectIdentifier: projectIdentifier, * environmentIdentifier: environmentIdentifier, * infraIdentifier: "node-agent-example", * configs: [{ * kubernetes: [{ * namespace: "harness-sd", * }], * datas: [{ * enableNodeAgent: true, * }], * }], * }); * // Create a new service discovery agent with full configuration * const fullConfig = new harness.service.DiscoveryAgent("full_config", { * name: "full-config-example", * orgIdentifier: orgIdentifier, * projectIdentifier: projectIdentifier, * environmentIdentifier: environmentIdentifier, * infraIdentifier: "full-config-example", * permanentInstallation: false, * correlationId: "full-config-correlation-123", * configs: [{ * collectorImage: "harness/service-discovery-collector:main-latest", * logWatcherImage: "harness/chaos-log-watcher:main-latest", * skipSecureVerify: false, * kubernetes: [{ * namespace: "harness-sd", * serviceAccount: "harness-sd-sa", * imagePullPolicy: "IfNotPresent", * runAsUser: 2000, * runAsGroup: 2000, * labels: { * app: "service-discovery", * env: "dev", * }, * annotations: { * "example.com/annotation": "value", * }, * nodeSelector: { * "kubernetes.io/os": "linux", * }, * resources: [{ * limits: { * cpu: "500m", * memory: "512Mi", * }, * requests: { * cpu: "250m", * memory: "256Mi", * }, * }], * tolerations: [{ * key: "key1", * operator: "Equal", * value: "value1", * effect: "NoSchedule", * }], * }], * datas: [{ * enableNodeAgent: true, * nodeAgentSelector: "node-role.kubernetes.io/worker=", * enableBatchResources: true, * enableOrphanedPod: true, * namespaceSelector: "environment=dev", * collectionWindowInMin: 15, * blacklistedNamespaces: [ * "kube-system", * "kube-public", * ], * observedNamespaces: [ * "default", * "harness", * ], * crons: [{ * expression: "0/10 * * * *", * }], * }], * mtls: [{ * certPath: "/etc/certs/tls.crt", * keyPath: "/etc/certs/tls.key", * secretName: "mtls-secret", * url: "https://mtls.example.com:8443", * }], * proxies: [{ * httpProxy: "http://proxy.example.com:8080", * httpsProxy: "https://proxy.example.com:8080", * noProxy: "localhost,127.0.0.1,.svc,.cluster.local", * url: "https://proxy.example.com", * }], * }], * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * Import Project level Service Discovery Agent * * Account and Org level agents are not supported yet * * ```sh * $ pulumi import harness:service/discoveryAgent:DiscoveryAgent example <org_identifier>/<project_identifier>/<environment_identifier>/<infra_identifier> * ``` */ export declare class DiscoveryAgent extends pulumi.CustomResource { /** * Get an existing DiscoveryAgent resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DiscoveryAgentState, opts?: pulumi.CustomResourceOptions): DiscoveryAgent; /** * Returns true if the given object is an instance of DiscoveryAgent. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is DiscoveryAgent; /** * Configuration for the agent. This is a required field. */ readonly configs: pulumi.Output<outputs.service.DiscoveryAgentConfig[]>; /** * Correlation ID for the agent. */ readonly correlationId: pulumi.Output<string>; /** * Timestamp when the agent was created. */ readonly createdAt: pulumi.Output<string>; /** * User who created the agent. */ readonly createdBy: pulumi.Output<string>; /** * Description of the agent. */ readonly description: pulumi.Output<string>; /** * The environment identifier of the agent. This is a required field. */ readonly environmentIdentifier: pulumi.Output<string>; /** * The unique identity of the agent. */ readonly identity: pulumi.Output<string>; /** * The infrastructure identifier of the agent. This is a required field. */ readonly infraIdentifier: pulumi.Output<string>; /** * Installation details of the agent. */ readonly installationDetails: pulumi.Output<outputs.service.DiscoveryAgentInstallationDetail[]>; /** * Type of installation for the agent. */ readonly installationType: pulumi.Output<string | undefined>; /** * The name of the agent. This is a required field. */ readonly name: pulumi.Output<string>; /** * Number of network maps associated with this agent. */ readonly networkMapCount: pulumi.Output<number>; /** * The organization identifier of the agent. Must be 1-64 characters and contain only alphanumeric characters, hyphens, or underscores. */ readonly orgIdentifier: pulumi.Output<string | undefined>; /** * Whether this is a permanent installation. */ readonly permanentInstallation: pulumi.Output<boolean | undefined>; /** * The project identifier of the agent. Must be 1-64 characters and contain only alphanumeric characters, hyphens, or underscores. */ readonly projectIdentifier: pulumi.Output<string | undefined>; /** * Whether the agent has been removed. */ readonly removed: pulumi.Output<boolean>; /** * Timestamp when the agent was removed. */ readonly removedAt: pulumi.Output<string>; /** * Number of services managed by this agent. */ readonly serviceCount: pulumi.Output<number>; /** * List of resource tags for the agent. */ readonly tags: pulumi.Output<string[]>; /** * Timestamp when the agent was last updated. */ readonly updatedAt: pulumi.Output<string>; /** * User who last updated the agent. */ readonly updatedBy: pulumi.Output<string>; /** * Webhook URL for the agent. */ readonly webhookUrl: pulumi.Output<string | undefined>; /** * Create a DiscoveryAgent resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DiscoveryAgentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DiscoveryAgent resources. */ export interface DiscoveryAgentState { /** * Configuration for the agent. This is a required field. */ configs?: pulumi.Input<pulumi.Input<inputs.service.DiscoveryAgentConfig>[]>; /** * Correlation ID for the agent. */ correlationId?: pulumi.Input<string>; /** * Timestamp when the agent was created. */ createdAt?: pulumi.Input<string>; /** * User who created the agent. */ createdBy?: pulumi.Input<string>; /** * Description of the agent. */ description?: pulumi.Input<string>; /** * The environment identifier of the agent. This is a required field. */ environmentIdentifier?: pulumi.Input<string>; /** * The unique identity of the agent. */ identity?: pulumi.Input<string>; /** * The infrastructure identifier of the agent. This is a required field. */ infraIdentifier?: pulumi.Input<string>; /** * Installation details of the agent. */ installationDetails?: pulumi.Input<pulumi.Input<inputs.service.DiscoveryAgentInstallationDetail>[]>; /** * Type of installation for the agent. */ installationType?: pulumi.Input<string>; /** * The name of the agent. This is a required field. */ name?: pulumi.Input<string>; /** * Number of network maps associated with this agent. */ networkMapCount?: pulumi.Input<number>; /** * The organization identifier of the agent. Must be 1-64 characters and contain only alphanumeric characters, hyphens, or underscores. */ orgIdentifier?: pulumi.Input<string>; /** * Whether this is a permanent installation. */ permanentInstallation?: pulumi.Input<boolean>; /** * The project identifier of the agent. Must be 1-64 characters and contain only alphanumeric characters, hyphens, or underscores. */ projectIdentifier?: pulumi.Input<string>; /** * Whether the agent has been removed. */ removed?: pulumi.Input<boolean>; /** * Timestamp when the agent was removed. */ removedAt?: pulumi.Input<string>; /** * Number of services managed by this agent. */ serviceCount?: pulumi.Input<number>; /** * List of resource tags for the agent. */ tags?: pulumi.Input<pulumi.Input<string>[]>; /** * Timestamp when the agent was last updated. */ updatedAt?: pulumi.Input<string>; /** * User who last updated the agent. */ updatedBy?: pulumi.Input<string>; /** * Webhook URL for the agent. */ webhookUrl?: pulumi.Input<string>; } /** * The set of arguments for constructing a DiscoveryAgent resource. */ export interface DiscoveryAgentArgs { /** * Configuration for the agent. This is a required field. */ configs: pulumi.Input<pulumi.Input<inputs.service.DiscoveryAgentConfig>[]>; /** * Correlation ID for the agent. */ correlationId?: pulumi.Input<string>; /** * The environment identifier of the agent. This is a required field. */ environmentIdentifier: pulumi.Input<string>; /** * The infrastructure identifier of the agent. This is a required field. */ infraIdentifier: pulumi.Input<string>; /** * Type of installation for the agent. */ installationType?: pulumi.Input<string>; /** * The name of the agent. This is a required field. */ name?: pulumi.Input<string>; /** * The organization identifier of the agent. Must be 1-64 characters and contain only alphanumeric characters, hyphens, or underscores. */ orgIdentifier?: pulumi.Input<string>; /** * Whether this is a permanent installation. */ permanentInstallation?: pulumi.Input<boolean>; /** * The project identifier of the agent. Must be 1-64 characters and contain only alphanumeric characters, hyphens, or underscores. */ projectIdentifier?: pulumi.Input<string>; /** * Webhook URL for the agent. */ webhookUrl?: pulumi.Input<string>; }