@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
107 lines • 4.89 kB
JavaScript
;
// *** 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.PrivateDataSourceConnectNetwork = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* * [Official documentation](https://grafana.com/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/)
* * [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#create-an-access-policy)
*
* Required access policy scopes:
*
* * accesspolicies:read
* * accesspolicies:write
* * accesspolicies:delete
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const current = grafana.cloud.getStack({
* slug: "<your slug>",
* });
* const test = new grafana.cloud.PrivateDataSourceConnectNetwork("test", {
* region: "prod-us-east-0",
* name: "my-pdc",
* displayName: "My PDC",
* stackIdentifier: current.then(current => current.id),
* });
* const testPrivateDataSourceConnectNetworkToken = new grafana.cloud.PrivateDataSourceConnectNetworkToken("test", {
* pdcNetworkId: test.pdcNetworkId,
* region: test.region,
* name: "my-pdc-token",
* displayName: "My PDC Token",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:cloud/privateDataSourceConnectNetwork:PrivateDataSourceConnectNetwork name "{{ region }}:{{ policyId }}"
* ```
*/
class PrivateDataSourceConnectNetwork extends pulumi.CustomResource {
/**
* Get an existing PrivateDataSourceConnectNetwork 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 PrivateDataSourceConnectNetwork(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of PrivateDataSourceConnectNetwork. 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'] === PrivateDataSourceConnectNetwork.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["pdcNetworkId"] = state ? state.pdcNetworkId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["stackIdentifier"] = state ? state.stackIdentifier : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.region === undefined) && !opts.urn) {
throw new Error("Missing required property 'region'");
}
if ((!args || args.stackIdentifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'stackIdentifier'");
}
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["stackIdentifier"] = args ? args.stackIdentifier : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["pdcNetworkId"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PrivateDataSourceConnectNetwork.__pulumiType, name, resourceInputs, opts);
}
}
exports.PrivateDataSourceConnectNetwork = PrivateDataSourceConnectNetwork;
/** @internal */
PrivateDataSourceConnectNetwork.__pulumiType = 'grafana:cloud/privateDataSourceConnectNetwork:PrivateDataSourceConnectNetwork';
//# sourceMappingURL=privateDataSourceConnectNetwork.js.map