All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.consul.Node 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.NodeArgs;
import com.pulumi.consul.Utilities;
import com.pulumi.consul.inputs.NodeState;
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.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Provides access to Node data in Consul. This can be used to define a
 * node. Currently, defining health checks is not supported.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.consul.Node;
 * import com.pulumi.consul.NodeArgs;
 * 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 foobar = new Node("foobar", NodeArgs.builder()        
 *             .address("192.168.10.10")
 *             .name("foobar")
 *             .build());
 * 
 *     }
 * }
 * ```
 * <!--End PulumiCodeChooser -->
 * 
 * ## Import
 * 
 * The `consul_node` resource can be imported:
 * 
 * ```sh
 * $ pulumi import consul:index/node:Node example node-name
 * ```
 * 
 */
@ResourceType(type="consul:index/node:Node")
public class Node extends com.pulumi.resources.CustomResource {
    /**
     * The address of the node being added to, or referenced in the catalog.
     * 
     */
    @Export(name="address", refs={String.class}, tree="[0]")
    private Output address;

    /**
     * @return The address of the node being added to, or referenced in the catalog.
     * 
     */
    public Output address() {
        return this.address;
    }
    /**
     * 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 datacenter;

    /**
     * @return The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
     * 
     */
    public Output datacenter() {
        return this.datacenter;
    }
    /**
     * Key/value pairs that are associated with the node.
     * 
     */
    @Export(name="meta", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output> meta;

    /**
     * @return Key/value pairs that are associated with the node.
     * 
     */
    public Output>> meta() {
        return Codegen.optional(this.meta);
    }
    /**
     * The name of the node being added to, or referenced in the catalog.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output name;

    /**
     * @return The name of the node being added to, or referenced in the catalog.
     * 
     */
    public Output name() {
        return this.name;
    }
    /**
     * The partition the node is associated with.
     * 
     */
    @Export(name="partition", refs={String.class}, tree="[0]")
    private Output partition;

    /**
     * @return The partition the node is associated with.
     * 
     */
    public Output> partition() {
        return Codegen.optional(this.partition);
    }
    /**
     * @deprecated
     * The token argument has been deprecated and will be removed in a future release.
     * Please use the token argument in the provider configuration
     * 
     */
    @Deprecated /* The token argument has been deprecated and will be removed in a future release.
Please use the token argument in the provider configuration */
    @Export(name="token", refs={String.class}, tree="[0]")
    private Output token;

    public Output> token() {
        return Codegen.optional(this.token);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public Node(String name) {
        this(name, NodeArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public Node(String name, NodeArgs 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 Node(String name, NodeArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("consul:index/node:Node", name, args == null ? NodeArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private Node(String name, Output id, @Nullable NodeState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("consul:index/node:Node", 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(
                "token"
            ))
            .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 Node get(String name, Output id, @Nullable NodeState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new Node(name, id, state, options);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy