UNPKG

@pulumiverse/dynatrace

Version:

A Pulumi package for creating and managing Dynatrace cloud resources.

113 lines 5.6 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.AzureService = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * > This resource is excluded by default in the export utility. * * > This resource requires the API token scopes **Read configuration** (`ReadConfig`) and **Write configuration** (`WriteConfig`) * * ## Dynatrace Documentation * * - Microsoft Azure monitoring - https://www.dynatrace.com/support/help/how-to-use-dynatrace/infrastructure-monitoring/cloud-platform-monitoring/microsoft-azure-services-monitoring * * - Azure credentials API - https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/azure-credentials-api * * ## Resource Example Usage * * This example utilizes the data source `dynatrace.getAzureSupportedServices` in order to query for a full list of all supported services. * The `forEach` loop within the resource `dynatrace.AzureService` configures each of these services to get utilized with the default metrics recommended by Dynatrace (`useRecommendedMetrics`). * * If you want to configure a different set of metrics for a specific service, a separate resource `dynatrace.AzureService` will be necessary for that. That allows you to configure the `metric` blocks according to your wishes. * Just be aware of the fact, that Dynatrace enforces for most services a recommended set of metrics. All of them need to be part of your configuration in order to end up with a non-empty plan. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as dynatrace from "@pulumi/dynatrace"; * import * as dynatrace from "@pulumiverse/dynatrace"; * * export = async () => { * const tERRAFORMSAMPLE = new dynatrace.AzureCredentials("tERRAFORMSAMPLE", { * active: false, * appId: "ABCDE", * autoTagging: true, * directoryId: "ABCDE", * label: "TERRAFORM_SAMPLE", * key: "aaaa", * monitorOnlyTaggedEntities: true, * monitorOnlyTagPairs: [{ * name: "string", * value: "string", * }], * }); * const supportedServices = await dynatrace.getAzureSupportedServices({ * excepts: ["AZURE_STORAGE_ACCOUNT"], * }); * const tERRAFORMSAMPLEServices: dynatrace.AzureService[] = []; * for (const range of Object.entries(supportedServices.services).map(([k, v]) => ({key: k, value: v}))) { * tERRAFORMSAMPLEServices.push(new dynatrace.AzureService(`tERRAFORMSAMPLEServices-${range.key}`, { * credentialsId: tERRAFORMSAMPLE.id, * useRecommendedMetrics: true, * })); * } * } * ``` */ class AzureService extends pulumi.CustomResource { /** * Get an existing AzureService 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 AzureService(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of AzureService. 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'] === AzureService.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["builtIn"] = state ? state.builtIn : undefined; resourceInputs["credentialsId"] = state ? state.credentialsId : undefined; resourceInputs["metrics"] = state ? state.metrics : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["requiredMetrics"] = state ? state.requiredMetrics : undefined; resourceInputs["useRecommendedMetrics"] = state ? state.useRecommendedMetrics : undefined; } else { const args = argsOrState; if ((!args || args.credentialsId === undefined) && !opts.urn) { throw new Error("Missing required property 'credentialsId'"); } resourceInputs["credentialsId"] = args ? args.credentialsId : undefined; resourceInputs["metrics"] = args ? args.metrics : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["useRecommendedMetrics"] = args ? args.useRecommendedMetrics : undefined; resourceInputs["builtIn"] = undefined /*out*/; resourceInputs["requiredMetrics"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AzureService.__pulumiType, name, resourceInputs, opts); } } exports.AzureService = AzureService; /** @internal */ AzureService.__pulumiType = 'dynatrace:index/azureService:AzureService'; //# sourceMappingURL=azureService.js.map