@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
110 lines • 4.37 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.LicenseAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Amazon Managed Grafana workspace license 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.LicenseAssociation("example", {
* licenseType: "ENTERPRISE_FREE_TRIAL",
* workspaceId: exampleWorkspace.id,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Grafana workspace license association using the workspace's `id`. For example:
*
* ```sh
* $ pulumi import aws:grafana/licenseAssociation:LicenseAssociation example g-2054c75a02
* ```
*/
class LicenseAssociation extends pulumi.CustomResource {
/**
* Get an existing LicenseAssociation 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 LicenseAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of LicenseAssociation. 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'] === LicenseAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["freeTrialExpiration"] = state?.freeTrialExpiration;
resourceInputs["grafanaToken"] = state?.grafanaToken;
resourceInputs["licenseExpiration"] = state?.licenseExpiration;
resourceInputs["licenseType"] = state?.licenseType;
resourceInputs["region"] = state?.region;
resourceInputs["workspaceId"] = state?.workspaceId;
}
else {
const args = argsOrState;
if (args?.licenseType === undefined && !opts.urn) {
throw new Error("Missing required property 'licenseType'");
}
if (args?.workspaceId === undefined && !opts.urn) {
throw new Error("Missing required property 'workspaceId'");
}
resourceInputs["grafanaToken"] = args?.grafanaToken;
resourceInputs["licenseType"] = args?.licenseType;
resourceInputs["region"] = args?.region;
resourceInputs["workspaceId"] = args?.workspaceId;
resourceInputs["freeTrialExpiration"] = undefined /*out*/;
resourceInputs["licenseExpiration"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LicenseAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.LicenseAssociation = LicenseAssociation;
/** @internal */
LicenseAssociation.__pulumiType = 'aws:grafana/licenseAssociation:LicenseAssociation';
//# sourceMappingURL=licenseAssociation.js.map
;