scaleway.VpcPublicGatewayPatRule
Explore with Pulumi AI
Creates and manages Scaleway VPC Public Gateway PAT (Port Address Translation). For more information, see the documentation.
Example
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@lbrlabs/pulumi-scaleway";
const pg01 = new scaleway.VpcPublicGateway("pg01", {type: "VPC-GW-S"});
const dhcp01 = new scaleway.VpcPublicGatewayDhcp("dhcp01", {subnet: "192.168.1.0/24"});
const pn01 = new scaleway.VpcPrivateNetwork("pn01", {});
const gn01 = new scaleway.VpcGatewayNetwork("gn01", {
gatewayId: pg01.id,
privateNetworkId: pn01.id,
dhcpId: dhcp01.id,
cleanupDhcp: true,
});
const main = new scaleway.VpcPublicGatewayPatRule("main", {
gatewayId: pg01.id,
privateIp: dhcp01.address,
privatePort: 42,
publicPort: 42,
protocol: "both",
}, {
dependsOn: [
gn01,
pn01,
],
});
import pulumi
import lbrlabs_pulumi_scaleway as scaleway
pg01 = scaleway.VpcPublicGateway("pg01", type="VPC-GW-S")
dhcp01 = scaleway.VpcPublicGatewayDhcp("dhcp01", subnet="192.168.1.0/24")
pn01 = scaleway.VpcPrivateNetwork("pn01")
gn01 = scaleway.VpcGatewayNetwork("gn01",
gateway_id=pg01.id,
private_network_id=pn01.id,
dhcp_id=dhcp01.id,
cleanup_dhcp=True)
main = scaleway.VpcPublicGatewayPatRule("main",
gateway_id=pg01.id,
private_ip=dhcp01.address,
private_port=42,
public_port=42,
protocol="both",
opts=pulumi.ResourceOptions(depends_on=[
gn01,
pn01,
]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Lbrlabs.PulumiPackage.Scaleway;
return await Deployment.RunAsync(() =>
{
var pg01 = new Scaleway.VpcPublicGateway("pg01", new()
{
Type = "VPC-GW-S",
});
var dhcp01 = new Scaleway.VpcPublicGatewayDhcp("dhcp01", new()
{
Subnet = "192.168.1.0/24",
});
var pn01 = new Scaleway.VpcPrivateNetwork("pn01");
var gn01 = new Scaleway.VpcGatewayNetwork("gn01", new()
{
GatewayId = pg01.Id,
PrivateNetworkId = pn01.Id,
DhcpId = dhcp01.Id,
CleanupDhcp = true,
});
var main = new Scaleway.VpcPublicGatewayPatRule("main", new()
{
GatewayId = pg01.Id,
PrivateIp = dhcp01.Address,
PrivatePort = 42,
PublicPort = 42,
Protocol = "both",
}, new CustomResourceOptions
{
DependsOn = new[]
{
gn01,
pn01,
},
});
});
package main
import (
"github.com/lbrlabs/pulumi-scaleway/sdk/go/scaleway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pg01, err := scaleway.NewVpcPublicGateway(ctx, "pg01", &scaleway.VpcPublicGatewayArgs{
Type: pulumi.String("VPC-GW-S"),
})
if err != nil {
return err
}
dhcp01, err := scaleway.NewVpcPublicGatewayDhcp(ctx, "dhcp01", &scaleway.VpcPublicGatewayDhcpArgs{
Subnet: pulumi.String("192.168.1.0/24"),
})
if err != nil {
return err
}
pn01, err := scaleway.NewVpcPrivateNetwork(ctx, "pn01", nil)
if err != nil {
return err
}
gn01, err := scaleway.NewVpcGatewayNetwork(ctx, "gn01", &scaleway.VpcGatewayNetworkArgs{
GatewayId: pg01.ID(),
PrivateNetworkId: pn01.ID(),
DhcpId: dhcp01.ID(),
CleanupDhcp: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = scaleway.NewVpcPublicGatewayPatRule(ctx, "main", &scaleway.VpcPublicGatewayPatRuleArgs{
GatewayId: pg01.ID(),
PrivateIp: dhcp01.Address,
PrivatePort: pulumi.Int(42),
PublicPort: pulumi.Int(42),
Protocol: pulumi.String("both"),
}, pulumi.DependsOn([]pulumi.Resource{
gn01,
pn01,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.VpcPublicGateway;
import com.pulumi.scaleway.VpcPublicGatewayArgs;
import com.pulumi.scaleway.VpcPublicGatewayDhcp;
import com.pulumi.scaleway.VpcPublicGatewayDhcpArgs;
import com.pulumi.scaleway.VpcPrivateNetwork;
import com.pulumi.scaleway.VpcGatewayNetwork;
import com.pulumi.scaleway.VpcGatewayNetworkArgs;
import com.pulumi.scaleway.VpcPublicGatewayPatRule;
import com.pulumi.scaleway.VpcPublicGatewayPatRuleArgs;
import com.pulumi.resources.CustomResourceOptions;
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 pg01 = new VpcPublicGateway("pg01", VpcPublicGatewayArgs.builder()
.type("VPC-GW-S")
.build());
var dhcp01 = new VpcPublicGatewayDhcp("dhcp01", VpcPublicGatewayDhcpArgs.builder()
.subnet("192.168.1.0/24")
.build());
var pn01 = new VpcPrivateNetwork("pn01");
var gn01 = new VpcGatewayNetwork("gn01", VpcGatewayNetworkArgs.builder()
.gatewayId(pg01.id())
.privateNetworkId(pn01.id())
.dhcpId(dhcp01.id())
.cleanupDhcp(true)
.build());
var main = new VpcPublicGatewayPatRule("main", VpcPublicGatewayPatRuleArgs.builder()
.gatewayId(pg01.id())
.privateIp(dhcp01.address())
.privatePort(42)
.publicPort(42)
.protocol("both")
.build(), CustomResourceOptions.builder()
.dependsOn(
gn01,
pn01)
.build());
}
}
resources:
pg01:
type: scaleway:VpcPublicGateway
properties:
type: VPC-GW-S
dhcp01:
type: scaleway:VpcPublicGatewayDhcp
properties:
subnet: 192.168.1.0/24
pn01:
type: scaleway:VpcPrivateNetwork
gn01:
type: scaleway:VpcGatewayNetwork
properties:
gatewayId: ${pg01.id}
privateNetworkId: ${pn01.id}
dhcpId: ${dhcp01.id}
cleanupDhcp: true
main:
type: scaleway:VpcPublicGatewayPatRule
properties:
gatewayId: ${pg01.id}
privateIp: ${dhcp01.address}
privatePort: 42
publicPort: 42
protocol: both
options:
dependson:
- ${gn01}
- ${pn01}
Create VpcPublicGatewayPatRule Resource
new VpcPublicGatewayPatRule(name: string, args: VpcPublicGatewayPatRuleArgs, opts?: CustomResourceOptions);
@overload
def VpcPublicGatewayPatRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
gateway_id: Optional[str] = None,
private_ip: Optional[str] = None,
private_port: Optional[int] = None,
protocol: Optional[str] = None,
public_port: Optional[int] = None,
zone: Optional[str] = None)
@overload
def VpcPublicGatewayPatRule(resource_name: str,
args: VpcPublicGatewayPatRuleArgs,
opts: Optional[ResourceOptions] = None)
func NewVpcPublicGatewayPatRule(ctx *Context, name string, args VpcPublicGatewayPatRuleArgs, opts ...ResourceOption) (*VpcPublicGatewayPatRule, error)
public VpcPublicGatewayPatRule(string name, VpcPublicGatewayPatRuleArgs args, CustomResourceOptions? opts = null)
public VpcPublicGatewayPatRule(String name, VpcPublicGatewayPatRuleArgs args)
public VpcPublicGatewayPatRule(String name, VpcPublicGatewayPatRuleArgs args, CustomResourceOptions options)
type: scaleway:VpcPublicGatewayPatRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcPublicGatewayPatRuleArgs
- 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 VpcPublicGatewayPatRuleArgs
- 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 VpcPublicGatewayPatRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcPublicGatewayPatRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcPublicGatewayPatRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VpcPublicGatewayPatRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The VpcPublicGatewayPatRule resource accepts the following input properties:
- Gateway
Id string The ID of the public gateway.
- Private
Ip string The Private IP to forward data to (IP address).
- Private
Port int The Private port to translate to.
- Public
Port int The Public port to listen on.
- Protocol string
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- Zone string
zone
) The zone in which the public gateway DHCP config should be created.
- Gateway
Id string The ID of the public gateway.
- Private
Ip string The Private IP to forward data to (IP address).
- Private
Port int The Private port to translate to.
- Public
Port int The Public port to listen on.
- Protocol string
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- Zone string
zone
) The zone in which the public gateway DHCP config should be created.
- gateway
Id String The ID of the public gateway.
- private
Ip String The Private IP to forward data to (IP address).
- private
Port Integer The Private port to translate to.
- public
Port Integer The Public port to listen on.
- protocol String
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- zone String
zone
) The zone in which the public gateway DHCP config should be created.
- gateway
Id string The ID of the public gateway.
- private
Ip string The Private IP to forward data to (IP address).
- private
Port number The Private port to translate to.
- public
Port number The Public port to listen on.
- protocol string
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- zone string
zone
) The zone in which the public gateway DHCP config should be created.
- gateway_
id str The ID of the public gateway.
- private_
ip str The Private IP to forward data to (IP address).
- private_
port int The Private port to translate to.
- public_
port int The Public port to listen on.
- protocol str
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- zone str
zone
) The zone in which the public gateway DHCP config should be created.
- gateway
Id String The ID of the public gateway.
- private
Ip String The Private IP to forward data to (IP address).
- private
Port Number The Private port to translate to.
- public
Port Number The Public port to listen on.
- protocol String
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- zone String
zone
) The zone in which the public gateway DHCP config should be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcPublicGatewayPatRule resource produces the following output properties:
- Created
At string The date and time of the creation of the pat rule config.
- Id string
The provider-assigned unique ID for this managed resource.
- Organization
Id string The organization ID the pat rule config is associated with.
- Updated
At string The date and time of the last update of the pat rule config.
- Created
At string The date and time of the creation of the pat rule config.
- Id string
The provider-assigned unique ID for this managed resource.
- Organization
Id string The organization ID the pat rule config is associated with.
- Updated
At string The date and time of the last update of the pat rule config.
- created
At String The date and time of the creation of the pat rule config.
- id String
The provider-assigned unique ID for this managed resource.
- organization
Id String The organization ID the pat rule config is associated with.
- updated
At String The date and time of the last update of the pat rule config.
- created
At string The date and time of the creation of the pat rule config.
- id string
The provider-assigned unique ID for this managed resource.
- organization
Id string The organization ID the pat rule config is associated with.
- updated
At string The date and time of the last update of the pat rule config.
- created_
at str The date and time of the creation of the pat rule config.
- id str
The provider-assigned unique ID for this managed resource.
- organization_
id str The organization ID the pat rule config is associated with.
- updated_
at str The date and time of the last update of the pat rule config.
- created
At String The date and time of the creation of the pat rule config.
- id String
The provider-assigned unique ID for this managed resource.
- organization
Id String The organization ID the pat rule config is associated with.
- updated
At String The date and time of the last update of the pat rule config.
Look up Existing VpcPublicGatewayPatRule Resource
Get an existing VpcPublicGatewayPatRule 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?: VpcPublicGatewayPatRuleState, opts?: CustomResourceOptions): VpcPublicGatewayPatRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
gateway_id: Optional[str] = None,
organization_id: Optional[str] = None,
private_ip: Optional[str] = None,
private_port: Optional[int] = None,
protocol: Optional[str] = None,
public_port: Optional[int] = None,
updated_at: Optional[str] = None,
zone: Optional[str] = None) -> VpcPublicGatewayPatRule
func GetVpcPublicGatewayPatRule(ctx *Context, name string, id IDInput, state *VpcPublicGatewayPatRuleState, opts ...ResourceOption) (*VpcPublicGatewayPatRule, error)
public static VpcPublicGatewayPatRule Get(string name, Input<string> id, VpcPublicGatewayPatRuleState? state, CustomResourceOptions? opts = null)
public static VpcPublicGatewayPatRule get(String name, Output<String> id, VpcPublicGatewayPatRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Created
At string The date and time of the creation of the pat rule config.
- Gateway
Id string The ID of the public gateway.
- Organization
Id string The organization ID the pat rule config is associated with.
- Private
Ip string The Private IP to forward data to (IP address).
- Private
Port int The Private port to translate to.
- Protocol string
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- Public
Port int The Public port to listen on.
- Updated
At string The date and time of the last update of the pat rule config.
- Zone string
zone
) The zone in which the public gateway DHCP config should be created.
- Created
At string The date and time of the creation of the pat rule config.
- Gateway
Id string The ID of the public gateway.
- Organization
Id string The organization ID the pat rule config is associated with.
- Private
Ip string The Private IP to forward data to (IP address).
- Private
Port int The Private port to translate to.
- Protocol string
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- Public
Port int The Public port to listen on.
- Updated
At string The date and time of the last update of the pat rule config.
- Zone string
zone
) The zone in which the public gateway DHCP config should be created.
- created
At String The date and time of the creation of the pat rule config.
- gateway
Id String The ID of the public gateway.
- organization
Id String The organization ID the pat rule config is associated with.
- private
Ip String The Private IP to forward data to (IP address).
- private
Port Integer The Private port to translate to.
- protocol String
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- public
Port Integer The Public port to listen on.
- updated
At String The date and time of the last update of the pat rule config.
- zone String
zone
) The zone in which the public gateway DHCP config should be created.
- created
At string The date and time of the creation of the pat rule config.
- gateway
Id string The ID of the public gateway.
- organization
Id string The organization ID the pat rule config is associated with.
- private
Ip string The Private IP to forward data to (IP address).
- private
Port number The Private port to translate to.
- protocol string
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- public
Port number The Public port to listen on.
- updated
At string The date and time of the last update of the pat rule config.
- zone string
zone
) The zone in which the public gateway DHCP config should be created.
- created_
at str The date and time of the creation of the pat rule config.
- gateway_
id str The ID of the public gateway.
- organization_
id str The organization ID the pat rule config is associated with.
- private_
ip str The Private IP to forward data to (IP address).
- private_
port int The Private port to translate to.
- protocol str
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- public_
port int The Public port to listen on.
- updated_
at str The date and time of the last update of the pat rule config.
- zone str
zone
) The zone in which the public gateway DHCP config should be created.
- created
At String The date and time of the creation of the pat rule config.
- gateway
Id String The ID of the public gateway.
- organization
Id String The organization ID the pat rule config is associated with.
- private
Ip String The Private IP to forward data to (IP address).
- private
Port Number The Private port to translate to.
- protocol String
The Protocol the rule should apply to. Possible values are both, tcp and udp.
- public
Port Number The Public port to listen on.
- updated
At String The date and time of the last update of the pat rule config.
- zone String
zone
) The zone in which the public gateway DHCP config should be created.
Import
Public gateway PAT rules config can be imported using the {zone}/{id}
, e.g. bash
$ pulumi import scaleway:index/vpcPublicGatewayPatRule:VpcPublicGatewayPatRule main fr-par-1/11111111-1111-1111-1111-111111111111
Package Details
- Repository
- scaleway lbrlabs/pulumi-scaleway
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
scaleway
Terraform Provider.