@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
120 lines • 4.89 kB
JavaScript
;
// *** 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.ScimConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* **Note:** Available in [Grafana Enterprise](https://grafana.com/docs/grafana/latest/introduction/grafana-enterprise/) and [Grafana Cloud](https://grafana.com/docs/grafana-cloud/).
*
* * [Official documentation](https://grafana.com/docs/grafana/latest/setup-grafana/configure-access/configure-scim-provisioning/)
*
* ## Example Usage
*
* ### Grafana Enterprise
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const _default = new grafana.enterprise.ScimConfig("default", {
* enableUserSync: true,
* enableGroupSync: false,
* rejectNonProvisionedUsers: false,
* });
* ```
*
* ### Grafana Cloud
*
* When using this resource against a Grafana Cloud stack authenticated with a stack service account token, the `stackId` attribute must be set on the provider block so the request is routed to the correct stack namespace. Without it, the API returns `403 authn.invalid-namespace`.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const myStack = new grafana.cloud.Stack("my_stack", {
* name: "my-stack",
* slug: "my-stack",
* });
* const cloudSa = new grafana.cloud.StackServiceAccount("cloud_sa", {
* stackSlug: myStack.slug,
* name: "scim-terraform",
* role: "Admin",
* });
* const cloudSaStackServiceAccountToken = new grafana.cloud.StackServiceAccountToken("cloud_sa", {
* stackSlug: myStack.slug,
* serviceAccountId: cloudSa.id,
* name: "scim-terraform",
* });
* const _default = new grafana.enterprise.ScimConfig("default", {
* enableUserSync: true,
* enableGroupSync: false,
* rejectNonProvisionedUsers: false,
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:enterprise/scimConfig:ScimConfig name ""
* terraform import grafana_scim_config.name "{{ orgID }}"
* ```
*/
class ScimConfig extends pulumi.CustomResource {
/**
* Get an existing ScimConfig 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 ScimConfig(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ScimConfig. 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'] === ScimConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["enableGroupSync"] = state?.enableGroupSync;
resourceInputs["enableUserSync"] = state?.enableUserSync;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["rejectNonProvisionedUsers"] = state?.rejectNonProvisionedUsers;
}
else {
const args = argsOrState;
if (args?.enableGroupSync === undefined && !opts.urn) {
throw new Error("Missing required property 'enableGroupSync'");
}
if (args?.enableUserSync === undefined && !opts.urn) {
throw new Error("Missing required property 'enableUserSync'");
}
if (args?.rejectNonProvisionedUsers === undefined && !opts.urn) {
throw new Error("Missing required property 'rejectNonProvisionedUsers'");
}
resourceInputs["enableGroupSync"] = args?.enableGroupSync;
resourceInputs["enableUserSync"] = args?.enableUserSync;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["rejectNonProvisionedUsers"] = args?.rejectNonProvisionedUsers;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ScimConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.ScimConfig = ScimConfig;
/** @internal */
ScimConfig.__pulumiType = 'grafana:enterprise/scimConfig:ScimConfig';
//# sourceMappingURL=scimConfig.js.map