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

consul.PeeringToken

Explore with Pulumi AI

consul logo
Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi

    Cluster Peering can be used to create connections between two or more independent clusters so that services deployed to different partitions or datacenters can communicate.

    The cluster_peering_token resource can be used to generate a peering token that can later be used to establish a peering connection.

    Cluster peering is currently in technical preview: Functionality associated with cluster peering is subject to change. You should never use the technical preview release in secure environments or production scenarios. Features in technical preview may have performance issues, scaling issues, and limited support.

    The functionality described here is available only in Consul version 1.13.0 and later.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as consul from "@pulumi/consul";
    
    const token = new consul.PeeringToken("token", {peerName: "eu-cluster"});
    
    import pulumi
    import pulumi_consul as consul
    
    token = consul.PeeringToken("token", peer_name="eu-cluster")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := consul.NewPeeringToken(ctx, "token", &consul.PeeringTokenArgs{
    			PeerName: pulumi.String("eu-cluster"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Consul = Pulumi.Consul;
    
    return await Deployment.RunAsync(() => 
    {
        var token = new Consul.PeeringToken("token", new()
        {
            PeerName = "eu-cluster",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.consul.PeeringToken;
    import com.pulumi.consul.PeeringTokenArgs;
    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 token = new PeeringToken("token", PeeringTokenArgs.builder()
                .peerName("eu-cluster")
                .build());
    
        }
    }
    
    resources:
      token:
        type: consul:PeeringToken
        properties:
          peerName: eu-cluster
    

    Create PeeringToken Resource

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

    Constructor syntax

    new PeeringToken(name: string, args: PeeringTokenArgs, opts?: CustomResourceOptions);
    @overload
    def PeeringToken(resource_name: str,
                     args: PeeringTokenArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def PeeringToken(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     peer_name: Optional[str] = None,
                     meta: Optional[Mapping[str, str]] = None,
                     partition: Optional[str] = None)
    func NewPeeringToken(ctx *Context, name string, args PeeringTokenArgs, opts ...ResourceOption) (*PeeringToken, error)
    public PeeringToken(string name, PeeringTokenArgs args, CustomResourceOptions? opts = null)
    public PeeringToken(String name, PeeringTokenArgs args)
    public PeeringToken(String name, PeeringTokenArgs args, CustomResourceOptions options)
    
    type: consul:PeeringToken
    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 PeeringTokenArgs
    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 PeeringTokenArgs
    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 PeeringTokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PeeringTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PeeringTokenArgs
    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 peeringTokenResource = new Consul.PeeringToken("peeringTokenResource", new()
    {
        PeerName = "string",
        Meta = 
        {
            { "string", "string" },
        },
        Partition = "string",
    });
    
    example, err := consul.NewPeeringToken(ctx, "peeringTokenResource", &consul.PeeringTokenArgs{
    	PeerName: pulumi.String("string"),
    	Meta: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Partition: pulumi.String("string"),
    })
    
    var peeringTokenResource = new PeeringToken("peeringTokenResource", PeeringTokenArgs.builder()
        .peerName("string")
        .meta(Map.of("string", "string"))
        .partition("string")
        .build());
    
    peering_token_resource = consul.PeeringToken("peeringTokenResource",
        peer_name="string",
        meta={
            "string": "string",
        },
        partition="string")
    
    const peeringTokenResource = new consul.PeeringToken("peeringTokenResource", {
        peerName: "string",
        meta: {
            string: "string",
        },
        partition: "string",
    });
    
    type: consul:PeeringToken
    properties:
        meta:
            string: string
        partition: string
        peerName: string
    

    PeeringToken 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 PeeringToken resource accepts the following input properties:

    PeerName string
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    Meta Dictionary<string, string>
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    Partition string
    PeerName string
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    Meta map[string]string
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    Partition string
    peerName String
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    meta Map<String,String>
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    partition String
    peerName string
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    meta {[key: string]: string}
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    partition string
    peer_name str
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    meta Mapping[str, str]
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    partition str
    peerName String
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    meta Map<String>
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    partition String

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    The generated peering token
    Id string
    The provider-assigned unique ID for this managed resource.
    PeeringToken string
    The generated peering token
    id String
    The provider-assigned unique ID for this managed resource.
    peeringToken String
    The generated peering token
    id string
    The provider-assigned unique ID for this managed resource.
    peeringToken string
    The generated peering token
    id str
    The provider-assigned unique ID for this managed resource.
    peering_token str
    The generated peering token
    id String
    The provider-assigned unique ID for this managed resource.
    peeringToken String
    The generated peering token

    Look up Existing PeeringToken Resource

    Get an existing PeeringToken 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?: PeeringTokenState, opts?: CustomResourceOptions): PeeringToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            meta: Optional[Mapping[str, str]] = None,
            partition: Optional[str] = None,
            peer_name: Optional[str] = None,
            peering_token: Optional[str] = None) -> PeeringToken
    func GetPeeringToken(ctx *Context, name string, id IDInput, state *PeeringTokenState, opts ...ResourceOption) (*PeeringToken, error)
    public static PeeringToken Get(string name, Input<string> id, PeeringTokenState? state, CustomResourceOptions? opts = null)
    public static PeeringToken get(String name, Output<String> id, PeeringTokenState 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:
    Meta Dictionary<string, string>
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    Partition string
    PeerName string
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    Token string
    The generated peering token
    Meta map[string]string
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    Partition string
    PeerName string
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    PeeringToken string
    The generated peering token
    meta Map<String,String>
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    partition String
    peerName String
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    peeringToken String
    The generated peering token
    meta {[key: string]: string}
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    partition string
    peerName string
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    peeringToken string
    The generated peering token
    meta Mapping[str, str]
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    partition str
    peer_name str
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    peering_token str
    The generated peering token
    meta Map<String>
    Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.
    partition String
    peerName String
    The name assigned to the peer cluster. The peer_name is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions. This field must be a valid DNS hostname label.
    peeringToken String
    The generated peering token

    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