@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
165 lines • 7.29 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.Workspace = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Amazon Managed Grafana workspace resource.
*
* ## Example Usage
*
* ### Basic configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const assume = new aws.iam.Role("assume", {
* name: "grafana-assume",
* assumeRolePolicy: JSON.stringify({
* Version: "2012-10-17",
* Statement: [{
* Action: "sts:AssumeRole",
* Effect: "Allow",
* Sid: "",
* Principal: {
* Service: "grafana.amazonaws.com",
* },
* }],
* }),
* });
* const example = new aws.grafana.Workspace("example", {
* accountAccessType: "CURRENT_ACCOUNT",
* authenticationProviders: ["SAML"],
* permissionType: "SERVICE_MANAGED",
* roleArn: assume.arn,
* });
* ```
*
* ### Workspace configuration options
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.grafana.Workspace("example", {
* accountAccessType: "CURRENT_ACCOUNT",
* authenticationProviders: ["SAML"],
* permissionType: "SERVICE_MANAGED",
* roleArn: assume.arn,
* configuration: JSON.stringify({
* plugins: {
* pluginAdminEnabled: true,
* },
* unifiedAlerting: {
* enabled: false,
* },
* }),
* });
* ```
*
* The optional argument `configuration` is a JSON string that disables the unified `Grafana Alerting` (Grafana version 10 or newer) and enables `Plugin Management` (Grafana version 9 or newer) on the Grafana Workspaces.
*
* For more information about using Grafana alerting, and the effects of turning it on or off, see [Alerts in Grafana version 10](https://docs.aws.amazon.com/grafana/latest/userguide/v10-alerts.html).
*
* ## Import
*
* Using `pulumi import`, import Grafana Workspace using the workspace's `id`. For example:
*
* ```sh
* $ pulumi import aws:grafana/workspace:Workspace example g-2054c75a02
* ```
*/
class Workspace extends pulumi.CustomResource {
/**
* Get an existing Workspace 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 Workspace(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Workspace. 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'] === Workspace.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountAccessType"] = state?.accountAccessType;
resourceInputs["arn"] = state?.arn;
resourceInputs["authenticationProviders"] = state?.authenticationProviders;
resourceInputs["configuration"] = state?.configuration;
resourceInputs["dataSources"] = state?.dataSources;
resourceInputs["description"] = state?.description;
resourceInputs["endpoint"] = state?.endpoint;
resourceInputs["grafanaVersion"] = state?.grafanaVersion;
resourceInputs["name"] = state?.name;
resourceInputs["networkAccessControl"] = state?.networkAccessControl;
resourceInputs["notificationDestinations"] = state?.notificationDestinations;
resourceInputs["organizationRoleName"] = state?.organizationRoleName;
resourceInputs["organizationalUnits"] = state?.organizationalUnits;
resourceInputs["permissionType"] = state?.permissionType;
resourceInputs["region"] = state?.region;
resourceInputs["roleArn"] = state?.roleArn;
resourceInputs["samlConfigurationStatus"] = state?.samlConfigurationStatus;
resourceInputs["stackSetName"] = state?.stackSetName;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vpcConfiguration"] = state?.vpcConfiguration;
}
else {
const args = argsOrState;
if (args?.accountAccessType === undefined && !opts.urn) {
throw new Error("Missing required property 'accountAccessType'");
}
if (args?.authenticationProviders === undefined && !opts.urn) {
throw new Error("Missing required property 'authenticationProviders'");
}
if (args?.permissionType === undefined && !opts.urn) {
throw new Error("Missing required property 'permissionType'");
}
resourceInputs["accountAccessType"] = args?.accountAccessType;
resourceInputs["authenticationProviders"] = args?.authenticationProviders;
resourceInputs["configuration"] = args?.configuration;
resourceInputs["dataSources"] = args?.dataSources;
resourceInputs["description"] = args?.description;
resourceInputs["grafanaVersion"] = args?.grafanaVersion;
resourceInputs["name"] = args?.name;
resourceInputs["networkAccessControl"] = args?.networkAccessControl;
resourceInputs["notificationDestinations"] = args?.notificationDestinations;
resourceInputs["organizationRoleName"] = args?.organizationRoleName;
resourceInputs["organizationalUnits"] = args?.organizationalUnits;
resourceInputs["permissionType"] = args?.permissionType;
resourceInputs["region"] = args?.region;
resourceInputs["roleArn"] = args?.roleArn;
resourceInputs["stackSetName"] = args?.stackSetName;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcConfiguration"] = args?.vpcConfiguration;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["samlConfigurationStatus"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Workspace.__pulumiType, name, resourceInputs, opts);
}
}
exports.Workspace = Workspace;
/** @internal */
Workspace.__pulumiType = 'aws:grafana/workspace:Workspace';
//# sourceMappingURL=workspace.js.map
;