UNPKG

@pulumi/aws

Version:

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

104 lines 3.89 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.RoleAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an Amazon Managed Grafana workspace role association 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 exampleWorkspace = new aws.grafana.Workspace("example", { * accountAccessType: "CURRENT_ACCOUNT", * authenticationProviders: ["SAML"], * permissionType: "SERVICE_MANAGED", * roleArn: assume.arn, * }); * const example = new aws.grafana.RoleAssociation("example", { * role: "ADMIN", * userIds: [ * "USER_ID_1", * "USER_ID_2", * ], * workspaceId: exampleWorkspace.id, * }); * ``` */ class RoleAssociation extends pulumi.CustomResource { /** * Get an existing RoleAssociation 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 RoleAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of RoleAssociation. 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'] === RoleAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["groupIds"] = state?.groupIds; resourceInputs["region"] = state?.region; resourceInputs["role"] = state?.role; resourceInputs["userIds"] = state?.userIds; resourceInputs["workspaceId"] = state?.workspaceId; } else { const args = argsOrState; if (args?.role === undefined && !opts.urn) { throw new Error("Missing required property 'role'"); } if (args?.workspaceId === undefined && !opts.urn) { throw new Error("Missing required property 'workspaceId'"); } resourceInputs["groupIds"] = args?.groupIds; resourceInputs["region"] = args?.region; resourceInputs["role"] = args?.role; resourceInputs["userIds"] = args?.userIds; resourceInputs["workspaceId"] = args?.workspaceId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RoleAssociation.__pulumiType, name, resourceInputs, opts); } } exports.RoleAssociation = RoleAssociation; /** @internal */ RoleAssociation.__pulumiType = 'aws:grafana/roleAssociation:RoleAssociation'; //# sourceMappingURL=roleAssociation.js.map