HashiCorp Consul

Pulumi Official
Package maintained by Pulumi
v3.6.0 published on Tuesday, Apr 12, 2022 by Pulumi

getNetworkSegments

NOTE: This feature requires Consul Enterprise.

The consul_network_segment data source can be used to retrieve the network segments defined in the configuration.

Example Usage

using Pulumi;
using Consul = Pulumi.Consul;

class MyStack : Stack
{
    public MyStack()
    {
        var segmentsNetworkSegments = Output.Create(Consul.GetNetworkSegments.InvokeAsync());
        this.Segments = segmentsNetworkSegments.Apply(segmentsNetworkSegments => segmentsNetworkSegments.Segments);
    }

    [Output("segments")]
    public Output<string> Segments { get; set; }
}
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 {
		segmentsNetworkSegments, err := consul.GetNetworkSegments(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("segments", segmentsNetworkSegments.Segments)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_consul as consul

segments_network_segments = consul.get_network_segments()
pulumi.export("segments", segments_network_segments.segments)
import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const segmentsNetworkSegments = consul.getNetworkSegments({});
export const segments = segmentsNetworkSegments.then(segmentsNetworkSegments => segmentsNetworkSegments.segments);

Coming soon!

Using getNetworkSegments

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getNetworkSegments(args: GetNetworkSegmentsArgs, opts?: InvokeOptions): Promise<GetNetworkSegmentsResult>
function getNetworkSegmentsOutput(args: GetNetworkSegmentsOutputArgs, opts?: InvokeOptions): Output<GetNetworkSegmentsResult>
def get_network_segments(datacenter: Optional[str] = None,
                         token: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetNetworkSegmentsResult
def get_network_segments_output(datacenter: Optional[pulumi.Input[str]] = None,
                         token: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetNetworkSegmentsResult]
func GetNetworkSegments(ctx *Context, args *GetNetworkSegmentsArgs, opts ...InvokeOption) (*GetNetworkSegmentsResult, error)
func GetNetworkSegmentsOutput(ctx *Context, args *GetNetworkSegmentsOutputArgs, opts ...InvokeOption) GetNetworkSegmentsResultOutput

> Note: This function is named GetNetworkSegments in the Go SDK.

public static class GetNetworkSegments 
{
    public static Task<GetNetworkSegmentsResult> InvokeAsync(GetNetworkSegmentsArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkSegmentsResult> Invoke(GetNetworkSegmentsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNetworkSegmentsResult> getNetworkSegments(GetNetworkSegmentsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: consul:index/getNetworkSegments:getNetworkSegments
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Datacenter string

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

Token string

The ACL token to use. This overrides the token that the agent provides by default.

Datacenter string

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

Token string

The ACL token to use. This overrides the token that the agent provides by default.

datacenter String

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

token String

The ACL token to use. This overrides the token that the agent provides by default.

datacenter string

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

token string

The ACL token to use. This overrides the token that the agent provides by default.

datacenter str

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

token str

The ACL token to use. This overrides the token that the agent provides by default.

datacenter String

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

token String

The ACL token to use. This overrides the token that the agent provides by default.

getNetworkSegments Result

The following output properties are available:

Datacenter string

The datacenter the segments are being read from.

Id string

The provider-assigned unique ID for this managed resource.

Segments List<string>

The list of network segments.

Token string
Datacenter string

The datacenter the segments are being read from.

Id string

The provider-assigned unique ID for this managed resource.

Segments []string

The list of network segments.

Token string
datacenter String

The datacenter the segments are being read from.

id String

The provider-assigned unique ID for this managed resource.

segments List<String>

The list of network segments.

token String
datacenter string

The datacenter the segments are being read from.

id string

The provider-assigned unique ID for this managed resource.

segments string[]

The list of network segments.

token string
datacenter str

The datacenter the segments are being read from.

id str

The provider-assigned unique ID for this managed resource.

segments Sequence[str]

The list of network segments.

token str
datacenter String

The datacenter the segments are being read from.

id String

The provider-assigned unique ID for this managed resource.

segments List<String>

The list of network segments.

token String

Package Details

Repository
https://github.com/pulumi/pulumi-consul
License
Apache-2.0
Notes

This Pulumi package is based on the consul Terraform Provider.