1. Packages
  2. HashiCorp Consul
  3. API Docs
  4. License
Consul v3.11.2 published on Thursday, Mar 21, 2024 by Pulumi

consul.License

Explore with Pulumi AI

consul logo
Consul v3.11.2 published on Thursday, Mar 21, 2024 by Pulumi

    NOTE: This feature requires Consul Enterprise.

    The consul.License resource provides datacenter-level management of the Consul Enterprise license. If ACLs are enabled then a token with operator privileges may be required in order to use this command.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as consul from "@pulumi/consul";
    import * as fs from "fs";
    
    const license = new consul.License("license", {license: fs.readFileSync("license.hclic", "utf8")});
    
    import pulumi
    import pulumi_consul as consul
    
    license = consul.License("license", license=(lambda path: open(path).read())("license.hclic"))
    
    package main
    
    import (
    	"os"
    
    	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func readFileOrPanic(path string) pulumi.StringPtrInput {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		panic(err.Error())
    	}
    	return pulumi.String(string(data))
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := consul.NewLicense(ctx, "license", &consul.LicenseArgs{
    			License: readFileOrPanic("license.hclic"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Pulumi;
    using Consul = Pulumi.Consul;
    
    return await Deployment.RunAsync(() => 
    {
        var license = new Consul.License("license", new()
        {
            ConsulLicense = File.ReadAllText("license.hclic"),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.consul.License;
    import com.pulumi.consul.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 license = new License("license", LicenseArgs.builder()        
                .license(Files.readString(Paths.get("license.hclic")))
                .build());
    
        }
    }
    
    resources:
      license:
        type: consul:License
        properties:
          license:
            fn::readFile: license.hclic
    

    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: Optional[str] = None,
                datacenter: Optional[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: consul: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 Consul.License("licenseResource", new()
    {
        ConsulLicense = "string",
        Datacenter = "string",
    });
    
    example, err := consul.NewLicense(ctx, "licenseResource", &consul.LicenseArgs{
    	License:    pulumi.String("string"),
    	Datacenter: pulumi.String("string"),
    })
    
    var licenseResource = new License("licenseResource", LicenseArgs.builder()        
        .license("string")
        .datacenter("string")
        .build());
    
    license_resource = consul.License("licenseResource",
        license="string",
        datacenter="string")
    
    const licenseResource = new consul.License("licenseResource", {
        license: "string",
        datacenter: "string",
    });
    
    type: consul:License
    properties:
        datacenter: string
        license: 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:

    ConsulLicense string
    The Consul license to use.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    License string
    The Consul license to use.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    license String
    The Consul license to use.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    license string
    The Consul license to use.
    datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    license str
    The Consul license to use.
    datacenter str
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    license String
    The Consul license to use.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.

    Outputs

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

    CustomerId string
    The ID of the customer the license is attached to.
    ExpirationTime string
    The expiration time of the license.
    Features List<string>
    The features for which the license is valid.
    Id string
    The provider-assigned unique ID for this managed resource.
    InstallationId string
    The ID of the current installation.
    IssueTime string
    The date the license was issued.
    LicenseId string
    The ID of the license used.
    Product string
    The product for which the license is valid.
    StartTime string
    The start time of the license.
    Valid bool
    Whether the license is valid.
    Warnings List<string>
    A list of warning messages regarding the license validity.
    CustomerId string
    The ID of the customer the license is attached to.
    ExpirationTime string
    The expiration time of the license.
    Features []string
    The features for which the license is valid.
    Id string
    The provider-assigned unique ID for this managed resource.
    InstallationId string
    The ID of the current installation.
    IssueTime string
    The date the license was issued.
    LicenseId string
    The ID of the license used.
    Product string
    The product for which the license is valid.
    StartTime string
    The start time of the license.
    Valid bool
    Whether the license is valid.
    Warnings []string
    A list of warning messages regarding the license validity.
    customerId String
    The ID of the customer the license is attached to.
    expirationTime String
    The expiration time of the license.
    features List<String>
    The features for which the license is valid.
    id String
    The provider-assigned unique ID for this managed resource.
    installationId String
    The ID of the current installation.
    issueTime String
    The date the license was issued.
    licenseId String
    The ID of the license used.
    product String
    The product for which the license is valid.
    startTime String
    The start time of the license.
    valid Boolean
    Whether the license is valid.
    warnings List<String>
    A list of warning messages regarding the license validity.
    customerId string
    The ID of the customer the license is attached to.
    expirationTime string
    The expiration time of the license.
    features string[]
    The features for which the license is valid.
    id string
    The provider-assigned unique ID for this managed resource.
    installationId string
    The ID of the current installation.
    issueTime string
    The date the license was issued.
    licenseId string
    The ID of the license used.
    product string
    The product for which the license is valid.
    startTime string
    The start time of the license.
    valid boolean
    Whether the license is valid.
    warnings string[]
    A list of warning messages regarding the license validity.
    customer_id str
    The ID of the customer the license is attached to.
    expiration_time str
    The expiration time of the license.
    features Sequence[str]
    The features for which the license is valid.
    id str
    The provider-assigned unique ID for this managed resource.
    installation_id str
    The ID of the current installation.
    issue_time str
    The date the license was issued.
    license_id str
    The ID of the license used.
    product str
    The product for which the license is valid.
    start_time str
    The start time of the license.
    valid bool
    Whether the license is valid.
    warnings Sequence[str]
    A list of warning messages regarding the license validity.
    customerId String
    The ID of the customer the license is attached to.
    expirationTime String
    The expiration time of the license.
    features List<String>
    The features for which the license is valid.
    id String
    The provider-assigned unique ID for this managed resource.
    installationId String
    The ID of the current installation.
    issueTime String
    The date the license was issued.
    licenseId String
    The ID of the license used.
    product String
    The product for which the license is valid.
    startTime String
    The start time of the license.
    valid Boolean
    Whether the license is valid.
    warnings List<String>
    A list of warning messages regarding the license validity.

    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,
            customer_id: Optional[str] = None,
            datacenter: Optional[str] = None,
            expiration_time: Optional[str] = None,
            features: Optional[Sequence[str]] = None,
            installation_id: Optional[str] = None,
            issue_time: Optional[str] = None,
            license: Optional[str] = None,
            license_id: Optional[str] = None,
            product: Optional[str] = None,
            start_time: Optional[str] = None,
            valid: Optional[bool] = None,
            warnings: Optional[Sequence[str]] = 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:
    ConsulLicense string
    The Consul license to use.
    CustomerId string
    The ID of the customer the license is attached to.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    ExpirationTime string
    The expiration time of the license.
    Features List<string>
    The features for which the license is valid.
    InstallationId string
    The ID of the current installation.
    IssueTime string
    The date the license was issued.
    LicenseId string
    The ID of the license used.
    Product string
    The product for which the license is valid.
    StartTime string
    The start time of the license.
    Valid bool
    Whether the license is valid.
    Warnings List<string>
    A list of warning messages regarding the license validity.
    CustomerId string
    The ID of the customer the license is attached to.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    ExpirationTime string
    The expiration time of the license.
    Features []string
    The features for which the license is valid.
    InstallationId string
    The ID of the current installation.
    IssueTime string
    The date the license was issued.
    License string
    The Consul license to use.
    LicenseId string
    The ID of the license used.
    Product string
    The product for which the license is valid.
    StartTime string
    The start time of the license.
    Valid bool
    Whether the license is valid.
    Warnings []string
    A list of warning messages regarding the license validity.
    customerId String
    The ID of the customer the license is attached to.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    expirationTime String
    The expiration time of the license.
    features List<String>
    The features for which the license is valid.
    installationId String
    The ID of the current installation.
    issueTime String
    The date the license was issued.
    license String
    The Consul license to use.
    licenseId String
    The ID of the license used.
    product String
    The product for which the license is valid.
    startTime String
    The start time of the license.
    valid Boolean
    Whether the license is valid.
    warnings List<String>
    A list of warning messages regarding the license validity.
    customerId string
    The ID of the customer the license is attached to.
    datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    expirationTime string
    The expiration time of the license.
    features string[]
    The features for which the license is valid.
    installationId string
    The ID of the current installation.
    issueTime string
    The date the license was issued.
    license string
    The Consul license to use.
    licenseId string
    The ID of the license used.
    product string
    The product for which the license is valid.
    startTime string
    The start time of the license.
    valid boolean
    Whether the license is valid.
    warnings string[]
    A list of warning messages regarding the license validity.
    customer_id str
    The ID of the customer the license is attached to.
    datacenter str
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    expiration_time str
    The expiration time of the license.
    features Sequence[str]
    The features for which the license is valid.
    installation_id str
    The ID of the current installation.
    issue_time str
    The date the license was issued.
    license str
    The Consul license to use.
    license_id str
    The ID of the license used.
    product str
    The product for which the license is valid.
    start_time str
    The start time of the license.
    valid bool
    Whether the license is valid.
    warnings Sequence[str]
    A list of warning messages regarding the license validity.
    customerId String
    The ID of the customer the license is attached to.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    expirationTime String
    The expiration time of the license.
    features List<String>
    The features for which the license is valid.
    installationId String
    The ID of the current installation.
    issueTime String
    The date the license was issued.
    license String
    The Consul license to use.
    licenseId String
    The ID of the license used.
    product String
    The product for which the license is valid.
    startTime String
    The start time of the license.
    valid Boolean
    Whether the license is valid.
    warnings List<String>
    A list of warning messages regarding the license validity.

    Package Details

    Repository
    HashiCorp Consul pulumi/pulumi-consul
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the consul Terraform Provider.
    consul logo
    Consul v3.11.2 published on Thursday, Mar 21, 2024 by Pulumi