1. Packages
  2. vSphere
  3. API Docs
  4. License
vSphere v4.10.0 published on Tuesday, Mar 12, 2024 by Pulumi

vsphere.License

Explore with Pulumi AI

vsphere logo
vSphere v4.10.0 published on Tuesday, Mar 12, 2024 by Pulumi

    Provides a VMware vSphere license resource. This can be used to add and remove license keys.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vsphere from "@pulumi/vsphere";
    
    const licenseKey = new vsphere.License("licenseKey", {
        labels: {
            VpxClientLicenseLabel: "Hello World",
            Workflow: "Hello World",
        },
        licenseKey: "452CQ-2EK54-K8742-00000-00000",
    });
    
    import pulumi
    import pulumi_vsphere as vsphere
    
    license_key = vsphere.License("licenseKey",
        labels={
            "VpxClientLicenseLabel": "Hello World",
            "Workflow": "Hello World",
        },
        license_key="452CQ-2EK54-K8742-00000-00000")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vsphere.NewLicense(ctx, "licenseKey", &vsphere.LicenseArgs{
    			Labels: pulumi.StringMap{
    				"VpxClientLicenseLabel": pulumi.String("Hello World"),
    				"Workflow":              pulumi.String("Hello World"),
    			},
    			LicenseKey: pulumi.String("452CQ-2EK54-K8742-00000-00000"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using VSphere = Pulumi.VSphere;
    
    return await Deployment.RunAsync(() => 
    {
        var licenseKey = new VSphere.License("licenseKey", new()
        {
            Labels = 
            {
                { "VpxClientLicenseLabel", "Hello World" },
                { "Workflow", "Hello World" },
            },
            LicenseKey = "452CQ-2EK54-K8742-00000-00000",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vsphere.License;
    import com.pulumi.vsphere.LicenseArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var licenseKey = new License("licenseKey", LicenseArgs.builder()        
                .labels(Map.ofEntries(
                    Map.entry("VpxClientLicenseLabel", "Hello World"),
                    Map.entry("Workflow", "Hello World")
                ))
                .licenseKey("452CQ-2EK54-K8742-00000-00000")
                .build());
    
        }
    }
    
    resources:
      licenseKey:
        type: vsphere:License
        properties:
          labels:
            VpxClientLicenseLabel: Hello World
            Workflow: Hello World
          licenseKey: 452CQ-2EK54-K8742-00000-00000
    

    Create License Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new License(name: string, args: LicenseArgs, opts?: CustomResourceOptions);
    @overload
    def License(resource_name: str,
                args: LicenseArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def License(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                license_key: Optional[str] = None,
                labels: Optional[Mapping[str, str]] = None)
    func NewLicense(ctx *Context, name string, args LicenseArgs, opts ...ResourceOption) (*License, error)
    public License(string name, LicenseArgs args, CustomResourceOptions? opts = null)
    public License(String name, LicenseArgs args)
    public License(String name, LicenseArgs args, CustomResourceOptions options)
    
    type: vsphere:License
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args LicenseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args LicenseArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args LicenseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LicenseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LicenseArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var licenseResource = new VSphere.License("licenseResource", new()
    {
        LicenseKey = "string",
        Labels = 
        {
            { "string", "string" },
        },
    });
    
    example, err := vsphere.NewLicense(ctx, "licenseResource", &vsphere.LicenseArgs{
    	LicenseKey: pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var licenseResource = new License("licenseResource", LicenseArgs.builder()        
        .licenseKey("string")
        .labels(Map.of("string", "string"))
        .build());
    
    license_resource = vsphere.License("licenseResource",
        license_key="string",
        labels={
            "string": "string",
        })
    
    const licenseResource = new vsphere.License("licenseResource", {
        licenseKey: "string",
        labels: {
            string: "string",
        },
    });
    
    type: vsphere:License
    properties:
        labels:
            string: string
        licenseKey: string
    

    License Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The License resource accepts the following input properties:

    LicenseKey string
    The license key to add.
    Labels Dictionary<string, string>
    A map of key/value pairs to be attached as labels (tags) to the license key.
    LicenseKey string
    The license key to add.
    Labels map[string]string
    A map of key/value pairs to be attached as labels (tags) to the license key.
    licenseKey String
    The license key to add.
    labels Map<String,String>
    A map of key/value pairs to be attached as labels (tags) to the license key.
    licenseKey string
    The license key to add.
    labels {[key: string]: string}
    A map of key/value pairs to be attached as labels (tags) to the license key.
    license_key str
    The license key to add.
    labels Mapping[str, str]
    A map of key/value pairs to be attached as labels (tags) to the license key.
    licenseKey String
    The license key to add.
    labels Map<String>
    A map of key/value pairs to be attached as labels (tags) to the license key.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the License resource produces the following output properties:

    EditionKey string
    The product edition of the license key.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The display name for the license.
    Total int
    Total number of units (example: CPUs) contained in the license.
    Used int
    The number of units (example: CPUs) assigned to this license.
    EditionKey string
    The product edition of the license key.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The display name for the license.
    Total int
    Total number of units (example: CPUs) contained in the license.
    Used int
    The number of units (example: CPUs) assigned to this license.
    editionKey String
    The product edition of the license key.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The display name for the license.
    total Integer
    Total number of units (example: CPUs) contained in the license.
    used Integer
    The number of units (example: CPUs) assigned to this license.
    editionKey string
    The product edition of the license key.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The display name for the license.
    total number
    Total number of units (example: CPUs) contained in the license.
    used number
    The number of units (example: CPUs) assigned to this license.
    edition_key str
    The product edition of the license key.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The display name for the license.
    total int
    Total number of units (example: CPUs) contained in the license.
    used int
    The number of units (example: CPUs) assigned to this license.
    editionKey String
    The product edition of the license key.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The display name for the license.
    total Number
    Total number of units (example: CPUs) contained in the license.
    used Number
    The number of units (example: CPUs) assigned to this license.

    Look up Existing License Resource

    Get an existing License resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: LicenseState, opts?: CustomResourceOptions): License
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            edition_key: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            license_key: Optional[str] = None,
            name: Optional[str] = None,
            total: Optional[int] = None,
            used: Optional[int] = None) -> License
    func GetLicense(ctx *Context, name string, id IDInput, state *LicenseState, opts ...ResourceOption) (*License, error)
    public static License Get(string name, Input<string> id, LicenseState? state, CustomResourceOptions? opts = null)
    public static License get(String name, Output<String> id, LicenseState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    EditionKey string
    The product edition of the license key.
    Labels Dictionary<string, string>
    A map of key/value pairs to be attached as labels (tags) to the license key.
    LicenseKey string
    The license key to add.
    Name string
    The display name for the license.
    Total int
    Total number of units (example: CPUs) contained in the license.
    Used int
    The number of units (example: CPUs) assigned to this license.
    EditionKey string
    The product edition of the license key.
    Labels map[string]string
    A map of key/value pairs to be attached as labels (tags) to the license key.
    LicenseKey string
    The license key to add.
    Name string
    The display name for the license.
    Total int
    Total number of units (example: CPUs) contained in the license.
    Used int
    The number of units (example: CPUs) assigned to this license.
    editionKey String
    The product edition of the license key.
    labels Map<String,String>
    A map of key/value pairs to be attached as labels (tags) to the license key.
    licenseKey String
    The license key to add.
    name String
    The display name for the license.
    total Integer
    Total number of units (example: CPUs) contained in the license.
    used Integer
    The number of units (example: CPUs) assigned to this license.
    editionKey string
    The product edition of the license key.
    labels {[key: string]: string}
    A map of key/value pairs to be attached as labels (tags) to the license key.
    licenseKey string
    The license key to add.
    name string
    The display name for the license.
    total number
    Total number of units (example: CPUs) contained in the license.
    used number
    The number of units (example: CPUs) assigned to this license.
    edition_key str
    The product edition of the license key.
    labels Mapping[str, str]
    A map of key/value pairs to be attached as labels (tags) to the license key.
    license_key str
    The license key to add.
    name str
    The display name for the license.
    total int
    Total number of units (example: CPUs) contained in the license.
    used int
    The number of units (example: CPUs) assigned to this license.
    editionKey String
    The product edition of the license key.
    labels Map<String>
    A map of key/value pairs to be attached as labels (tags) to the license key.
    licenseKey String
    The license key to add.
    name String
    The display name for the license.
    total Number
    Total number of units (example: CPUs) contained in the license.
    used Number
    The number of units (example: CPUs) assigned to this license.

    Package Details

    Repository
    vSphere pulumi/pulumi-vsphere
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vsphere Terraform Provider.
    vsphere logo
    vSphere v4.10.0 published on Tuesday, Mar 12, 2024 by Pulumi