published on Friday, May 22, 2026 by megaport
published on Friday, May 22, 2026 by megaport
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as megaport from "@pulumi/megaport";
const example = new megaport.NatGateway("example", {
productName: "Megaport NAT Gateway Example",
locationId: 5,
speed: 1000,
sessionCount: 250000,
contractTermMonths: 1,
diversityZone: "red",
asn: 64512,
});
const exampleNatGatewayPrefixList = new megaport.NatGatewayPrefixList("example", {
natGatewayProductUid: example.productUid,
description: "Customer routes",
addressFamily: "IPv4",
entries: [
{
action: "permit",
prefix: "10.0.0.0/8",
ge: 24,
le: 32,
},
{
action: "permit",
prefix: "172.16.0.0/12",
},
{
action: "deny",
prefix: "192.168.0.0/16",
},
],
});
import pulumi
import pulumi_megaport as megaport
example = megaport.NatGateway("example",
product_name="Megaport NAT Gateway Example",
location_id=5,
speed=1000,
session_count=250000,
contract_term_months=1,
diversity_zone="red",
asn=64512)
example_nat_gateway_prefix_list = megaport.NatGatewayPrefixList("example",
nat_gateway_product_uid=example.product_uid,
description="Customer routes",
address_family="IPv4",
entries=[
{
"action": "permit",
"prefix": "10.0.0.0/8",
"ge": 24,
"le": 32,
},
{
"action": "permit",
"prefix": "172.16.0.0/12",
},
{
"action": "deny",
"prefix": "192.168.0.0/16",
},
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/megaport/megaport"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := megaport.NewNatGateway(ctx, "example", &megaport.NatGatewayArgs{
ProductName: pulumi.String("Megaport NAT Gateway Example"),
LocationId: pulumi.Float64(5),
Speed: pulumi.Float64(1000),
SessionCount: pulumi.Float64(250000),
ContractTermMonths: pulumi.Float64(1),
DiversityZone: pulumi.String("red"),
Asn: pulumi.Float64(64512),
})
if err != nil {
return err
}
_, err = megaport.NewNatGatewayPrefixList(ctx, "example", &megaport.NatGatewayPrefixListArgs{
NatGatewayProductUid: example.ProductUid,
Description: pulumi.String("Customer routes"),
AddressFamily: pulumi.String("IPv4"),
Entries: megaport.NatGatewayPrefixListEntryArray{
&megaport.NatGatewayPrefixListEntryArgs{
Action: pulumi.String("permit"),
Prefix: pulumi.String("10.0.0.0/8"),
Ge: pulumi.Float64(24),
Le: pulumi.Float64(32),
},
&megaport.NatGatewayPrefixListEntryArgs{
Action: pulumi.String("permit"),
Prefix: pulumi.String("172.16.0.0/12"),
},
&megaport.NatGatewayPrefixListEntryArgs{
Action: pulumi.String("deny"),
Prefix: pulumi.String("192.168.0.0/16"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Megaport = Pulumi.Megaport;
return await Deployment.RunAsync(() =>
{
var example = new Megaport.NatGateway("example", new()
{
ProductName = "Megaport NAT Gateway Example",
LocationId = 5,
Speed = 1000,
SessionCount = 250000,
ContractTermMonths = 1,
DiversityZone = "red",
Asn = 64512,
});
var exampleNatGatewayPrefixList = new Megaport.NatGatewayPrefixList("example", new()
{
NatGatewayProductUid = example.ProductUid,
Description = "Customer routes",
AddressFamily = "IPv4",
Entries = new[]
{
new Megaport.Inputs.NatGatewayPrefixListEntryArgs
{
Action = "permit",
Prefix = "10.0.0.0/8",
Ge = 24,
Le = 32,
},
new Megaport.Inputs.NatGatewayPrefixListEntryArgs
{
Action = "permit",
Prefix = "172.16.0.0/12",
},
new Megaport.Inputs.NatGatewayPrefixListEntryArgs
{
Action = "deny",
Prefix = "192.168.0.0/16",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.megaport.NatGateway;
import com.pulumi.megaport.NatGatewayArgs;
import com.pulumi.megaport.NatGatewayPrefixList;
import com.pulumi.megaport.NatGatewayPrefixListArgs;
import com.pulumi.megaport.inputs.NatGatewayPrefixListEntryArgs;
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 example = new NatGateway("example", NatGatewayArgs.builder()
.productName("Megaport NAT Gateway Example")
.locationId(5.0)
.speed(1000.0)
.sessionCount(250000.0)
.contractTermMonths(1.0)
.diversityZone("red")
.asn(64512.0)
.build());
var exampleNatGatewayPrefixList = new NatGatewayPrefixList("exampleNatGatewayPrefixList", NatGatewayPrefixListArgs.builder()
.natGatewayProductUid(example.productUid())
.description("Customer routes")
.addressFamily("IPv4")
.entries(
NatGatewayPrefixListEntryArgs.builder()
.action("permit")
.prefix("10.0.0.0/8")
.ge(24.0)
.le(32.0)
.build(),
NatGatewayPrefixListEntryArgs.builder()
.action("permit")
.prefix("172.16.0.0/12")
.build(),
NatGatewayPrefixListEntryArgs.builder()
.action("deny")
.prefix("192.168.0.0/16")
.build())
.build());
}
}
resources:
example:
type: megaport:NatGateway
properties:
productName: Megaport NAT Gateway Example
locationId: 5
speed: 1000
sessionCount: 250000
contractTermMonths: 1
diversityZone: red
asn: 64512
exampleNatGatewayPrefixList:
type: megaport:NatGatewayPrefixList
name: example
properties:
natGatewayProductUid: ${example.productUid}
description: Customer routes
addressFamily: IPv4
entries:
- action: permit
prefix: 10.0.0.0/8
ge: 24
le: 32
- action: permit
prefix: 172.16.0.0/12
- action: deny
prefix: 192.168.0.0/16
Example coming soon!
Create NatGatewayPrefixList Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NatGatewayPrefixList(name: string, args: NatGatewayPrefixListArgs, opts?: CustomResourceOptions);@overload
def NatGatewayPrefixList(resource_name: str,
args: NatGatewayPrefixListArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NatGatewayPrefixList(resource_name: str,
opts: Optional[ResourceOptions] = None,
address_family: Optional[str] = None,
description: Optional[str] = None,
entries: Optional[Sequence[NatGatewayPrefixListEntryArgs]] = None,
nat_gateway_product_uid: Optional[str] = None)func NewNatGatewayPrefixList(ctx *Context, name string, args NatGatewayPrefixListArgs, opts ...ResourceOption) (*NatGatewayPrefixList, error)public NatGatewayPrefixList(string name, NatGatewayPrefixListArgs args, CustomResourceOptions? opts = null)
public NatGatewayPrefixList(String name, NatGatewayPrefixListArgs args)
public NatGatewayPrefixList(String name, NatGatewayPrefixListArgs args, CustomResourceOptions options)
type: megaport:NatGatewayPrefixList
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "megaport_natgatewayprefixlist" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args NatGatewayPrefixListArgs
- 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 NatGatewayPrefixListArgs
- 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 NatGatewayPrefixListArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NatGatewayPrefixListArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NatGatewayPrefixListArgs
- 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 natGatewayPrefixListResource = new Megaport.NatGatewayPrefixList("natGatewayPrefixListResource", new()
{
AddressFamily = "string",
Description = "string",
Entries = new[]
{
new Megaport.Inputs.NatGatewayPrefixListEntryArgs
{
Action = "string",
Prefix = "string",
Ge = 0,
Le = 0,
},
},
NatGatewayProductUid = "string",
});
example, err := megaport.NewNatGatewayPrefixList(ctx, "natGatewayPrefixListResource", &megaport.NatGatewayPrefixListArgs{
AddressFamily: pulumi.String("string"),
Description: pulumi.String("string"),
Entries: megaport.NatGatewayPrefixListEntryArray{
&megaport.NatGatewayPrefixListEntryArgs{
Action: pulumi.String("string"),
Prefix: pulumi.String("string"),
Ge: pulumi.Float64(0),
Le: pulumi.Float64(0),
},
},
NatGatewayProductUid: pulumi.String("string"),
})
resource "megaport_natgatewayprefixlist" "natGatewayPrefixListResource" {
address_family = "string"
description = "string"
entries {
action = "string"
prefix = "string"
ge = 0
le = 0
}
nat_gateway_product_uid = "string"
}
var natGatewayPrefixListResource = new NatGatewayPrefixList("natGatewayPrefixListResource", NatGatewayPrefixListArgs.builder()
.addressFamily("string")
.description("string")
.entries(NatGatewayPrefixListEntryArgs.builder()
.action("string")
.prefix("string")
.ge(0.0)
.le(0.0)
.build())
.natGatewayProductUid("string")
.build());
nat_gateway_prefix_list_resource = megaport.NatGatewayPrefixList("natGatewayPrefixListResource",
address_family="string",
description="string",
entries=[{
"action": "string",
"prefix": "string",
"ge": float(0),
"le": float(0),
}],
nat_gateway_product_uid="string")
const natGatewayPrefixListResource = new megaport.NatGatewayPrefixList("natGatewayPrefixListResource", {
addressFamily: "string",
description: "string",
entries: [{
action: "string",
prefix: "string",
ge: 0,
le: 0,
}],
natGatewayProductUid: "string",
});
type: megaport:NatGatewayPrefixList
properties:
addressFamily: string
description: string
entries:
- action: string
ge: 0
le: 0
prefix: string
natGatewayProductUid: string
NatGatewayPrefixList 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 NatGatewayPrefixList resource accepts the following input properties:
- Address
Family string - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - Description string
- Description of the prefix list.
- Entries
List<Nat
Gateway Prefix List Entry> - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- Nat
Gateway stringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
- Address
Family string - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - Description string
- Description of the prefix list.
- Entries
[]Nat
Gateway Prefix List Entry Args - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- Nat
Gateway stringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
- address_
family string - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description string
- Description of the prefix list.
- entries list(object)
- Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat_
gateway_ stringproduct_ uid - Product UID of the NAT Gateway that owns this prefix list.
- address
Family String - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description String
- Description of the prefix list.
- entries
List<Nat
Gateway Prefix List Entry> - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat
Gateway StringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
- address
Family string - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description string
- Description of the prefix list.
- entries
Nat
Gateway Prefix List Entry[] - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat
Gateway stringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
- address_
family str - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description str
- Description of the prefix list.
- entries
Sequence[Nat
Gateway Prefix List Entry Args] - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat_
gateway_ strproduct_ uid - Product UID of the NAT Gateway that owns this prefix list.
- address
Family String - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description String
- Description of the prefix list.
- entries List<Property Map>
- Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat
Gateway StringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
Outputs
All input properties are implicitly available as output properties. Additionally, the NatGatewayPrefixList resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Nat
Gateway doublePrefix List Id - Numeric ID of the prefix list, assigned by the API.
- Id string
- The provider-assigned unique ID for this managed resource.
- Nat
Gateway float64Prefix List Id - Numeric ID of the prefix list, assigned by the API.
- id string
- The provider-assigned unique ID for this managed resource.
- nat_
gateway_ numberprefix_ list_ id - Numeric ID of the prefix list, assigned by the API.
- id String
- The provider-assigned unique ID for this managed resource.
- nat
Gateway DoublePrefix List Id - Numeric ID of the prefix list, assigned by the API.
- id string
- The provider-assigned unique ID for this managed resource.
- nat
Gateway numberPrefix List Id - Numeric ID of the prefix list, assigned by the API.
- id str
- The provider-assigned unique ID for this managed resource.
- nat_
gateway_ floatprefix_ list_ id - Numeric ID of the prefix list, assigned by the API.
- id String
- The provider-assigned unique ID for this managed resource.
- nat
Gateway NumberPrefix List Id - Numeric ID of the prefix list, assigned by the API.
Look up Existing NatGatewayPrefixList Resource
Get an existing NatGatewayPrefixList 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?: NatGatewayPrefixListState, opts?: CustomResourceOptions): NatGatewayPrefixList@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address_family: Optional[str] = None,
description: Optional[str] = None,
entries: Optional[Sequence[NatGatewayPrefixListEntryArgs]] = None,
nat_gateway_prefix_list_id: Optional[float] = None,
nat_gateway_product_uid: Optional[str] = None) -> NatGatewayPrefixListfunc GetNatGatewayPrefixList(ctx *Context, name string, id IDInput, state *NatGatewayPrefixListState, opts ...ResourceOption) (*NatGatewayPrefixList, error)public static NatGatewayPrefixList Get(string name, Input<string> id, NatGatewayPrefixListState? state, CustomResourceOptions? opts = null)public static NatGatewayPrefixList get(String name, Output<String> id, NatGatewayPrefixListState state, CustomResourceOptions options)resources: _: type: megaport:NatGatewayPrefixList get: id: ${id}import {
to = megaport_natgatewayprefixlist.example
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.
- Address
Family string - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - Description string
- Description of the prefix list.
- Entries
List<Nat
Gateway Prefix List Entry> - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- Nat
Gateway doublePrefix List Id - Numeric ID of the prefix list, assigned by the API.
- Nat
Gateway stringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
- Address
Family string - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - Description string
- Description of the prefix list.
- Entries
[]Nat
Gateway Prefix List Entry Args - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- Nat
Gateway float64Prefix List Id - Numeric ID of the prefix list, assigned by the API.
- Nat
Gateway stringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
- address_
family string - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description string
- Description of the prefix list.
- entries list(object)
- Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat_
gateway_ numberprefix_ list_ id - Numeric ID of the prefix list, assigned by the API.
- nat_
gateway_ stringproduct_ uid - Product UID of the NAT Gateway that owns this prefix list.
- address
Family String - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description String
- Description of the prefix list.
- entries
List<Nat
Gateway Prefix List Entry> - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat
Gateway DoublePrefix List Id - Numeric ID of the prefix list, assigned by the API.
- nat
Gateway StringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
- address
Family string - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description string
- Description of the prefix list.
- entries
Nat
Gateway Prefix List Entry[] - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat
Gateway numberPrefix List Id - Numeric ID of the prefix list, assigned by the API.
- nat
Gateway stringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
- address_
family str - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description str
- Description of the prefix list.
- entries
Sequence[Nat
Gateway Prefix List Entry Args] - Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat_
gateway_ floatprefix_ list_ id - Numeric ID of the prefix list, assigned by the API.
- nat_
gateway_ strproduct_ uid - Product UID of the NAT Gateway that owns this prefix list.
- address
Family String - Address family of the prefix list. One of
IPv4orIPv6. Changing this forces replacement. - description String
- Description of the prefix list.
- entries List<Property Map>
- Entries in the prefix list. At least one entry is required. Each entry's prefix must match the address_family.
- nat
Gateway NumberPrefix List Id - Numeric ID of the prefix list, assigned by the API.
- nat
Gateway StringProduct Uid - Product UID of the NAT Gateway that owns this prefix list.
Supporting Types
NatGatewayPrefixListEntry, NatGatewayPrefixListEntryArgs
- Action string
- Action for the entry. One of
permitordeny. - Prefix string
- CIDR network address of the entry. Must be a valid network address with no host bits set.
- Ge double
- Minimum prefix length to be matched. 0–32 for IPv4, 0–128 for IPv6. Omit or set to 0 to match the prefix's own length.
- Le double
- Maximum prefix length to be matched. Must be greater than or equal to
ge. Omit or set to 0 to match the prefix's own length.
- Action string
- Action for the entry. One of
permitordeny. - Prefix string
- CIDR network address of the entry. Must be a valid network address with no host bits set.
- Ge float64
- Minimum prefix length to be matched. 0–32 for IPv4, 0–128 for IPv6. Omit or set to 0 to match the prefix's own length.
- Le float64
- Maximum prefix length to be matched. Must be greater than or equal to
ge. Omit or set to 0 to match the prefix's own length.
- action string
- Action for the entry. One of
permitordeny. - prefix string
- CIDR network address of the entry. Must be a valid network address with no host bits set.
- ge number
- Minimum prefix length to be matched. 0–32 for IPv4, 0–128 for IPv6. Omit or set to 0 to match the prefix's own length.
- le number
- Maximum prefix length to be matched. Must be greater than or equal to
ge. Omit or set to 0 to match the prefix's own length.
- action String
- Action for the entry. One of
permitordeny. - prefix String
- CIDR network address of the entry. Must be a valid network address with no host bits set.
- ge Double
- Minimum prefix length to be matched. 0–32 for IPv4, 0–128 for IPv6. Omit or set to 0 to match the prefix's own length.
- le Double
- Maximum prefix length to be matched. Must be greater than or equal to
ge. Omit or set to 0 to match the prefix's own length.
- action string
- Action for the entry. One of
permitordeny. - prefix string
- CIDR network address of the entry. Must be a valid network address with no host bits set.
- ge number
- Minimum prefix length to be matched. 0–32 for IPv4, 0–128 for IPv6. Omit or set to 0 to match the prefix's own length.
- le number
- Maximum prefix length to be matched. Must be greater than or equal to
ge. Omit or set to 0 to match the prefix's own length.
- action str
- Action for the entry. One of
permitordeny. - prefix str
- CIDR network address of the entry. Must be a valid network address with no host bits set.
- ge float
- Minimum prefix length to be matched. 0–32 for IPv4, 0–128 for IPv6. Omit or set to 0 to match the prefix's own length.
- le float
- Maximum prefix length to be matched. Must be greater than or equal to
ge. Omit or set to 0 to match the prefix's own length.
- action String
- Action for the entry. One of
permitordeny. - prefix String
- CIDR network address of the entry. Must be a valid network address with no host bits set.
- ge Number
- Minimum prefix length to be matched. 0–32 for IPv4, 0–128 for IPv6. Omit or set to 0 to match the prefix's own length.
- le Number
- Maximum prefix length to be matched. Must be greater than or equal to
ge. Omit or set to 0 to match the prefix's own length.
Import
The pulumi import command can be used, for example:
NAT Gateway prefix lists are imported using the composite ID
“<NAT_GATEWAY_PRODUCT_UID>:<PREFIX_LIST_ID>”.
Where:
NAT_GATEWAY_PRODUCT_UID: UID of the NAT Gateway that owns the prefix list.
PREFIX_LIST_ID: Numeric ID of the prefix list (positive integer).
$ pulumi import megaport:index/natGatewayPrefixList:NatGatewayPrefixList example "11111111-1111-1111-1111-111111111111:456"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- megaport megaport/terraform-provider-megaport
- License
- Notes
- This Pulumi package is based on the
megaportTerraform Provider.
published on Friday, May 22, 2026 by megaport