1. Packages
  2. HashiCorp Consul
  3. API Docs
  4. License
Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi

consul.License

Explore with Pulumi AI

consul logo
Consul v3.11.3 published on Friday, May 24, 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 std from "@pulumi/std";
    
    const license = new consul.License("license", {license: std.file({
        input: "license.hclic",
    }).then(invoke => invoke.result)});
    
    import pulumi
    import pulumi_consul as consul
    import pulumi_std as std
    
    license = consul.License("license", license=std.file(input="license.hclic").result)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		invokeFile, err := std.File(ctx, &std.FileArgs{
    			Input: "license.hclic",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = consul.NewLicense(ctx, "license", &consul.LicenseArgs{
    			License: invokeFile.Result,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Consul = Pulumi.Consul;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var license = new Consul.License("license", new()
        {
            ConsulLicense = Std.File.Invoke(new()
            {
                Input = "license.hclic",
            }).Apply(invoke => invoke.Result),
        });
    
    });
    
    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(StdFunctions.file(FileArgs.builder()
                    .input("license.hclic")
                    .build()).result())
                .build());
    
        }
    }
    
    resources:
      license:
        type: consul:License
        properties:
          license:
            fn::invoke:
              Function: std:file
              Arguments:
                input: license.hclic
              Return: result
    

    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.

    Constructor 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.3 published on Friday, May 24, 2024 by Pulumi