ionoscloud.Natgateway
Explore with Pulumi AI
Manages a Nat Gateway on IonosCloud.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const exampleDatacenter = new ionoscloud.Datacenter("exampleDatacenter", {
location: "us/las",
description: "Datacenter Description",
secAuthProtection: false,
});
const exampleIpblock = new ionoscloud.Ipblock("exampleIpblock", {
location: "us/las",
size: 2,
});
const exampleLan = new ionoscloud.Lan("exampleLan", {
datacenterId: exampleDatacenter.datacenterId,
"public": true,
});
const exampleNatgateway = new ionoscloud.Natgateway("exampleNatgateway", {
datacenterId: exampleDatacenter.datacenterId,
publicIps: [
exampleIpblock.ips[0],
exampleIpblock.ips[1],
],
lans: [{
id: exampleLan.lanId,
gatewayIps: ["10.11.2.5"],
}],
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example_datacenter = ionoscloud.Datacenter("exampleDatacenter",
location="us/las",
description="Datacenter Description",
sec_auth_protection=False)
example_ipblock = ionoscloud.Ipblock("exampleIpblock",
location="us/las",
size=2)
example_lan = ionoscloud.Lan("exampleLan",
datacenter_id=example_datacenter.datacenter_id,
public=True)
example_natgateway = ionoscloud.Natgateway("exampleNatgateway",
datacenter_id=example_datacenter.datacenter_id,
public_ips=[
example_ipblock.ips[0],
example_ipblock.ips[1],
],
lans=[{
"id": example_lan.lan_id,
"gateway_ips": ["10.11.2.5"],
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleDatacenter, err := ionoscloud.NewDatacenter(ctx, "exampleDatacenter", &ionoscloud.DatacenterArgs{
Location: pulumi.String("us/las"),
Description: pulumi.String("Datacenter Description"),
SecAuthProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
exampleIpblock, err := ionoscloud.NewIpblock(ctx, "exampleIpblock", &ionoscloud.IpblockArgs{
Location: pulumi.String("us/las"),
Size: pulumi.Float64(2),
})
if err != nil {
return err
}
exampleLan, err := ionoscloud.NewLan(ctx, "exampleLan", &ionoscloud.LanArgs{
DatacenterId: exampleDatacenter.DatacenterId,
Public: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = ionoscloud.NewNatgateway(ctx, "exampleNatgateway", &ionoscloud.NatgatewayArgs{
DatacenterId: exampleDatacenter.DatacenterId,
PublicIps: pulumi.StringArray{
exampleIpblock.Ips.ApplyT(func(ips []string) (string, error) {
return ips[0], nil
}).(pulumi.StringOutput),
exampleIpblock.Ips.ApplyT(func(ips []string) (string, error) {
return ips[1], nil
}).(pulumi.StringOutput),
},
Lans: ionoscloud.NatgatewayLanArray{
&ionoscloud.NatgatewayLanArgs{
Id: exampleLan.LanId,
GatewayIps: pulumi.StringArray{
pulumi.String("10.11.2.5"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var exampleDatacenter = new Ionoscloud.Datacenter("exampleDatacenter", new()
{
Location = "us/las",
Description = "Datacenter Description",
SecAuthProtection = false,
});
var exampleIpblock = new Ionoscloud.Ipblock("exampleIpblock", new()
{
Location = "us/las",
Size = 2,
});
var exampleLan = new Ionoscloud.Lan("exampleLan", new()
{
DatacenterId = exampleDatacenter.DatacenterId,
Public = true,
});
var exampleNatgateway = new Ionoscloud.Natgateway("exampleNatgateway", new()
{
DatacenterId = exampleDatacenter.DatacenterId,
PublicIps = new[]
{
exampleIpblock.Ips.Apply(ips => ips[0]),
exampleIpblock.Ips.Apply(ips => ips[1]),
},
Lans = new[]
{
new Ionoscloud.Inputs.NatgatewayLanArgs
{
Id = exampleLan.LanId,
GatewayIps = new[]
{
"10.11.2.5",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.Datacenter;
import com.pulumi.ionoscloud.DatacenterArgs;
import com.pulumi.ionoscloud.Ipblock;
import com.pulumi.ionoscloud.IpblockArgs;
import com.pulumi.ionoscloud.Lan;
import com.pulumi.ionoscloud.LanArgs;
import com.pulumi.ionoscloud.Natgateway;
import com.pulumi.ionoscloud.NatgatewayArgs;
import com.pulumi.ionoscloud.inputs.NatgatewayLanArgs;
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 exampleDatacenter = new Datacenter("exampleDatacenter", DatacenterArgs.builder()
.location("us/las")
.description("Datacenter Description")
.secAuthProtection(false)
.build());
var exampleIpblock = new Ipblock("exampleIpblock", IpblockArgs.builder()
.location("us/las")
.size(2)
.build());
var exampleLan = new Lan("exampleLan", LanArgs.builder()
.datacenterId(exampleDatacenter.datacenterId())
.public_(true)
.build());
var exampleNatgateway = new Natgateway("exampleNatgateway", NatgatewayArgs.builder()
.datacenterId(exampleDatacenter.datacenterId())
.publicIps(
exampleIpblock.ips().applyValue(ips -> ips[0]),
exampleIpblock.ips().applyValue(ips -> ips[1]))
.lans(NatgatewayLanArgs.builder()
.id(exampleLan.lanId())
.gatewayIps("10.11.2.5")
.build())
.build());
}
}
resources:
exampleDatacenter:
type: ionoscloud:Datacenter
properties:
location: us/las
description: Datacenter Description
secAuthProtection: false
exampleIpblock:
type: ionoscloud:Ipblock
properties:
location: us/las
size: 2
exampleLan:
type: ionoscloud:Lan
properties:
datacenterId: ${exampleDatacenter.datacenterId}
public: true
exampleNatgateway:
type: ionoscloud:Natgateway
properties:
datacenterId: ${exampleDatacenter.datacenterId}
publicIps:
- ${exampleIpblock.ips[0]}
- ${exampleIpblock.ips[1]}
lans:
- id: ${exampleLan.lanId}
gatewayIps:
- 10.11.2.5
Create Natgateway Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Natgateway(name: string, args: NatgatewayArgs, opts?: CustomResourceOptions);
@overload
def Natgateway(resource_name: str,
args: NatgatewayArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Natgateway(resource_name: str,
opts: Optional[ResourceOptions] = None,
datacenter_id: Optional[str] = None,
lans: Optional[Sequence[NatgatewayLanArgs]] = None,
public_ips: Optional[Sequence[str]] = None,
name: Optional[str] = None,
natgateway_id: Optional[str] = None,
timeouts: Optional[NatgatewayTimeoutsArgs] = None)
func NewNatgateway(ctx *Context, name string, args NatgatewayArgs, opts ...ResourceOption) (*Natgateway, error)
public Natgateway(string name, NatgatewayArgs args, CustomResourceOptions? opts = null)
public Natgateway(String name, NatgatewayArgs args)
public Natgateway(String name, NatgatewayArgs args, CustomResourceOptions options)
type: ionoscloud:Natgateway
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 NatgatewayArgs
- 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 NatgatewayArgs
- 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 NatgatewayArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NatgatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NatgatewayArgs
- 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 natgatewayResource = new Ionoscloud.Natgateway("natgatewayResource", new()
{
DatacenterId = "string",
Lans = new[]
{
new Ionoscloud.Inputs.NatgatewayLanArgs
{
Id = 0,
GatewayIps = new[]
{
"string",
},
},
},
PublicIps = new[]
{
"string",
},
Name = "string",
NatgatewayId = "string",
Timeouts = new Ionoscloud.Inputs.NatgatewayTimeoutsArgs
{
Create = "string",
Default = "string",
Delete = "string",
Update = "string",
},
});
example, err := ionoscloud.NewNatgateway(ctx, "natgatewayResource", &ionoscloud.NatgatewayArgs{
DatacenterId: pulumi.String("string"),
Lans: ionoscloud.NatgatewayLanArray{
&ionoscloud.NatgatewayLanArgs{
Id: pulumi.Float64(0),
GatewayIps: pulumi.StringArray{
pulumi.String("string"),
},
},
},
PublicIps: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
NatgatewayId: pulumi.String("string"),
Timeouts: &ionoscloud.NatgatewayTimeoutsArgs{
Create: pulumi.String("string"),
Default: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var natgatewayResource = new Natgateway("natgatewayResource", NatgatewayArgs.builder()
.datacenterId("string")
.lans(NatgatewayLanArgs.builder()
.id(0)
.gatewayIps("string")
.build())
.publicIps("string")
.name("string")
.natgatewayId("string")
.timeouts(NatgatewayTimeoutsArgs.builder()
.create("string")
.default_("string")
.delete("string")
.update("string")
.build())
.build());
natgateway_resource = ionoscloud.Natgateway("natgatewayResource",
datacenter_id="string",
lans=[{
"id": 0,
"gateway_ips": ["string"],
}],
public_ips=["string"],
name="string",
natgateway_id="string",
timeouts={
"create": "string",
"default": "string",
"delete": "string",
"update": "string",
})
const natgatewayResource = new ionoscloud.Natgateway("natgatewayResource", {
datacenterId: "string",
lans: [{
id: 0,
gatewayIps: ["string"],
}],
publicIps: ["string"],
name: "string",
natgatewayId: "string",
timeouts: {
create: "string",
"default": "string",
"delete": "string",
update: "string",
},
});
type: ionoscloud:Natgateway
properties:
datacenterId: string
lans:
- gatewayIps:
- string
id: 0
name: string
natgatewayId: string
publicIps:
- string
timeouts:
create: string
default: string
delete: string
update: string
Natgateway 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 Natgateway resource accepts the following input properties:
- Datacenter
Id string - [string] A Datacenter's UUID.
- Lans
List<Natgateway
Lan> - [list] A list of Local Area Networks the node pool should be part of.
- Public
Ips List<string> - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- Name string
- [string] Name of the NAT gateway.
- Natgateway
Id string - Timeouts
Natgateway
Timeouts
- Datacenter
Id string - [string] A Datacenter's UUID.
- Lans
[]Natgateway
Lan Args - [list] A list of Local Area Networks the node pool should be part of.
- Public
Ips []string - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- Name string
- [string] Name of the NAT gateway.
- Natgateway
Id string - Timeouts
Natgateway
Timeouts Args
- datacenter
Id String - [string] A Datacenter's UUID.
- lans
List<Natgateway
Lan> - [list] A list of Local Area Networks the node pool should be part of.
- public
Ips List<String> - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- name String
- [string] Name of the NAT gateway.
- natgateway
Id String - timeouts
Natgateway
Timeouts
- datacenter
Id string - [string] A Datacenter's UUID.
- lans
Natgateway
Lan[] - [list] A list of Local Area Networks the node pool should be part of.
- public
Ips string[] - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- name string
- [string] Name of the NAT gateway.
- natgateway
Id string - timeouts
Natgateway
Timeouts
- datacenter_
id str - [string] A Datacenter's UUID.
- lans
Sequence[Natgateway
Lan Args] - [list] A list of Local Area Networks the node pool should be part of.
- public_
ips Sequence[str] - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- name str
- [string] Name of the NAT gateway.
- natgateway_
id str - timeouts
Natgateway
Timeouts Args
- datacenter
Id String - [string] A Datacenter's UUID.
- lans List<Property Map>
- [list] A list of Local Area Networks the node pool should be part of.
- public
Ips List<String> - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- name String
- [string] Name of the NAT gateway.
- natgateway
Id String - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Natgateway 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 Natgateway Resource
Get an existing Natgateway 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?: NatgatewayState, opts?: CustomResourceOptions): Natgateway
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
datacenter_id: Optional[str] = None,
lans: Optional[Sequence[NatgatewayLanArgs]] = None,
name: Optional[str] = None,
natgateway_id: Optional[str] = None,
public_ips: Optional[Sequence[str]] = None,
timeouts: Optional[NatgatewayTimeoutsArgs] = None) -> Natgateway
func GetNatgateway(ctx *Context, name string, id IDInput, state *NatgatewayState, opts ...ResourceOption) (*Natgateway, error)
public static Natgateway Get(string name, Input<string> id, NatgatewayState? state, CustomResourceOptions? opts = null)
public static Natgateway get(String name, Output<String> id, NatgatewayState state, CustomResourceOptions options)
resources: _: type: ionoscloud:Natgateway 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.
- Datacenter
Id string - [string] A Datacenter's UUID.
- Lans
List<Natgateway
Lan> - [list] A list of Local Area Networks the node pool should be part of.
- Name string
- [string] Name of the NAT gateway.
- Natgateway
Id string - Public
Ips List<string> - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- Timeouts
Natgateway
Timeouts
- Datacenter
Id string - [string] A Datacenter's UUID.
- Lans
[]Natgateway
Lan Args - [list] A list of Local Area Networks the node pool should be part of.
- Name string
- [string] Name of the NAT gateway.
- Natgateway
Id string - Public
Ips []string - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- Timeouts
Natgateway
Timeouts Args
- datacenter
Id String - [string] A Datacenter's UUID.
- lans
List<Natgateway
Lan> - [list] A list of Local Area Networks the node pool should be part of.
- name String
- [string] Name of the NAT gateway.
- natgateway
Id String - public
Ips List<String> - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- timeouts
Natgateway
Timeouts
- datacenter
Id string - [string] A Datacenter's UUID.
- lans
Natgateway
Lan[] - [list] A list of Local Area Networks the node pool should be part of.
- name string
- [string] Name of the NAT gateway.
- natgateway
Id string - public
Ips string[] - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- timeouts
Natgateway
Timeouts
- datacenter_
id str - [string] A Datacenter's UUID.
- lans
Sequence[Natgateway
Lan Args] - [list] A list of Local Area Networks the node pool should be part of.
- name str
- [string] Name of the NAT gateway.
- natgateway_
id str - public_
ips Sequence[str] - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- timeouts
Natgateway
Timeouts Args
- datacenter
Id String - [string] A Datacenter's UUID.
- lans List<Property Map>
- [list] A list of Local Area Networks the node pool should be part of.
- name String
- [string] Name of the NAT gateway.
- natgateway
Id String - public
Ips List<String> - [list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- timeouts Property Map
Supporting Types
NatgatewayLan, NatgatewayLanArgs
- Id double
- [int] Id for the LAN connected to the NAT gateway.
- Gateway
Ips List<string> - [list] Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN.
- Id float64
- [int] Id for the LAN connected to the NAT gateway.
- Gateway
Ips []string - [list] Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN.
- id Double
- [int] Id for the LAN connected to the NAT gateway.
- gateway
Ips List<String> - [list] Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN.
- id number
- [int] Id for the LAN connected to the NAT gateway.
- gateway
Ips string[] - [list] Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN.
- id float
- [int] Id for the LAN connected to the NAT gateway.
- gateway_
ips Sequence[str] - [list] Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN.
- id Number
- [int] Id for the LAN connected to the NAT gateway.
- gateway
Ips List<String> - [list] Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN.
NatgatewayTimeouts, NatgatewayTimeoutsArgs
Import
A Nat Gateway resource can be imported using its resource id
and the datacenter id
, e.g.
$ pulumi import ionoscloud:index/natgateway:Natgateway my_natgateway datacenter uuid/nat gateway uuid
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.