UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

144 lines 6.08 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.AzureCredential = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * This resource allows you to autodiscover resources in your Azure tenant and scrape Azure Monitor metrics for those resources in Grafana Cloud without needing to run your own infrastructure. * * See the Grafana Provider configuration docs * for information on authentication and required access policy scopes. * * * [Official Grafana Cloud documentation](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/monitor-cloud-provider/azure/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const test = new grafana.cloudprovider.AzureCredential("test", { * stackId: "1", * name: "test-name", * clientId: "my-client-id", * clientSecret: "my-client-secret", * tenantId: "my-tenant-id", * resourceTagsToAddToMetrics: [ * "tag1", * "tag2", * ], * resourceDiscoveryTagFilters: [ * { * key: "key-1", * value: "value-1", * }, * { * key: "key-2", * value: "value-2", * }, * ], * autoDiscoveryConfigurations: [{ * subscriptionId: "my-subscription_id", * resourceTypeConfigurations: [ * { * resourceTypeName: "Microsoft.App/containerApps", * metricConfiguration: [{ * name: "TotalCoresQuotaUsed", * }], * }, * { * resourceTypeName: "Microsoft.Storage/storageAccounts/tableServices", * metricConfiguration: [{ * name: "Availability", * dimensions: [ * "GeoType", * "ApiName", * ], * aggregations: ["Average"], * }], * }, * ], * }], * }); * ``` * * ## Import * * ```sh * terraform import grafana_cloud_provider_azure_credential.name "{{ stack_id }}:{{ resource_id }}" * ``` */ class AzureCredential extends pulumi.CustomResource { /** * Get an existing AzureCredential 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, id, state, opts) { return new AzureCredential(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AzureCredential. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === AzureCredential.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoDiscoveryConfigurations"] = state?.autoDiscoveryConfigurations; resourceInputs["clientId"] = state?.clientId; resourceInputs["clientSecret"] = state?.clientSecret; resourceInputs["name"] = state?.name; resourceInputs["resourceDiscoveryTagFilters"] = state?.resourceDiscoveryTagFilters; resourceInputs["resourceId"] = state?.resourceId; resourceInputs["resourceTagsToAddToMetrics"] = state?.resourceTagsToAddToMetrics; resourceInputs["stackId"] = state?.stackId; resourceInputs["tenantId"] = state?.tenantId; } else { const args = argsOrState; if (args?.clientId === undefined && !opts.urn) { throw new Error("Missing required property 'clientId'"); } if (args?.clientSecret === undefined && !opts.urn) { throw new Error("Missing required property 'clientSecret'"); } if (args?.stackId === undefined && !opts.urn) { throw new Error("Missing required property 'stackId'"); } if (args?.tenantId === undefined && !opts.urn) { throw new Error("Missing required property 'tenantId'"); } resourceInputs["autoDiscoveryConfigurations"] = args?.autoDiscoveryConfigurations; resourceInputs["clientId"] = args?.clientId; resourceInputs["clientSecret"] = args?.clientSecret ? pulumi.secret(args.clientSecret) : undefined; resourceInputs["name"] = args?.name; resourceInputs["resourceDiscoveryTagFilters"] = args?.resourceDiscoveryTagFilters; resourceInputs["resourceTagsToAddToMetrics"] = args?.resourceTagsToAddToMetrics; resourceInputs["stackId"] = args?.stackId; resourceInputs["tenantId"] = args?.tenantId; resourceInputs["resourceId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["clientSecret"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(AzureCredential.__pulumiType, name, resourceInputs, opts); } } exports.AzureCredential = AzureCredential; /** @internal */ AzureCredential.__pulumiType = 'grafana:cloudProvider/azureCredential:AzureCredential'; //# sourceMappingURL=azureCredential.js.map