1. Packages
  2. Consul Provider
  3. API Docs
  4. CatalogEntry
Consul v3.12.4 published on Wednesday, Feb 12, 2025 by Pulumi

consul.CatalogEntry

Explore with Pulumi AI

!> The consul.CatalogEntry resource has been deprecated in version 2.0.0 of the provider and will be removed in a future release. Please read the upgrade guide for more information.

Registers a node or service with the Consul Catalog. Currently, defining health checks is not supported.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.CatalogEntry;
import com.pulumi.consul.CatalogEntryArgs;
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 app = new CatalogEntry("app", CatalogEntryArgs.builder()
            .address("192.168.10.10")
            .node("foobar")
            .services(CatalogEntryServiceArgs.builder()
                .address("127.0.0.1")
                .id("redis1")
                .name("redis")
                .port(8000)
                .tags(                
                    "master",
                    "v1")
                .build())
            .build());

    }
}
Copy
resources:
  app:
    type: consul:CatalogEntry
    properties:
      address: 192.168.10.10
      node: foobar
      services:
        address: 127.0.0.1
        id: redis1
        name: redis
        port: 8000
        tags:
          - master
          - v1
Copy

Create CatalogEntry Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new CatalogEntry(name: string, args: CatalogEntryArgs, opts?: CustomResourceOptions);
@overload
def CatalogEntry(resource_name: str,
                 args: CatalogEntryArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def CatalogEntry(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 address: Optional[str] = None,
                 node: Optional[str] = None,
                 datacenter: Optional[str] = None,
                 services: Optional[Sequence[CatalogEntryServiceArgs]] = None,
                 token: Optional[str] = None)
func NewCatalogEntry(ctx *Context, name string, args CatalogEntryArgs, opts ...ResourceOption) (*CatalogEntry, error)
public CatalogEntry(string name, CatalogEntryArgs args, CustomResourceOptions? opts = null)
public CatalogEntry(String name, CatalogEntryArgs args)
public CatalogEntry(String name, CatalogEntryArgs args, CustomResourceOptions options)
type: consul:CatalogEntry
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. CatalogEntryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. CatalogEntryArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. CatalogEntryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CatalogEntryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. CatalogEntryArgs
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 catalogEntryResource = new Consul.CatalogEntry("catalogEntryResource", new()
{
    Address = "string",
    Node = "string",
    Datacenter = "string",
    Services = new[]
    {
        new Consul.Inputs.CatalogEntryServiceArgs
        {
            Name = "string",
            Address = "string",
            Id = "string",
            Port = 0,
            Tags = new[]
            {
                "string",
            },
        },
    },
});
Copy
example, err := consul.NewCatalogEntry(ctx, "catalogEntryResource", &consul.CatalogEntryArgs{
	Address:    pulumi.String("string"),
	Node:       pulumi.String("string"),
	Datacenter: pulumi.String("string"),
	Services: consul.CatalogEntryServiceArray{
		&consul.CatalogEntryServiceArgs{
			Name:    pulumi.String("string"),
			Address: pulumi.String("string"),
			Id:      pulumi.String("string"),
			Port:    pulumi.Int(0),
			Tags: pulumi.StringArray{
				pulumi.String("string"),
			},
		},
	},
})
Copy
var catalogEntryResource = new CatalogEntry("catalogEntryResource", CatalogEntryArgs.builder()
    .address("string")
    .node("string")
    .datacenter("string")
    .services(CatalogEntryServiceArgs.builder()
        .name("string")
        .address("string")
        .id("string")
        .port(0)
        .tags("string")
        .build())
    .build());
Copy
catalog_entry_resource = consul.CatalogEntry("catalogEntryResource",
    address="string",
    node="string",
    datacenter="string",
    services=[{
        "name": "string",
        "address": "string",
        "id": "string",
        "port": 0,
        "tags": ["string"],
    }])
Copy
const catalogEntryResource = new consul.CatalogEntry("catalogEntryResource", {
    address: "string",
    node: "string",
    datacenter: "string",
    services: [{
        name: "string",
        address: "string",
        id: "string",
        port: 0,
        tags: ["string"],
    }],
});
Copy
type: consul:CatalogEntry
properties:
    address: string
    datacenter: string
    node: string
    services:
        - address: string
          id: string
          name: string
          port: 0
          tags:
            - string
Copy

CatalogEntry Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The CatalogEntry resource accepts the following input properties:

Address
This property is required.
Changes to this property will trigger replacement.
string
The address of the node being added to, or referenced in the catalog.
Node
This property is required.
Changes to this property will trigger replacement.
string
The name of the node being added to, or referenced in the catalog.
Datacenter Changes to this property will trigger replacement. string
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
Services Changes to this property will trigger replacement. List<CatalogEntryService>
A service to optionally associated with the node. Supported values are documented below.
Token string
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

Address
This property is required.
Changes to this property will trigger replacement.
string
The address of the node being added to, or referenced in the catalog.
Node
This property is required.
Changes to this property will trigger replacement.
string
The name of the node being added to, or referenced in the catalog.
Datacenter Changes to this property will trigger replacement. string
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
Services Changes to this property will trigger replacement. []CatalogEntryServiceArgs
A service to optionally associated with the node. Supported values are documented below.
Token string
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

address
This property is required.
Changes to this property will trigger replacement.
String
The address of the node being added to, or referenced in the catalog.
node
This property is required.
Changes to this property will trigger replacement.
String
The name of the node being added to, or referenced in the catalog.
datacenter Changes to this property will trigger replacement. String
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
services Changes to this property will trigger replacement. List<CatalogEntryService>
A service to optionally associated with the node. Supported values are documented below.
token String
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

address
This property is required.
Changes to this property will trigger replacement.
string
The address of the node being added to, or referenced in the catalog.
node
This property is required.
Changes to this property will trigger replacement.
string
The name of the node being added to, or referenced in the catalog.
datacenter Changes to this property will trigger replacement. string
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
services Changes to this property will trigger replacement. CatalogEntryService[]
A service to optionally associated with the node. Supported values are documented below.
token string
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

address
This property is required.
Changes to this property will trigger replacement.
str
The address of the node being added to, or referenced in the catalog.
node
This property is required.
Changes to this property will trigger replacement.
str
The name of the node being added to, or referenced in the catalog.
datacenter Changes to this property will trigger replacement. str
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
services Changes to this property will trigger replacement. Sequence[CatalogEntryServiceArgs]
A service to optionally associated with the node. Supported values are documented below.
token str
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

address
This property is required.
Changes to this property will trigger replacement.
String
The address of the node being added to, or referenced in the catalog.
node
This property is required.
Changes to this property will trigger replacement.
String
The name of the node being added to, or referenced in the catalog.
datacenter Changes to this property will trigger replacement. String
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
services Changes to this property will trigger replacement. List<Property Map>
A service to optionally associated with the node. Supported values are documented below.
token String
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

Outputs

All input properties are implicitly available as output properties. Additionally, the CatalogEntry 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 string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing CatalogEntry Resource

Get an existing CatalogEntry 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?: CatalogEntryState, opts?: CustomResourceOptions): CatalogEntry
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        address: Optional[str] = None,
        datacenter: Optional[str] = None,
        node: Optional[str] = None,
        services: Optional[Sequence[CatalogEntryServiceArgs]] = None,
        token: Optional[str] = None) -> CatalogEntry
func GetCatalogEntry(ctx *Context, name string, id IDInput, state *CatalogEntryState, opts ...ResourceOption) (*CatalogEntry, error)
public static CatalogEntry Get(string name, Input<string> id, CatalogEntryState? state, CustomResourceOptions? opts = null)
public static CatalogEntry get(String name, Output<String> id, CatalogEntryState state, CustomResourceOptions options)
resources:  _:    type: consul:CatalogEntry    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
The address of the node being added to, or referenced in the catalog.
Datacenter Changes to this property will trigger replacement. string
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
Node Changes to this property will trigger replacement. string
The name of the node being added to, or referenced in the catalog.
Services Changes to this property will trigger replacement. List<CatalogEntryService>
A service to optionally associated with the node. Supported values are documented below.
Token string
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

Address Changes to this property will trigger replacement. string
The address of the node being added to, or referenced in the catalog.
Datacenter Changes to this property will trigger replacement. string
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
Node Changes to this property will trigger replacement. string
The name of the node being added to, or referenced in the catalog.
Services Changes to this property will trigger replacement. []CatalogEntryServiceArgs
A service to optionally associated with the node. Supported values are documented below.
Token string
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

address Changes to this property will trigger replacement. String
The address of the node being added to, or referenced in the catalog.
datacenter Changes to this property will trigger replacement. String
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
node Changes to this property will trigger replacement. String
The name of the node being added to, or referenced in the catalog.
services Changes to this property will trigger replacement. List<CatalogEntryService>
A service to optionally associated with the node. Supported values are documented below.
token String
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

address Changes to this property will trigger replacement. string
The address of the node being added to, or referenced in the catalog.
datacenter Changes to this property will trigger replacement. string
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
node Changes to this property will trigger replacement. string
The name of the node being added to, or referenced in the catalog.
services Changes to this property will trigger replacement. CatalogEntryService[]
A service to optionally associated with the node. Supported values are documented below.
token string
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

address Changes to this property will trigger replacement. str
The address of the node being added to, or referenced in the catalog.
datacenter Changes to this property will trigger replacement. str
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
node Changes to this property will trigger replacement. str
The name of the node being added to, or referenced in the catalog.
services Changes to this property will trigger replacement. Sequence[CatalogEntryServiceArgs]
A service to optionally associated with the node. Supported values are documented below.
token str
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

address Changes to this property will trigger replacement. String
The address of the node being added to, or referenced in the catalog.
datacenter Changes to this property will trigger replacement. String
The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
node Changes to this property will trigger replacement. String
The name of the node being added to, or referenced in the catalog.
services Changes to this property will trigger replacement. List<Property Map>
A service to optionally associated with the node. Supported values are documented below.
token String
ACL token.

Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

Supporting Types

CatalogEntryService
, CatalogEntryServiceArgs

Name
This property is required.
Changes to this property will trigger replacement.
string
The name of the service
Address Changes to this property will trigger replacement. string
The address of the service. Defaults to the node address.
Id Changes to this property will trigger replacement. string
The ID of the service. Defaults to the name.
Port Changes to this property will trigger replacement. int
The port of the service.
Tags Changes to this property will trigger replacement. List<string>
A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
Name
This property is required.
Changes to this property will trigger replacement.
string
The name of the service
Address Changes to this property will trigger replacement. string
The address of the service. Defaults to the node address.
Id Changes to this property will trigger replacement. string
The ID of the service. Defaults to the name.
Port Changes to this property will trigger replacement. int
The port of the service.
Tags Changes to this property will trigger replacement. []string
A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
name
This property is required.
Changes to this property will trigger replacement.
String
The name of the service
address Changes to this property will trigger replacement. String
The address of the service. Defaults to the node address.
id Changes to this property will trigger replacement. String
The ID of the service. Defaults to the name.
port Changes to this property will trigger replacement. Integer
The port of the service.
tags Changes to this property will trigger replacement. List<String>
A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
name
This property is required.
Changes to this property will trigger replacement.
string
The name of the service
address Changes to this property will trigger replacement. string
The address of the service. Defaults to the node address.
id Changes to this property will trigger replacement. string
The ID of the service. Defaults to the name.
port Changes to this property will trigger replacement. number
The port of the service.
tags Changes to this property will trigger replacement. string[]
A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
name
This property is required.
Changes to this property will trigger replacement.
str
The name of the service
address Changes to this property will trigger replacement. str
The address of the service. Defaults to the node address.
id Changes to this property will trigger replacement. str
The ID of the service. Defaults to the name.
port Changes to this property will trigger replacement. int
The port of the service.
tags Changes to this property will trigger replacement. Sequence[str]
A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
name
This property is required.
Changes to this property will trigger replacement.
String
The name of the service
address Changes to this property will trigger replacement. String
The address of the service. Defaults to the node address.
id Changes to this property will trigger replacement. String
The ID of the service. Defaults to the name.
port Changes to this property will trigger replacement. Number
The port of the service.
tags Changes to this property will trigger replacement. List<String>
A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.

Package Details

Repository
HashiCorp Consul pulumi/pulumi-consul
License
Apache-2.0
Notes
This Pulumi package is based on the consul Terraform Provider.