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; }
}
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);Using GetNetworkSegments
function getNetworkSegments(args: GetNetworkSegmentsArgs, opts?: InvokeOptions): Promise<GetNetworkSegmentsResult>function get_network_segments(datacenter=None, token=None, opts=None)func GetNetworkSegments(ctx *Context, args *GetNetworkSegmentsArgs, opts ...InvokeOption) (*GetNetworkSegmentsResult, error)public static class GetNetworkSegments {
public static Task<GetNetworkSegmentsResult> InvokeAsync(GetNetworkSegmentsArgs args, InvokeOptions? opts = null)
}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 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.
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
Package Details
- Repository
- https://github.com/pulumi/pulumi-consul
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
consulTerraform Provider.