@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
108 lines • 4.55 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.LicenseGrant = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a License Manager grant. This allows for sharing licenses with other AWS accounts.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.licensemanager.LicenseGrant("test", {
* name: "share-license-with-account",
* allowedOperations: [
* "ListPurchasedLicenses",
* "CheckoutLicense",
* "CheckInLicense",
* "ExtendConsumptionLicense",
* "CreateToken",
* ],
* licenseArn: "arn:aws:license-manager::111111111111:license:l-exampleARN",
* principal: "arn:aws:iam::111111111112:root",
* homeRegion: "us-east-1",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_licensemanager_grant` using the grant arn. For example:
*
* ```sh
* $ pulumi import aws:licensemanager/licenseGrant:LicenseGrant test arn:aws:license-manager::123456789011:grant:g-01d313393d9e443d8664cc054db1e089
* ```
*/
class LicenseGrant extends pulumi.CustomResource {
/**
* Get an existing LicenseGrant 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 LicenseGrant(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of LicenseGrant. 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'] === LicenseGrant.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowedOperations"] = state?.allowedOperations;
resourceInputs["arn"] = state?.arn;
resourceInputs["homeRegion"] = state?.homeRegion;
resourceInputs["licenseArn"] = state?.licenseArn;
resourceInputs["name"] = state?.name;
resourceInputs["parentArn"] = state?.parentArn;
resourceInputs["principal"] = state?.principal;
resourceInputs["region"] = state?.region;
resourceInputs["status"] = state?.status;
resourceInputs["version"] = state?.version;
}
else {
const args = argsOrState;
if (args?.allowedOperations === undefined && !opts.urn) {
throw new Error("Missing required property 'allowedOperations'");
}
if (args?.licenseArn === undefined && !opts.urn) {
throw new Error("Missing required property 'licenseArn'");
}
if (args?.principal === undefined && !opts.urn) {
throw new Error("Missing required property 'principal'");
}
resourceInputs["allowedOperations"] = args?.allowedOperations;
resourceInputs["licenseArn"] = args?.licenseArn;
resourceInputs["name"] = args?.name;
resourceInputs["principal"] = args?.principal;
resourceInputs["region"] = args?.region;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["homeRegion"] = undefined /*out*/;
resourceInputs["parentArn"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LicenseGrant.__pulumiType, name, resourceInputs, opts);
}
}
exports.LicenseGrant = LicenseGrant;
/** @internal */
LicenseGrant.__pulumiType = 'aws:licensemanager/licenseGrant:LicenseGrant';
//# sourceMappingURL=licenseGrant.js.map