com.pulumi.consul.License Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.consul;
import com.pulumi.consul.LicenseArgs;
import com.pulumi.consul.Utilities;
import com.pulumi.consul.inputs.LicenseState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* > **NOTE:** This feature requires [Consul Enterprise](https://www.consul.io/docs/enterprise/index.html).
*
* 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
* ```java
* 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());
*
* }
* }
* ```
*
*/
@ResourceType(type="consul:index/license:License")
public class License extends com.pulumi.resources.CustomResource {
/**
* The ID of the customer the license is attached to.
*
*/
@Export(name="customerId", refs={String.class}, tree="[0]")
private Output customerId;
/**
* @return The ID of the customer the license is attached to.
*
*/
public Output customerId() {
return this.customerId;
}
/**
* The datacenter to use. This overrides the
* agent's default datacenter and the datacenter in the provider setup.
*
*/
@Export(name="datacenter", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> datacenter;
/**
* @return The datacenter to use. This overrides the
* agent's default datacenter and the datacenter in the provider setup.
*
*/
public Output> datacenter() {
return Codegen.optional(this.datacenter);
}
/**
* The expiration time of the license.
*
*/
@Export(name="expirationTime", refs={String.class}, tree="[0]")
private Output expirationTime;
/**
* @return The expiration time of the license.
*
*/
public Output expirationTime() {
return this.expirationTime;
}
/**
* The features for which the license is valid.
*
*/
@Export(name="features", refs={List.class,String.class}, tree="[0,1]")
private Output> features;
/**
* @return The features for which the license is valid.
*
*/
public Output> features() {
return this.features;
}
/**
* The ID of the current installation.
*
*/
@Export(name="installationId", refs={String.class}, tree="[0]")
private Output installationId;
/**
* @return The ID of the current installation.
*
*/
public Output installationId() {
return this.installationId;
}
/**
* The date the license was issued.
*
*/
@Export(name="issueTime", refs={String.class}, tree="[0]")
private Output issueTime;
/**
* @return The date the license was issued.
*
*/
public Output issueTime() {
return this.issueTime;
}
/**
* The Consul license to use.
*
*/
@Export(name="license", refs={String.class}, tree="[0]")
private Output license;
/**
* @return The Consul license to use.
*
*/
public Output license() {
return this.license;
}
/**
* The ID of the license used.
*
*/
@Export(name="licenseId", refs={String.class}, tree="[0]")
private Output licenseId;
/**
* @return The ID of the license used.
*
*/
public Output licenseId() {
return this.licenseId;
}
/**
* The product for which the license is valid.
*
*/
@Export(name="product", refs={String.class}, tree="[0]")
private Output product;
/**
* @return The product for which the license is valid.
*
*/
public Output product() {
return this.product;
}
/**
* The start time of the license.
*
*/
@Export(name="startTime", refs={String.class}, tree="[0]")
private Output startTime;
/**
* @return The start time of the license.
*
*/
public Output startTime() {
return this.startTime;
}
/**
* Whether the license is valid.
*
*/
@Export(name="valid", refs={Boolean.class}, tree="[0]")
private Output valid;
/**
* @return Whether the license is valid.
*
*/
public Output valid() {
return this.valid;
}
/**
* A list of warning messages regarding the license validity.
*
*/
@Export(name="warnings", refs={List.class,String.class}, tree="[0,1]")
private Output> warnings;
/**
* @return A list of warning messages regarding the license validity.
*
*/
public Output> warnings() {
return this.warnings;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public License(String name) {
this(name, LicenseArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public License(String name, LicenseArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public License(String name, LicenseArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("consul:index/license:License", name, args == null ? LicenseArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
}
private License(String name, Output id, @Nullable LicenseState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("consul:index/license:License", name, state, makeResourceOptions(options, id));
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.additionalSecretOutputs(List.of(
"license"
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host 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
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static License get(String name, Output id, @Nullable LicenseState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new License(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy