UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

91 lines 3.48 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.LoadTest = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a k6 load test. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const loadTestProject = new grafana.k6.Project("load_test_project", {name: "Terraform Load Test Project"}); * const testLoadTest = new grafana.k6.LoadTest("test_load_test", { * projectId: loadTestProject.id, * name: "Terraform Test Load Test", * script: `export default function() { * console.log('Hello from k6!'); * } * `, * }); * ``` * * ## Import * * ```sh * terraform import grafana_k6_load_test.name "{{ id }}" * ``` */ class LoadTest extends pulumi.CustomResource { /** * Get an existing LoadTest 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 LoadTest(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of LoadTest. 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'] === LoadTest.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["baselineTestRunId"] = state?.baselineTestRunId; resourceInputs["created"] = state?.created; resourceInputs["name"] = state?.name; resourceInputs["projectId"] = state?.projectId; resourceInputs["script"] = state?.script; resourceInputs["updated"] = state?.updated; } else { const args = argsOrState; if (args?.projectId === undefined && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if (args?.script === undefined && !opts.urn) { throw new Error("Missing required property 'script'"); } resourceInputs["baselineTestRunId"] = args?.baselineTestRunId; resourceInputs["name"] = args?.name; resourceInputs["projectId"] = args?.projectId; resourceInputs["script"] = args?.script; resourceInputs["created"] = undefined /*out*/; resourceInputs["updated"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(LoadTest.__pulumiType, name, resourceInputs, opts); } } exports.LoadTest = LoadTest; /** @internal */ LoadTest.__pulumiType = 'grafana:k6/loadTest:LoadTest'; //# sourceMappingURL=loadTest.js.map