从私网NAT网关所属子网分配,用于IP地址转换。
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bytepluscc from "@byteplus/pulumi-bytepluscc";
const natGatewayNatIpDemo = new bytepluscc.natgateway.NatIp("NatGatewayNatIpDemo", {
natGatewayId: "ngw-2hgk22kpfp5a874wjohxxxxx",
natIpDescription: "NatGatewayNatIpDemo description",
natIpName: "NatGatewayNatIpDemo",
natIp: "192.168.xxx.xx",
});
import pulumi
import pulumi_bytepluscc as bytepluscc
nat_gateway_nat_ip_demo = bytepluscc.natgateway.NatIp("NatGatewayNatIpDemo",
nat_gateway_id="ngw-2hgk22kpfp5a874wjohxxxxx",
nat_ip_description="NatGatewayNatIpDemo description",
nat_ip_name="NatGatewayNatIpDemo",
nat_ip="192.168.xxx.xx")
package main
import (
"github.com/byteplus-sdk/pulumi-bytepluscc/sdk/go/bytepluscc/natgateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := natgateway.NewNatIp(ctx, "NatGatewayNatIpDemo", &natgateway.NatIpArgs{
NatGatewayId: pulumi.String("ngw-2hgk22kpfp5a874wjohxxxxx"),
NatIpDescription: pulumi.String("NatGatewayNatIpDemo description"),
NatIpName: pulumi.String("NatGatewayNatIpDemo"),
NatIp: pulumi.String("192.168.xxx.xx"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bytepluscc = Byteplus.Pulumi.Bytepluscc;
return await Deployment.RunAsync(() =>
{
var natGatewayNatIpDemo = new Bytepluscc.Natgateway.NatIp("NatGatewayNatIpDemo", new()
{
NatGatewayId = "ngw-2hgk22kpfp5a874wjohxxxxx",
NatIpDescription = "NatGatewayNatIpDemo description",
NatIpName = "NatGatewayNatIpDemo",
NatIpValue = "192.168.xxx.xx",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.byteplus.bytepluscc.natgateway.NatIp;
import com.byteplus.bytepluscc.natgateway.NatIpArgs;
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 natGatewayNatIpDemo = new NatIp("natGatewayNatIpDemo", NatIpArgs.builder()
.natGatewayId("ngw-2hgk22kpfp5a874wjohxxxxx")
.natIpDescription("NatGatewayNatIpDemo description")
.natIpName("NatGatewayNatIpDemo")
.natIp("192.168.xxx.xx")
.build());
}
}
resources:
natGatewayNatIpDemo:
type: bytepluscc:natgateway:NatIp
name: NatGatewayNatIpDemo
properties:
natGatewayId: ngw-2hgk22kpfp5a874wjohxxxxx
natIpDescription: NatGatewayNatIpDemo description
natIpName: NatGatewayNatIpDemo
natIp: 192.168.xxx.xx
Create NatIp Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NatIp(name: string, args: NatIpArgs, opts?: CustomResourceOptions);@overload
def NatIp(resource_name: str,
args: NatIpArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NatIp(resource_name: str,
opts: Optional[ResourceOptions] = None,
nat_gateway_id: Optional[str] = None,
nat_ip: Optional[str] = None,
nat_ip_description: Optional[str] = None,
nat_ip_name: Optional[str] = None)func NewNatIp(ctx *Context, name string, args NatIpArgs, opts ...ResourceOption) (*NatIp, error)public NatIp(string name, NatIpArgs args, CustomResourceOptions? opts = null)type: bytepluscc:natgateway:NatIp
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 NatIpArgs
- 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 NatIpArgs
- 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 NatIpArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NatIpArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NatIpArgs
- 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 natIpResource = new Bytepluscc.Natgateway.NatIp("natIpResource", new()
{
NatGatewayId = "string",
NatIpValue = "string",
NatIpDescription = "string",
NatIpName = "string",
});
example, err := natgateway.NewNatIp(ctx, "natIpResource", &natgateway.NatIpArgs{
NatGatewayId: pulumi.String("string"),
NatIp: pulumi.String("string"),
NatIpDescription: pulumi.String("string"),
NatIpName: pulumi.String("string"),
})
var natIpResource = new NatIp("natIpResource", NatIpArgs.builder()
.natGatewayId("string")
.natIp("string")
.natIpDescription("string")
.natIpName("string")
.build());
nat_ip_resource = bytepluscc.natgateway.NatIp("natIpResource",
nat_gateway_id="string",
nat_ip="string",
nat_ip_description="string",
nat_ip_name="string")
const natIpResource = new bytepluscc.natgateway.NatIp("natIpResource", {
natGatewayId: "string",
natIp: "string",
natIpDescription: "string",
natIpName: "string",
});
type: bytepluscc:natgateway:NatIp
properties:
natGatewayId: string
natIp: string
natIpDescription: string
natIpName: string
NatIp 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 NatIp resource accepts the following input properties:
- Nat
Gateway stringId - 私网NAT网关ID。
- Nat
Ip stringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- Nat
Ip stringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- Nat
Ip stringValue - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- Nat
Gateway stringId - 私网NAT网关ID。
- Nat
Ip string - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- Nat
Ip stringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- Nat
Ip stringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- nat
Gateway StringId - 私网NAT网关ID。
- nat
Ip String - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- nat
Ip StringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- nat
Ip StringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- nat
Gateway stringId - 私网NAT网关ID。
- nat
Ip string - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- nat
Ip stringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- nat
Ip stringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- nat_
gateway_ strid - 私网NAT网关ID。
- nat_
ip str - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- nat_
ip_ strdescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- nat_
ip_ strname - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- nat
Gateway StringId - 私网NAT网关ID。
- nat
Ip String - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- nat
Ip StringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- nat
Ip StringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
Outputs
All input properties are implicitly available as output properties. Additionally, the NatIp resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Default bool - 是否为默认中转IP。true:是。false:否。
- Nat
Ip stringId - 中转IP的ID。
- Status string
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- Using
Status string - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Default bool - 是否为默认中转IP。true:是。false:否。
- Nat
Ip stringId - 中转IP的ID。
- Status string
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- Using
Status string - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- id String
- The provider-assigned unique ID for this managed resource.
- is
Default Boolean - 是否为默认中转IP。true:是。false:否。
- nat
Ip StringId - 中转IP的ID。
- status String
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- using
Status String - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- id string
- The provider-assigned unique ID for this managed resource.
- is
Default boolean - 是否为默认中转IP。true:是。false:否。
- nat
Ip stringId - 中转IP的ID。
- status string
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- using
Status string - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- id str
- The provider-assigned unique ID for this managed resource.
- is_
default bool - 是否为默认中转IP。true:是。false:否。
- nat_
ip_ strid - 中转IP的ID。
- status str
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- using_
status str - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- id String
- The provider-assigned unique ID for this managed resource.
- is
Default Boolean - 是否为默认中转IP。true:是。false:否。
- nat
Ip StringId - 中转IP的ID。
- status String
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- using
Status String - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
Look up Existing NatIp Resource
Get an existing NatIp 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?: NatIpState, opts?: CustomResourceOptions): NatIp@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
is_default: Optional[bool] = None,
nat_gateway_id: Optional[str] = None,
nat_ip: Optional[str] = None,
nat_ip_description: Optional[str] = None,
nat_ip_id: Optional[str] = None,
nat_ip_name: Optional[str] = None,
status: Optional[str] = None,
using_status: Optional[str] = None) -> NatIpfunc GetNatIp(ctx *Context, name string, id IDInput, state *NatIpState, opts ...ResourceOption) (*NatIp, error)public static NatIp Get(string name, Input<string> id, NatIpState? state, CustomResourceOptions? opts = null)public static NatIp get(String name, Output<String> id, NatIpState state, CustomResourceOptions options)resources: _: type: bytepluscc:natgateway:NatIp 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.
- Is
Default bool - 是否为默认中转IP。true:是。false:否。
- Nat
Gateway stringId - 私网NAT网关ID。
- Nat
Ip stringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- Nat
Ip stringId - 中转IP的ID。
- Nat
Ip stringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- Nat
Ip stringValue - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- Status string
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- Using
Status string - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- Is
Default bool - 是否为默认中转IP。true:是。false:否。
- Nat
Gateway stringId - 私网NAT网关ID。
- Nat
Ip string - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- Nat
Ip stringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- Nat
Ip stringId - 中转IP的ID。
- Nat
Ip stringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- Status string
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- Using
Status string - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- is
Default Boolean - 是否为默认中转IP。true:是。false:否。
- nat
Gateway StringId - 私网NAT网关ID。
- nat
Ip String - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- nat
Ip StringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- nat
Ip StringId - 中转IP的ID。
- nat
Ip StringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- status String
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- using
Status String - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- is
Default boolean - 是否为默认中转IP。true:是。false:否。
- nat
Gateway stringId - 私网NAT网关ID。
- nat
Ip string - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- nat
Ip stringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- nat
Ip stringId - 中转IP的ID。
- nat
Ip stringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- status string
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- using
Status string - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- is_
default bool - 是否为默认中转IP。true:是。false:否。
- nat_
gateway_ strid - 私网NAT网关ID。
- nat_
ip str - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- nat_
ip_ strdescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- nat_
ip_ strid - 中转IP的ID。
- nat_
ip_ strname - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- status str
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- using_
status str - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
- is
Default Boolean - 是否为默认中转IP。true:是。false:否。
- nat
Gateway StringId - 私网NAT网关ID。
- nat
Ip String - 中转IP的地址。若不填,则系统自动从私网NAT网关所在子网随机分配一个空闲的IP地址。
- nat
Ip StringDescription - 中转IP的描述。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
- nat
Ip StringId - 中转IP的ID。
- nat
Ip StringName - 中转IP的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。不填默认为中转IP的ID。
- status String
- 中转IP的状态。Creating:创建中。Available:可用。Deleting:删除中。Deleted:已删除。
- using
Status String - 中转IP的使用状态。Idle:未使用。UsedBySnat:被SNAT规则使用。UsedByDnat:被DNAT规则使用。UsedByNat:被SNAT/DNAT规则同时使用。
Import
$ pulumi import bytepluscc:natgateway/natIp:NatIp example "nat_ip_id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- bytepluscc byteplus-sdk/pulumi-bytepluscc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
byteplusccTerraform Provider.
