GetForwardEntries

This data source provides a list of Forward Entries owned by an Alibaba Cloud account.

NOTE: Available in 1.37.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "forward-entry-config-example-name";
        var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
        {
            AvailableResourceCreation = "VSwitch",
        }));
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
        {
            CidrBlock = "172.16.0.0/12",
        });
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
        {
            AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
            CidrBlock = "172.16.0.0/21",
            VpcId = defaultNetwork.Id,
        });
        var defaultNatGateway = new AliCloud.Vpc.NatGateway("defaultNatGateway", new AliCloud.Vpc.NatGatewayArgs
        {
            Specification = "Small",
            VpcId = defaultNetwork.Id,
        });
        var defaultEip = new AliCloud.Ecs.Eip("defaultEip", new AliCloud.Ecs.EipArgs
        {
        });
        var defaultEipAssociation = new AliCloud.Ecs.EipAssociation("defaultEipAssociation", new AliCloud.Ecs.EipAssociationArgs
        {
            AllocationId = defaultEip.Id,
            InstanceId = defaultNatGateway.Id,
        });
        var defaultForwardEntry = new AliCloud.Vpc.ForwardEntry("defaultForwardEntry", new AliCloud.Vpc.ForwardEntryArgs
        {
            ExternalIp = defaultEip.IpAddress,
            ExternalPort = "80",
            ForwardTableId = defaultNatGateway.ForwardTableIds,
            InternalIp = "172.16.0.3",
            InternalPort = "8080",
            IpProtocol = "tcp",
        });
        var defaultForwardEntries = defaultForwardEntry.ForwardTableId.Apply(forwardTableId => AliCloud.Vpc.GetForwardEntries.InvokeAsync(new AliCloud.Vpc.GetForwardEntriesArgs
        {
            ForwardTableId = forwardTableId,
        }));
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "forward-entry-config-example-name"
default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/12")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/21",
    vpc_id=default_network.id)
default_nat_gateway = alicloud.vpc.NatGateway("defaultNatGateway",
    specification="Small",
    vpc_id=default_network.id)
default_eip = alicloud.ecs.Eip("defaultEip")
default_eip_association = alicloud.ecs.EipAssociation("defaultEipAssociation",
    allocation_id=default_eip.id,
    instance_id=default_nat_gateway.id)
default_forward_entry = alicloud.vpc.ForwardEntry("defaultForwardEntry",
    external_ip=default_eip.ip_address,
    external_port="80",
    forward_table_id=default_nat_gateway.forward_table_ids,
    internal_ip="172.16.0.3",
    internal_port="8080",
    ip_protocol="tcp")
default_forward_entries = default_forward_entry.forward_table_id.apply(lambda forward_table_id: alicloud.vpc.get_forward_entries(forward_table_id=forward_table_id))
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "forward-entry-config-example-name";

const defaultZones = pulumi.output(alicloud.getZones({
    availableResourceCreation: "VSwitch",
}, { async: true }));
const defaultNetwork = new alicloud.vpc.Network("default", {
    cidrBlock: "172.16.0.0/12",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    availabilityZone: defaultZones.zones[0].id,
    cidrBlock: "172.16.0.0/21",
    vpcId: defaultNetwork.id,
});
const defaultNatGateway = new alicloud.vpc.NatGateway("default", {
    specification: "Small",
    vpcId: defaultNetwork.id,
});
const defaultEip = new alicloud.ecs.Eip("default", {});
const defaultEipAssociation = new alicloud.ecs.EipAssociation("default", {
    allocationId: defaultEip.id,
    instanceId: defaultNatGateway.id,
});
const defaultForwardEntry = new alicloud.vpc.ForwardEntry("default", {
    externalIp: defaultEip.ipAddress,
    externalPort: "80",
    forwardTableId: defaultNatGateway.forwardTableIds,
    internalIp: "172.16.0.3",
    internalPort: "8080",
    ipProtocol: "tcp",
});
const defaultForwardEntries = defaultForwardEntry.forwardTableId.apply(forwardTableId => alicloud.vpc.getForwardEntries({
    forwardTableId: forwardTableId,
}, { async: true }));

Using GetForwardEntries

function getForwardEntries(args: GetForwardEntriesArgs, opts?: InvokeOptions): Promise<GetForwardEntriesResult>
function  get_forward_entries(external_ip=None, forward_table_id=None, ids=None, internal_ip=None, name_regex=None, names=None, output_file=None, opts=None)
func GetForwardEntries(ctx *Context, args *GetForwardEntriesArgs, opts ...InvokeOption) (*GetForwardEntriesResult, error)
public static class GetForwardEntries {
    public static Task<GetForwardEntriesResult> InvokeAsync(GetForwardEntriesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

ForwardTableId string

The ID of the Forward table.

ExternalIp string

The public IP address.

Ids List<string>

A list of Forward Entries IDs.

InternalIp string

The private IP address.

NameRegex string

A regex string to filter results by forward entry name.

Names List<string>

A list of Forward Entries names.

OutputFile string
ForwardTableId string

The ID of the Forward table.

ExternalIp string

The public IP address.

Ids []string

A list of Forward Entries IDs.

InternalIp string

The private IP address.

NameRegex string

A regex string to filter results by forward entry name.

Names []string

A list of Forward Entries names.

OutputFile string
forwardTableId string

The ID of the Forward table.

externalIp string

The public IP address.

ids string[]

A list of Forward Entries IDs.

internalIp string

The private IP address.

nameRegex string

A regex string to filter results by forward entry name.

names string[]

A list of Forward Entries names.

outputFile string
forward_table_id str

The ID of the Forward table.

external_ip str

The public IP address.

ids List[str]

A list of Forward Entries IDs.

internal_ip str

The private IP address.

name_regex str

A regex string to filter results by forward entry name.

names List[str]

A list of Forward Entries names.

output_file str

GetForwardEntries Result

The following output properties are available:

Entries List<Pulumi.AliCloud.Vpc.Outputs.GetForwardEntriesEntry>

A list of Forward Entries. Each element contains the following attributes:

ForwardTableId string
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of Forward Entries IDs.

ExternalIp string

The public IP address.

InternalIp string

The private IP address.

NameRegex string
Names List<string>

A list of Forward Entries names.

OutputFile string
Entries []GetForwardEntriesEntry

A list of Forward Entries. Each element contains the following attributes:

ForwardTableId string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of Forward Entries IDs.

ExternalIp string

The public IP address.

InternalIp string

The private IP address.

NameRegex string
Names []string

A list of Forward Entries names.

OutputFile string
entries GetForwardEntriesEntry[]

A list of Forward Entries. Each element contains the following attributes:

forwardTableId string
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of Forward Entries IDs.

externalIp string

The public IP address.

internalIp string

The private IP address.

nameRegex string
names string[]

A list of Forward Entries names.

outputFile string
entries List[GetForwardEntriesEntry]

A list of Forward Entries. Each element contains the following attributes:

forward_table_id str
id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of Forward Entries IDs.

external_ip str

The public IP address.

internal_ip str

The private IP address.

name_regex str
names List[str]

A list of Forward Entries names.

output_file str

Supporting Types

GetForwardEntriesEntry

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

ExternalIp string

The public IP address.

ExternalPort string

The public port.

Id string

The ID of the Forward Entry.

InternalIp string

The private IP address.

InternalPort string

The private port.

IpProtocol string

The protocol type.

Name string

The forward entry name.

Status string

The status of the Forward Entry.

ExternalIp string

The public IP address.

ExternalPort string

The public port.

Id string

The ID of the Forward Entry.

InternalIp string

The private IP address.

InternalPort string

The private port.

IpProtocol string

The protocol type.

Name string

The forward entry name.

Status string

The status of the Forward Entry.

externalIp string

The public IP address.

externalPort string

The public port.

id string

The ID of the Forward Entry.

internalIp string

The private IP address.

internalPort string

The private port.

ipProtocol string

The protocol type.

name string

The forward entry name.

status string

The status of the Forward Entry.

external_ip str

The public IP address.

external_port str

The public port.

id str

The ID of the Forward Entry.

internal_ip str

The private IP address.

internal_port str

The private port.

ip_protocol str

The protocol type.

name str

The forward entry name.

status str

The status of the Forward Entry.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.