getIpv6Gateways

This data source provides the Vpc Ipv6 Gateways of the current Alibaba Cloud user.

NOTE: Available in v1.142.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.vpc.getIpv6Gateways({
ids: ["example_id"],
});
export const vpcIpv6GatewayId1 = ids.then(ids => ids.gateways?.[0]?.id);
const nameRegex = alicloud.vpc.getIpv6Gateways({
nameRegex: "^my-Ipv6Gateway",
});
export const vpcIpv6GatewayId2 = nameRegex.then(nameRegex => nameRegex.gateways?.[0]?.id);
const vpcId = alicloud.vpc.getIpv6Gateways({
ids: ["example_id"],
vpcId: "example_value",
});
export const vpcIpv6GatewayId3 = vpcId.then(vpcId => vpcId.gateways?.[0]?.id);
const status = alicloud.vpc.getIpv6Gateways({
ids: ["example_id"],
status: "Available",
});
export const vpcIpv6GatewayId4 = status.then(status => status.gateways?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.vpc.get_ipv6_gateways(ids=["example_id"])
pulumi.export("vpcIpv6GatewayId1", ids.gateways[0].id)
name_regex = alicloud.vpc.get_ipv6_gateways(name_regex="^my-Ipv6Gateway")
pulumi.export("vpcIpv6GatewayId2", name_regex.gateways[0].id)
vpc_id = alicloud.vpc.get_ipv6_gateways(ids=["example_id"],
vpc_id="example_value")
pulumi.export("vpcIpv6GatewayId3", vpc_id.gateways[0].id)
status = alicloud.vpc.get_ipv6_gateways(ids=["example_id"],
status="Available")
pulumi.export("vpcIpv6GatewayId4", status.gateways[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Vpc.GetIpv6Gateways.Invoke(new()
{
Ids = new[]
{
"example_id",
},
});
var nameRegex = AliCloud.Vpc.GetIpv6Gateways.Invoke(new()
{
NameRegex = "^my-Ipv6Gateway",
});
var vpcId = AliCloud.Vpc.GetIpv6Gateways.Invoke(new()
{
Ids = new[]
{
"example_id",
},
VpcId = "example_value",
});
var status = AliCloud.Vpc.GetIpv6Gateways.Invoke(new()
{
Ids = new[]
{
"example_id",
},
Status = "Available",
});
return new Dictionary<string, object?>
{
["vpcIpv6GatewayId1"] = ids&#46;Apply(getIpv6GatewaysResult => getIpv6GatewaysResult&#46;Gateways[0]?.Id),
["vpcIpv6GatewayId2"] = nameRegex&#46;Apply(getIpv6GatewaysResult => getIpv6GatewaysResult&#46;Gateways[0]?.Id),
["vpcIpv6GatewayId3"] = vpcId&#46;Apply(getIpv6GatewaysResult => getIpv6GatewaysResult&#46;Gateways[0]?.Id),
["vpcIpv6GatewayId4"] = status&#46;Apply(getIpv6GatewaysResult => getIpv6GatewaysResult&#46;Gateways[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := vpc.GetIpv6Gateways(ctx, &vpc.GetIpv6GatewaysArgs{
Ids: []string{
"example_id",
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpcIpv6GatewayId1", ids.Gateways[0].Id)
nameRegex, err := vpc.GetIpv6Gateways(ctx, &vpc.GetIpv6GatewaysArgs{
NameRegex: pulumi.StringRef("^my-Ipv6Gateway"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcIpv6GatewayId2", nameRegex.Gateways[0].Id)
vpcId, err := vpc.GetIpv6Gateways(ctx, &vpc.GetIpv6GatewaysArgs{
Ids: []string{
"example_id",
},
VpcId: pulumi.StringRef("example_value"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcIpv6GatewayId3", vpcId.Gateways[0].Id)
status, err := vpc.GetIpv6Gateways(ctx, &vpc.GetIpv6GatewaysArgs{
Ids: []string{
"example_id",
},
Status: pulumi.StringRef("Available"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcIpv6GatewayId4", status.Gateways[0].Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetIpv6GatewaysArgs;
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) {
final var ids = VpcFunctions.getIpv6Gateways(GetIpv6GatewaysArgs.builder()
.ids("example_id")
.build());
ctx.export("vpcIpv6GatewayId1", ids.applyValue(getIpv6GatewaysResult -> getIpv6GatewaysResult.gateways()[0].id()));
final var nameRegex = VpcFunctions.getIpv6Gateways(GetIpv6GatewaysArgs.builder()
.nameRegex("^my-Ipv6Gateway")
.build());
ctx.export("vpcIpv6GatewayId2", nameRegex.applyValue(getIpv6GatewaysResult -> getIpv6GatewaysResult.gateways()[0].id()));
final var vpcId = VpcFunctions.getIpv6Gateways(GetIpv6GatewaysArgs.builder()
.ids("example_id")
.vpcId("example_value")
.build());
ctx.export("vpcIpv6GatewayId3", vpcId.applyValue(getIpv6GatewaysResult -> getIpv6GatewaysResult.gateways()[0].id()));
final var status = VpcFunctions.getIpv6Gateways(GetIpv6GatewaysArgs.builder()
.ids("example_id")
.status("Available")
.build());
ctx.export("vpcIpv6GatewayId4", status.applyValue(getIpv6GatewaysResult -> getIpv6GatewaysResult.gateways()[0].id()));
}
}
variables:
ids:
fn::invoke:
function: alicloud:vpc:getIpv6Gateways
arguments:
ids:
- example_id
nameRegex:
fn::invoke:
function: alicloud:vpc:getIpv6Gateways
arguments:
nameRegex: ^my-Ipv6Gateway
vpcId:
fn::invoke:
function: alicloud:vpc:getIpv6Gateways
arguments:
ids:
- example_id
vpcId: example_value
status:
fn::invoke:
function: alicloud:vpc:getIpv6Gateways
arguments:
ids:
- example_id
status: Available
outputs:
vpcIpv6GatewayId1: ${ids.gateways[0].id}
vpcIpv6GatewayId2: ${nameRegex.gateways[0].id}
vpcIpv6GatewayId3: ${vpcId.gateways[0].id}
vpcIpv6GatewayId4: ${status.gateways[0].id}

Return

A collection of values returned by getIpv6Gateways.

Parameters

argument

A collection of arguments for invoking getIpv6Gateways.


suspend fun getIpv6Gateways(ids: List<String>? = null, ipv6GatewayName: String? = null, nameRegex: String? = null, outputFile: String? = null, status: String? = null, vpcId: String? = null): GetIpv6GatewaysResult

Return

A collection of values returned by getIpv6Gateways.

Parameters

ids

A list of Ipv6 Gateway IDs.

ipv6GatewayName

The name of the IPv6 gateway.

nameRegex

A regex string to filter results by Ipv6 Gateway name.

outputFile

File name where to save data source results (after running pulumi preview).

status

The status of the resource. Valid values: Available, Deleting, Pending.

vpcId

The ID of the virtual private cloud (VPC) to which the IPv6 gateway belongs.

See also


Return

A collection of values returned by getIpv6Gateways.

Parameters

argument

Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetIpv6GatewaysPlainArgs.

See also