ucloud.NatGatewayRule
Explore with Pulumi AI
Provides a Nat Gateway resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";
const fooVpc = new ucloud.Vpc("fooVpc", {
tag: "tf-acc",
cidrBlocks: ["192.168.0.0/16"],
});
const fooSubnet = new ucloud.Subnet("fooSubnet", {
tag: "tf-acc",
cidrBlock: "192.168.1.0/24",
vpcId: fooVpc.vpcId,
});
const fooEip = new ucloud.Eip("fooEip", {
bandwidth: 1,
internetType: "bgp",
chargeMode: "bandwidth",
tag: "tf-acc",
});
const fooSecurityGroups = ucloud.getSecurityGroups({
type: "recommend_web",
});
const defaultZones = ucloud.getZones({});
const defaultImages = defaultZones.then(defaultZones => ucloud.getImages({
availabilityZone: defaultZones.zones?.[0]?.id,
nameRegex: "^CentOS 7.[1-2] 64",
imageType: "base",
}));
const fooInstance = new ucloud.Instance("fooInstance", {
vpcId: fooVpc.vpcId,
subnetId: fooSubnet.subnetId,
availabilityZone: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
imageId: defaultImages.then(defaultImages => defaultImages.images?.[0]?.id),
instanceType: "n-basic-1",
chargeType: "dynamic",
tag: "tf-acc",
});
const fooNatGateway = new ucloud.NatGateway("fooNatGateway", {
vpcId: fooVpc.vpcId,
subnetIds: [fooSubnet.subnetId],
eipId: fooEip.eipId,
tag: "tf-acc",
enableWhiteList: false,
securityGroup: fooSecurityGroups.then(fooSecurityGroups => fooSecurityGroups.securityGroups?.[0]?.id),
});
const fooNatGatewayRule = new ucloud.NatGatewayRule("fooNatGatewayRule", {
natGatewayId: fooNatGateway.natGatewayId,
protocol: "tcp",
srcEipId: fooEip.eipId,
srcPortRange: "88",
dstIp: fooInstance.privateIp,
dstPortRange: "80",
});
const bar = new ucloud.NatGatewayRule("bar", {
natGatewayId: fooNatGateway.natGatewayId,
protocol: "tcp",
srcEipId: fooEip.eipId,
srcPortRange: "90-100",
dstIp: fooInstance.privateIp,
dstPortRange: "90-100",
});
import pulumi
import pulumi_ucloud as ucloud
foo_vpc = ucloud.Vpc("fooVpc",
tag="tf-acc",
cidr_blocks=["192.168.0.0/16"])
foo_subnet = ucloud.Subnet("fooSubnet",
tag="tf-acc",
cidr_block="192.168.1.0/24",
vpc_id=foo_vpc.vpc_id)
foo_eip = ucloud.Eip("fooEip",
bandwidth=1,
internet_type="bgp",
charge_mode="bandwidth",
tag="tf-acc")
foo_security_groups = ucloud.get_security_groups(type="recommend_web")
default_zones = ucloud.get_zones()
default_images = ucloud.get_images(availability_zone=default_zones.zones[0].id,
name_regex="^CentOS 7.[1-2] 64",
image_type="base")
foo_instance = ucloud.Instance("fooInstance",
vpc_id=foo_vpc.vpc_id,
subnet_id=foo_subnet.subnet_id,
availability_zone=default_zones.zones[0].id,
image_id=default_images.images[0].id,
instance_type="n-basic-1",
charge_type="dynamic",
tag="tf-acc")
foo_nat_gateway = ucloud.NatGateway("fooNatGateway",
vpc_id=foo_vpc.vpc_id,
subnet_ids=[foo_subnet.subnet_id],
eip_id=foo_eip.eip_id,
tag="tf-acc",
enable_white_list=False,
security_group=foo_security_groups.security_groups[0].id)
foo_nat_gateway_rule = ucloud.NatGatewayRule("fooNatGatewayRule",
nat_gateway_id=foo_nat_gateway.nat_gateway_id,
protocol="tcp",
src_eip_id=foo_eip.eip_id,
src_port_range="88",
dst_ip=foo_instance.private_ip,
dst_port_range="80")
bar = ucloud.NatGatewayRule("bar",
nat_gateway_id=foo_nat_gateway.nat_gateway_id,
protocol="tcp",
src_eip_id=foo_eip.eip_id,
src_port_range="90-100",
dst_ip=foo_instance.private_ip,
dst_port_range="90-100")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooVpc, err := ucloud.NewVpc(ctx, "fooVpc", &ucloud.VpcArgs{
Tag: pulumi.String("tf-acc"),
CidrBlocks: pulumi.StringArray{
pulumi.String("192.168.0.0/16"),
},
})
if err != nil {
return err
}
fooSubnet, err := ucloud.NewSubnet(ctx, "fooSubnet", &ucloud.SubnetArgs{
Tag: pulumi.String("tf-acc"),
CidrBlock: pulumi.String("192.168.1.0/24"),
VpcId: fooVpc.VpcId,
})
if err != nil {
return err
}
fooEip, err := ucloud.NewEip(ctx, "fooEip", &ucloud.EipArgs{
Bandwidth: pulumi.Float64(1),
InternetType: pulumi.String("bgp"),
ChargeMode: pulumi.String("bandwidth"),
Tag: pulumi.String("tf-acc"),
})
if err != nil {
return err
}
fooSecurityGroups, err := ucloud.GetSecurityGroups(ctx, &ucloud.GetSecurityGroupsArgs{
Type: pulumi.StringRef("recommend_web"),
}, nil)
if err != nil {
return err
}
defaultZones, err := ucloud.GetZones(ctx, &ucloud.GetZonesArgs{}, nil)
if err != nil {
return err
}
defaultImages, err := ucloud.GetImages(ctx, &ucloud.GetImagesArgs{
AvailabilityZone: pulumi.StringRef(defaultZones.Zones[0].Id),
NameRegex: pulumi.StringRef("^CentOS 7.[1-2] 64"),
ImageType: pulumi.StringRef("base"),
}, nil)
if err != nil {
return err
}
fooInstance, err := ucloud.NewInstance(ctx, "fooInstance", &ucloud.InstanceArgs{
VpcId: fooVpc.VpcId,
SubnetId: fooSubnet.SubnetId,
AvailabilityZone: pulumi.String(defaultZones.Zones[0].Id),
ImageId: pulumi.String(defaultImages.Images[0].Id),
InstanceType: pulumi.String("n-basic-1"),
ChargeType: pulumi.String("dynamic"),
Tag: pulumi.String("tf-acc"),
})
if err != nil {
return err
}
fooNatGateway, err := ucloud.NewNatGateway(ctx, "fooNatGateway", &ucloud.NatGatewayArgs{
VpcId: fooVpc.VpcId,
SubnetIds: pulumi.StringArray{
fooSubnet.SubnetId,
},
EipId: fooEip.EipId,
Tag: pulumi.String("tf-acc"),
EnableWhiteList: pulumi.Bool(false),
SecurityGroup: pulumi.String(fooSecurityGroups.SecurityGroups[0].Id),
})
if err != nil {
return err
}
_, err = ucloud.NewNatGatewayRule(ctx, "fooNatGatewayRule", &ucloud.NatGatewayRuleArgs{
NatGatewayId: fooNatGateway.NatGatewayId,
Protocol: pulumi.String("tcp"),
SrcEipId: fooEip.EipId,
SrcPortRange: pulumi.String("88"),
DstIp: fooInstance.PrivateIp,
DstPortRange: pulumi.String("80"),
})
if err != nil {
return err
}
_, err = ucloud.NewNatGatewayRule(ctx, "bar", &ucloud.NatGatewayRuleArgs{
NatGatewayId: fooNatGateway.NatGatewayId,
Protocol: pulumi.String("tcp"),
SrcEipId: fooEip.EipId,
SrcPortRange: pulumi.String("90-100"),
DstIp: fooInstance.PrivateIp,
DstPortRange: pulumi.String("90-100"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;
return await Deployment.RunAsync(() =>
{
var fooVpc = new Ucloud.Vpc("fooVpc", new()
{
Tag = "tf-acc",
CidrBlocks = new[]
{
"192.168.0.0/16",
},
});
var fooSubnet = new Ucloud.Subnet("fooSubnet", new()
{
Tag = "tf-acc",
CidrBlock = "192.168.1.0/24",
VpcId = fooVpc.VpcId,
});
var fooEip = new Ucloud.Eip("fooEip", new()
{
Bandwidth = 1,
InternetType = "bgp",
ChargeMode = "bandwidth",
Tag = "tf-acc",
});
var fooSecurityGroups = Ucloud.GetSecurityGroups.Invoke(new()
{
Type = "recommend_web",
});
var defaultZones = Ucloud.GetZones.Invoke();
var defaultImages = Ucloud.GetImages.Invoke(new()
{
AvailabilityZone = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
NameRegex = "^CentOS 7.[1-2] 64",
ImageType = "base",
});
var fooInstance = new Ucloud.Instance("fooInstance", new()
{
VpcId = fooVpc.VpcId,
SubnetId = fooSubnet.SubnetId,
AvailabilityZone = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
ImageId = defaultImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
InstanceType = "n-basic-1",
ChargeType = "dynamic",
Tag = "tf-acc",
});
var fooNatGateway = new Ucloud.NatGateway("fooNatGateway", new()
{
VpcId = fooVpc.VpcId,
SubnetIds = new[]
{
fooSubnet.SubnetId,
},
EipId = fooEip.EipId,
Tag = "tf-acc",
EnableWhiteList = false,
SecurityGroup = fooSecurityGroups.Apply(getSecurityGroupsResult => getSecurityGroupsResult.SecurityGroups[0]?.Id),
});
var fooNatGatewayRule = new Ucloud.NatGatewayRule("fooNatGatewayRule", new()
{
NatGatewayId = fooNatGateway.NatGatewayId,
Protocol = "tcp",
SrcEipId = fooEip.EipId,
SrcPortRange = "88",
DstIp = fooInstance.PrivateIp,
DstPortRange = "80",
});
var bar = new Ucloud.NatGatewayRule("bar", new()
{
NatGatewayId = fooNatGateway.NatGatewayId,
Protocol = "tcp",
SrcEipId = fooEip.EipId,
SrcPortRange = "90-100",
DstIp = fooInstance.PrivateIp,
DstPortRange = "90-100",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.Vpc;
import com.pulumi.ucloud.VpcArgs;
import com.pulumi.ucloud.Subnet;
import com.pulumi.ucloud.SubnetArgs;
import com.pulumi.ucloud.Eip;
import com.pulumi.ucloud.EipArgs;
import com.pulumi.ucloud.UcloudFunctions;
import com.pulumi.ucloud.inputs.GetSecurityGroupsArgs;
import com.pulumi.ucloud.inputs.GetZonesArgs;
import com.pulumi.ucloud.inputs.GetImagesArgs;
import com.pulumi.ucloud.Instance;
import com.pulumi.ucloud.InstanceArgs;
import com.pulumi.ucloud.NatGateway;
import com.pulumi.ucloud.NatGatewayArgs;
import com.pulumi.ucloud.NatGatewayRule;
import com.pulumi.ucloud.NatGatewayRuleArgs;
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) {
var fooVpc = new Vpc("fooVpc", VpcArgs.builder()
.tag("tf-acc")
.cidrBlocks("192.168.0.0/16")
.build());
var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()
.tag("tf-acc")
.cidrBlock("192.168.1.0/24")
.vpcId(fooVpc.vpcId())
.build());
var fooEip = new Eip("fooEip", EipArgs.builder()
.bandwidth(1)
.internetType("bgp")
.chargeMode("bandwidth")
.tag("tf-acc")
.build());
final var fooSecurityGroups = UcloudFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
.type("recommend_web")
.build());
final var defaultZones = UcloudFunctions.getZones();
final var defaultImages = UcloudFunctions.getImages(GetImagesArgs.builder()
.availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.nameRegex("^CentOS 7.[1-2] 64")
.imageType("base")
.build());
var fooInstance = new Instance("fooInstance", InstanceArgs.builder()
.vpcId(fooVpc.vpcId())
.subnetId(fooSubnet.subnetId())
.availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.instanceType("n-basic-1")
.chargeType("dynamic")
.tag("tf-acc")
.build());
var fooNatGateway = new NatGateway("fooNatGateway", NatGatewayArgs.builder()
.vpcId(fooVpc.vpcId())
.subnetIds(fooSubnet.subnetId())
.eipId(fooEip.eipId())
.tag("tf-acc")
.enableWhiteList(false)
.securityGroup(fooSecurityGroups.applyValue(getSecurityGroupsResult -> getSecurityGroupsResult.securityGroups()[0].id()))
.build());
var fooNatGatewayRule = new NatGatewayRule("fooNatGatewayRule", NatGatewayRuleArgs.builder()
.natGatewayId(fooNatGateway.natGatewayId())
.protocol("tcp")
.srcEipId(fooEip.eipId())
.srcPortRange("88")
.dstIp(fooInstance.privateIp())
.dstPortRange("80")
.build());
var bar = new NatGatewayRule("bar", NatGatewayRuleArgs.builder()
.natGatewayId(fooNatGateway.natGatewayId())
.protocol("tcp")
.srcEipId(fooEip.eipId())
.srcPortRange("90-100")
.dstIp(fooInstance.privateIp())
.dstPortRange("90-100")
.build());
}
}
resources:
fooVpc:
type: ucloud:Vpc
properties:
tag: tf-acc
cidrBlocks:
- 192.168.0.0/16
fooSubnet:
type: ucloud:Subnet
properties:
tag: tf-acc
cidrBlock: 192.168.1.0/24
vpcId: ${fooVpc.vpcId}
fooEip:
type: ucloud:Eip
properties:
bandwidth: 1
internetType: bgp
chargeMode: bandwidth
tag: tf-acc
fooInstance:
type: ucloud:Instance
properties:
vpcId: ${fooVpc.vpcId}
subnetId: ${fooSubnet.subnetId}
availabilityZone: ${defaultZones.zones[0].id}
imageId: ${defaultImages.images[0].id}
instanceType: n-basic-1
chargeType: dynamic
tag: tf-acc
fooNatGateway:
type: ucloud:NatGateway
properties:
vpcId: ${fooVpc.vpcId}
subnetIds:
- ${fooSubnet.subnetId}
eipId: ${fooEip.eipId}
tag: tf-acc
enableWhiteList: false
securityGroup: ${fooSecurityGroups.securityGroups[0].id}
fooNatGatewayRule:
type: ucloud:NatGatewayRule
properties:
natGatewayId: ${fooNatGateway.natGatewayId}
protocol: tcp
srcEipId: ${fooEip.eipId}
srcPortRange: '88'
dstIp: ${fooInstance.privateIp}
dstPortRange: '80'
bar:
type: ucloud:NatGatewayRule
properties:
natGatewayId: ${fooNatGateway.natGatewayId}
protocol: tcp
srcEipId: ${fooEip.eipId}
srcPortRange: 90-100
dstIp: ${fooInstance.privateIp}
dstPortRange: 90-100
variables:
fooSecurityGroups:
fn::invoke:
function: ucloud:getSecurityGroups
arguments:
type: recommend_web
defaultZones:
fn::invoke:
function: ucloud:getZones
arguments: {}
defaultImages:
fn::invoke:
function: ucloud:getImages
arguments:
availabilityZone: ${defaultZones.zones[0].id}
nameRegex: ^CentOS 7.[1-2] 64
imageType: base
Create NatGatewayRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NatGatewayRule(name: string, args: NatGatewayRuleArgs, opts?: CustomResourceOptions);
@overload
def NatGatewayRule(resource_name: str,
args: NatGatewayRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NatGatewayRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
dst_ip: Optional[str] = None,
dst_port_range: Optional[str] = None,
nat_gateway_id: Optional[str] = None,
protocol: Optional[str] = None,
src_eip_id: Optional[str] = None,
src_port_range: Optional[str] = None,
name: Optional[str] = None,
nat_gateway_rule_id: Optional[str] = None)
func NewNatGatewayRule(ctx *Context, name string, args NatGatewayRuleArgs, opts ...ResourceOption) (*NatGatewayRule, error)
public NatGatewayRule(string name, NatGatewayRuleArgs args, CustomResourceOptions? opts = null)
public NatGatewayRule(String name, NatGatewayRuleArgs args)
public NatGatewayRule(String name, NatGatewayRuleArgs args, CustomResourceOptions options)
type: ucloud:NatGatewayRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args NatGatewayRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NatGatewayRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NatGatewayRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NatGatewayRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NatGatewayRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var natGatewayRuleResource = new Ucloud.NatGatewayRule("natGatewayRuleResource", new()
{
DstIp = "string",
DstPortRange = "string",
NatGatewayId = "string",
Protocol = "string",
SrcEipId = "string",
SrcPortRange = "string",
Name = "string",
NatGatewayRuleId = "string",
});
example, err := ucloud.NewNatGatewayRule(ctx, "natGatewayRuleResource", &ucloud.NatGatewayRuleArgs{
DstIp: pulumi.String("string"),
DstPortRange: pulumi.String("string"),
NatGatewayId: pulumi.String("string"),
Protocol: pulumi.String("string"),
SrcEipId: pulumi.String("string"),
SrcPortRange: pulumi.String("string"),
Name: pulumi.String("string"),
NatGatewayRuleId: pulumi.String("string"),
})
var natGatewayRuleResource = new NatGatewayRule("natGatewayRuleResource", NatGatewayRuleArgs.builder()
.dstIp("string")
.dstPortRange("string")
.natGatewayId("string")
.protocol("string")
.srcEipId("string")
.srcPortRange("string")
.name("string")
.natGatewayRuleId("string")
.build());
nat_gateway_rule_resource = ucloud.NatGatewayRule("natGatewayRuleResource",
dst_ip="string",
dst_port_range="string",
nat_gateway_id="string",
protocol="string",
src_eip_id="string",
src_port_range="string",
name="string",
nat_gateway_rule_id="string")
const natGatewayRuleResource = new ucloud.NatGatewayRule("natGatewayRuleResource", {
dstIp: "string",
dstPortRange: "string",
natGatewayId: "string",
protocol: "string",
srcEipId: "string",
srcPortRange: "string",
name: "string",
natGatewayRuleId: "string",
});
type: ucloud:NatGatewayRule
properties:
dstIp: string
dstPortRange: string
name: string
natGatewayId: string
natGatewayRuleId: string
protocol: string
srcEipId: string
srcPortRange: string
NatGatewayRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The NatGatewayRule resource accepts the following input properties:
- Dst
Ip string - The private ip of instance bound to the jNAT gateway.
- Dst
Port stringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - Nat
Gateway stringId - The ID of the Nat Gateway.
- Protocol string
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - Src
Eip stringId - The ID of eip associate to the Nat Gateway.
- Src
Port stringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
). - Name string
- Nat
Gateway stringRule Id
- Dst
Ip string - The private ip of instance bound to the jNAT gateway.
- Dst
Port stringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - Nat
Gateway stringId - The ID of the Nat Gateway.
- Protocol string
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - Src
Eip stringId - The ID of eip associate to the Nat Gateway.
- Src
Port stringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
). - Name string
- Nat
Gateway stringRule Id
- dst
Ip String - The private ip of instance bound to the jNAT gateway.
- dst
Port StringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - nat
Gateway StringId - The ID of the Nat Gateway.
- protocol String
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - src
Eip StringId - The ID of eip associate to the Nat Gateway.
- src
Port StringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
). - name String
- nat
Gateway StringRule Id
- dst
Ip string - The private ip of instance bound to the jNAT gateway.
- dst
Port stringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - nat
Gateway stringId - The ID of the Nat Gateway.
- protocol string
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - src
Eip stringId - The ID of eip associate to the Nat Gateway.
- src
Port stringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
). - name string
- nat
Gateway stringRule Id
- dst_
ip str - The private ip of instance bound to the jNAT gateway.
- dst_
port_ strrange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - nat_
gateway_ strid - The ID of the Nat Gateway.
- protocol str
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - src_
eip_ strid - The ID of eip associate to the Nat Gateway.
- src_
port_ strrange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
). - name str
- nat_
gateway_ strrule_ id
- dst
Ip String - The private ip of instance bound to the jNAT gateway.
- dst
Port StringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - nat
Gateway StringId - The ID of the Nat Gateway.
- protocol String
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - src
Eip StringId - The ID of eip associate to the Nat Gateway.
- src
Port StringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
). - name String
- nat
Gateway StringRule Id
Outputs
All input properties are implicitly available as output properties. Additionally, the NatGatewayRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing NatGatewayRule Resource
Get an existing NatGatewayRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NatGatewayRuleState, opts?: CustomResourceOptions): NatGatewayRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dst_ip: Optional[str] = None,
dst_port_range: Optional[str] = None,
name: Optional[str] = None,
nat_gateway_id: Optional[str] = None,
nat_gateway_rule_id: Optional[str] = None,
protocol: Optional[str] = None,
src_eip_id: Optional[str] = None,
src_port_range: Optional[str] = None) -> NatGatewayRule
func GetNatGatewayRule(ctx *Context, name string, id IDInput, state *NatGatewayRuleState, opts ...ResourceOption) (*NatGatewayRule, error)
public static NatGatewayRule Get(string name, Input<string> id, NatGatewayRuleState? state, CustomResourceOptions? opts = null)
public static NatGatewayRule get(String name, Output<String> id, NatGatewayRuleState state, CustomResourceOptions options)
resources: _: type: ucloud:NatGatewayRule get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Dst
Ip string - The private ip of instance bound to the jNAT gateway.
- Dst
Port stringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - Name string
- Nat
Gateway stringId - The ID of the Nat Gateway.
- Nat
Gateway stringRule Id - Protocol string
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - Src
Eip stringId - The ID of eip associate to the Nat Gateway.
- Src
Port stringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
).
- Dst
Ip string - The private ip of instance bound to the jNAT gateway.
- Dst
Port stringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - Name string
- Nat
Gateway stringId - The ID of the Nat Gateway.
- Nat
Gateway stringRule Id - Protocol string
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - Src
Eip stringId - The ID of eip associate to the Nat Gateway.
- Src
Port stringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
).
- dst
Ip String - The private ip of instance bound to the jNAT gateway.
- dst
Port StringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - name String
- nat
Gateway StringId - The ID of the Nat Gateway.
- nat
Gateway StringRule Id - protocol String
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - src
Eip StringId - The ID of eip associate to the Nat Gateway.
- src
Port StringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
).
- dst
Ip string - The private ip of instance bound to the jNAT gateway.
- dst
Port stringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - name string
- nat
Gateway stringId - The ID of the Nat Gateway.
- nat
Gateway stringRule Id - protocol string
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - src
Eip stringId - The ID of eip associate to the Nat Gateway.
- src
Port stringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
).
- dst_
ip str - The private ip of instance bound to the jNAT gateway.
- dst_
port_ strrange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - name str
- nat_
gateway_ strid - The ID of the Nat Gateway.
- nat_
gateway_ strrule_ id - protocol str
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - src_
eip_ strid - The ID of eip associate to the Nat Gateway.
- src_
port_ strrange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
).
- dst
Ip String - The private ip of instance bound to the jNAT gateway.
- dst
Port StringRange - The range of port numbers of the private ip, range: 1-65535. (eg:
port
orport1-port2
). - name String
- nat
Gateway StringId - The ID of the Nat Gateway.
- nat
Gateway StringRule Id - protocol String
- The protocol of the Nat Gateway Rule. Possible values:
tcp
,udp
. - src
Eip StringId - The ID of eip associate to the Nat Gateway.
- src
Port StringRange - The range of port numbers of the eip, range: 1-65535. (eg:
port
orport1-port2
).
Package Details
- Repository
- ucloud ucloud/terraform-provider-ucloud
- License
- Notes
- This Pulumi package is based on the
ucloud
Terraform Provider.