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:
- Forward
Table stringId The ID of the Forward table.
- External
Ip string The public IP address.
- Ids List<string>
A list of Forward Entries IDs.
- Internal
Ip string The private IP address.
- Name
Regex string A regex string to filter results by forward entry name.
- Names List<string>
A list of Forward Entries names.
- Output
File string
- Forward
Table stringId The ID of the Forward table.
- External
Ip string The public IP address.
- Ids []string
A list of Forward Entries IDs.
- Internal
Ip string The private IP address.
- Name
Regex string A regex string to filter results by forward entry name.
- Names []string
A list of Forward Entries names.
- Output
File string
- forward
Table stringId The ID of the Forward table.
- external
Ip string The public IP address.
- ids string[]
A list of Forward Entries IDs.
- internal
Ip string The private IP address.
- name
Regex string A regex string to filter results by forward entry name.
- names string[]
A list of Forward Entries names.
- output
File string
- forward_
table_ strid 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.
Ali Cloud. Vpc. Outputs. Get Forward Entries Entry> A list of Forward Entries. Each element contains the following attributes:
- Forward
Table stringId - Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of Forward Entries IDs.
- External
Ip string The public IP address.
- Internal
Ip string The private IP address.
- Name
Regex string - Names List<string>
A list of Forward Entries names.
- Output
File string
- Entries
[]Get
Forward Entries Entry A list of Forward Entries. Each element contains the following attributes:
- Forward
Table stringId - Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of Forward Entries IDs.
- External
Ip string The public IP address.
- Internal
Ip string The private IP address.
- Name
Regex string - Names []string
A list of Forward Entries names.
- Output
File string
- entries
Get
Forward Entries Entry[] A list of Forward Entries. Each element contains the following attributes:
- forward
Table stringId - id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of Forward Entries IDs.
- external
Ip string The public IP address.
- internal
Ip string The private IP address.
- name
Regex string - names string[]
A list of Forward Entries names.
- output
File string
- entries
List[Get
Forward Entries Entry] A list of Forward Entries. Each element contains the following attributes:
- forward_
table_ strid - 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.
- External
Ip string The public IP address.
- External
Port string The public port.
- Id string
The ID of the Forward Entry.
- Internal
Ip string The private IP address.
- Internal
Port string The private port.
- Ip
Protocol string The protocol type.
- Name string
The forward entry name.
- Status string
The status of the Forward Entry.
- External
Ip string The public IP address.
- External
Port string The public port.
- Id string
The ID of the Forward Entry.
- Internal
Ip string The private IP address.
- Internal
Port string The private port.
- Ip
Protocol string The protocol type.
- Name string
The forward entry name.
- Status string
The status of the Forward Entry.
- external
Ip string The public IP address.
- external
Port string The public port.
- id string
The ID of the Forward Entry.
- internal
Ip string The private IP address.
- internal
Port string The private port.
- ip
Protocol 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
alicloudTerraform Provider.