Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Node

Provides access to Node data in Consul. This can be used to define a node. Currently, defining health checks is not supported.

Example Usage

using Pulumi;
using Consul = Pulumi.Consul;

class MyStack : Stack
{
    public MyStack()
    {
        var foobar = new Consul.Node("foobar", new Consul.NodeArgs
        {
            Address = "192.168.10.10",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-consul/sdk/v2/go/consul"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := consul.NewNode(ctx, "foobar", &consul.NodeArgs{
            Address: pulumi.String("192.168.10.10"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_consul as consul

foobar = consul.Node("foobar", address="192.168.10.10")
import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const foobar = new consul.Node("foobar", {
    address: "192.168.10.10",
});

Create a Node Resource

new Node(name: string, args: NodeArgs, opts?: CustomResourceOptions);
def Node(resource_name: str, opts: Optional[ResourceOptions] = None, address: Optional[str] = None, datacenter: Optional[str] = None, meta: Optional[Mapping[str, str]] = None, name: Optional[str] = None, token: Optional[str] = None)
func NewNode(ctx *Context, name string, args NodeArgs, opts ...ResourceOption) (*Node, error)
public Node(string name, NodeArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args NodeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args NodeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NodeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Node Resource Properties

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

Inputs

The Node resource accepts the following input properties:

Address string

The address of the node being added to, or referenced in the catalog.

Datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

Meta Dictionary<string, string>

Key/value pairs that are associated with the node.

Name string

The name of the node being added to, or referenced in the catalog.

Token string
Address string

The address of the node being added to, or referenced in the catalog.

Datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

Meta map[string]string

Key/value pairs that are associated with the node.

Name string

The name of the node being added to, or referenced in the catalog.

Token string
address string

The address of the node being added to, or referenced in the catalog.

datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

meta {[key: string]: string}

Key/value pairs that are associated with the node.

name string

The name of the node being added to, or referenced in the catalog.

token string
address str

The address of the node being added to, or referenced in the catalog.

datacenter str

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

meta Mapping[str, str]

Key/value pairs that are associated with the node.

name str

The name of the node being added to, or referenced in the catalog.

token str

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Node Resource

Get an existing Node 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?: NodeState, opts?: CustomResourceOptions): Node
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, address: Optional[str] = None, datacenter: Optional[str] = None, meta: Optional[Mapping[str, str]] = None, name: Optional[str] = None, token: Optional[str] = None) -> Node
func GetNode(ctx *Context, name string, id IDInput, state *NodeState, opts ...ResourceOption) (*Node, error)
public static Node Get(string name, Input<string> id, NodeState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Address string

The address of the node being added to, or referenced in the catalog.

Datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

Meta Dictionary<string, string>

Key/value pairs that are associated with the node.

Name string

The name of the node being added to, or referenced in the catalog.

Token string
Address string

The address of the node being added to, or referenced in the catalog.

Datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

Meta map[string]string

Key/value pairs that are associated with the node.

Name string

The name of the node being added to, or referenced in the catalog.

Token string
address string

The address of the node being added to, or referenced in the catalog.

datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

meta {[key: string]: string}

Key/value pairs that are associated with the node.

name string

The name of the node being added to, or referenced in the catalog.

token string
address str

The address of the node being added to, or referenced in the catalog.

datacenter str

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

meta Mapping[str, str]

Key/value pairs that are associated with the node.

name str

The name of the node being added to, or referenced in the catalog.

token str

Package Details

Repository
https://github.com/pulumi/pulumi-consul
License
Apache-2.0
Notes
This Pulumi package is based on the consul Terraform Provider.