UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

165 lines • 8.06 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.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, Object.assign(Object.assign({}, 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 ? state.accountAccessType : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["authenticationProviders"] = state ? state.authenticationProviders : undefined; resourceInputs["configuration"] = state ? state.configuration : undefined; resourceInputs["dataSources"] = state ? state.dataSources : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["endpoint"] = state ? state.endpoint : undefined; resourceInputs["grafanaVersion"] = state ? state.grafanaVersion : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["networkAccessControl"] = state ? state.networkAccessControl : undefined; resourceInputs["notificationDestinations"] = state ? state.notificationDestinations : undefined; resourceInputs["organizationRoleName"] = state ? state.organizationRoleName : undefined; resourceInputs["organizationalUnits"] = state ? state.organizationalUnits : undefined; resourceInputs["permissionType"] = state ? state.permissionType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["roleArn"] = state ? state.roleArn : undefined; resourceInputs["samlConfigurationStatus"] = state ? state.samlConfigurationStatus : undefined; resourceInputs["stackSetName"] = state ? state.stackSetName : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["vpcConfiguration"] = state ? state.vpcConfiguration : undefined; } else { const args = argsOrState; if ((!args || args.accountAccessType === undefined) && !opts.urn) { throw new Error("Missing required property 'accountAccessType'"); } if ((!args || args.authenticationProviders === undefined) && !opts.urn) { throw new Error("Missing required property 'authenticationProviders'"); } if ((!args || args.permissionType === undefined) && !opts.urn) { throw new Error("Missing required property 'permissionType'"); } resourceInputs["accountAccessType"] = args ? args.accountAccessType : undefined; resourceInputs["authenticationProviders"] = args ? args.authenticationProviders : undefined; resourceInputs["configuration"] = args ? args.configuration : undefined; resourceInputs["dataSources"] = args ? args.dataSources : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["grafanaVersion"] = args ? args.grafanaVersion : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["networkAccessControl"] = args ? args.networkAccessControl : undefined; resourceInputs["notificationDestinations"] = args ? args.notificationDestinations : undefined; resourceInputs["organizationRoleName"] = args ? args.organizationRoleName : undefined; resourceInputs["organizationalUnits"] = args ? args.organizationalUnits : undefined; resourceInputs["permissionType"] = args ? args.permissionType : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["roleArn"] = args ? args.roleArn : undefined; resourceInputs["stackSetName"] = args ? args.stackSetName : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["vpcConfiguration"] = args ? args.vpcConfiguration : undefined; 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