published on Tuesday, Oct 13, 2026 by Pulumi
published on Tuesday, Oct 13, 2026 by Pulumi
This resource creates and manages an individual DrgNatRule for a DrgNatPolicy in the Oracle Cloud Infrastructure Core service. Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/iaas/latest/DrgNatRule
Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/
Creates a new DrgNatRule for a DrgNatPolicy. Assign the DrgNatPolicy to a DRG attachment
using the UpdateDrgAttachment or CreateDrgAttachment operations.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testDrgNatRule = new oci.core.DrgNatPolicyDrgNatRule("test_drg_nat_rule", {
drgNatPolicyId: testDrgNatPolicy.id,
drgNatRulePriority: 100,
originalSource: "10.0.0.0/24",
translatedSource: "192.168.0.0/24",
originalDestination: "172.16.1.0/24",
translatedDestination: "10.1.1.0/24",
});
import pulumi
import pulumi_oci as oci
test_drg_nat_rule = oci.core.DrgNatPolicyDrgNatRule("test_drg_nat_rule",
drg_nat_policy_id=test_drg_nat_policy["id"],
drg_nat_rule_priority=100,
original_source="10.0.0.0/24",
translated_source="192.168.0.0/24",
original_destination="172.16.1.0/24",
translated_destination="10.1.1.0/24")
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v5/go/oci/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := core.NewDrgNatPolicyDrgNatRule(ctx, "test_drg_nat_rule", &core.DrgNatPolicyDrgNatRuleArgs{
DrgNatPolicyId: pulumi.Any(testDrgNatPolicy.Id),
DrgNatRulePriority: pulumi.Int(100),
OriginalSource: pulumi.String("10.0.0.0/24"),
TranslatedSource: pulumi.String("192.168.0.0/24"),
OriginalDestination: pulumi.String("172.16.1.0/24"),
TranslatedDestination: pulumi.String("10.1.1.0/24"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testDrgNatRule = new Oci.Core.DrgNatPolicyDrgNatRule("test_drg_nat_rule", new()
{
DrgNatPolicyId = testDrgNatPolicy.Id,
DrgNatRulePriority = 100,
OriginalSource = "10.0.0.0/24",
TranslatedSource = "192.168.0.0/24",
OriginalDestination = "172.16.1.0/24",
TranslatedDestination = "10.1.1.0/24",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.DrgNatPolicyDrgNatRule;
import com.pulumi.oci.Core.DrgNatPolicyDrgNatRuleArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 testDrgNatRule = new DrgNatPolicyDrgNatRule("testDrgNatRule", DrgNatPolicyDrgNatRuleArgs.builder()
.drgNatPolicyId(testDrgNatPolicy.get("id"))
.drgNatRulePriority(100)
.originalSource("10.0.0.0/24")
.translatedSource("192.168.0.0/24")
.originalDestination("172.16.1.0/24")
.translatedDestination("10.1.1.0/24")
.build());
}
}
resources:
testDrgNatRule:
type: oci:Core:DrgNatPolicyDrgNatRule
name: test_drg_nat_rule
properties:
drgNatPolicyId: ${testDrgNatPolicy.id}
drgNatRulePriority: 100
originalSource: 10.0.0.0/24
translatedSource: 192.168.0.0/24
originalDestination: 172.16.1.0/24
translatedDestination: 10.1.1.0/24
terraform {
required_providers {
oci = {
source = "pulumi/oci"
}
}
}
resource "oci_core_drg_nat_policy_drg_nat_rule" "test_drg_nat_rule" {
lifecycle {
create_before_destroy = true
}
drg_nat_policy_id = testDrgNatPolicy.id
drg_nat_rule_priority = 100
original_source = "10.0.0.0/24"
translated_source = "192.168.0.0/24"
original_destination = "172.16.1.0/24"
translated_destination = "10.1.1.0/24"
}
Create DrgNatPolicyDrgNatRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DrgNatPolicyDrgNatRule(name: string, args: DrgNatPolicyDrgNatRuleArgs, opts?: CustomResourceOptions);@overload
def DrgNatPolicyDrgNatRule(resource_name: str,
args: DrgNatPolicyDrgNatRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DrgNatPolicyDrgNatRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
drg_nat_policy_id: Optional[str] = None,
drg_nat_rule_priority: Optional[int] = None,
original_destination: Optional[str] = None,
original_source: Optional[str] = None,
translated_destination: Optional[str] = None,
translated_source: Optional[str] = None)func NewDrgNatPolicyDrgNatRule(ctx *Context, name string, args DrgNatPolicyDrgNatRuleArgs, opts ...ResourceOption) (*DrgNatPolicyDrgNatRule, error)public DrgNatPolicyDrgNatRule(string name, DrgNatPolicyDrgNatRuleArgs args, CustomResourceOptions? opts = null)
public DrgNatPolicyDrgNatRule(String name, DrgNatPolicyDrgNatRuleArgs args)
public DrgNatPolicyDrgNatRule(String name, DrgNatPolicyDrgNatRuleArgs args, CustomResourceOptions options)
type: oci:Core:DrgNatPolicyDrgNatRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "oci_core_drg_nat_policy_drg_nat_rule" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args DrgNatPolicyDrgNatRuleArgs
- 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 DrgNatPolicyDrgNatRuleArgs
- 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 DrgNatPolicyDrgNatRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DrgNatPolicyDrgNatRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DrgNatPolicyDrgNatRuleArgs
- 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 drgNatPolicyDrgNatRuleResource = new Oci.Core.DrgNatPolicyDrgNatRule("drgNatPolicyDrgNatRuleResource", new()
{
DrgNatPolicyId = "string",
DrgNatRulePriority = 0,
OriginalDestination = "string",
OriginalSource = "string",
TranslatedDestination = "string",
TranslatedSource = "string",
});
example, err := core.NewDrgNatPolicyDrgNatRule(ctx, "drgNatPolicyDrgNatRuleResource", &core.DrgNatPolicyDrgNatRuleArgs{
DrgNatPolicyId: pulumi.String("string"),
DrgNatRulePriority: pulumi.Int(0),
OriginalDestination: pulumi.String("string"),
OriginalSource: pulumi.String("string"),
TranslatedDestination: pulumi.String("string"),
TranslatedSource: pulumi.String("string"),
})
resource "oci_core_drg_nat_policy_drg_nat_rule" "drgNatPolicyDrgNatRuleResource" {
lifecycle {
create_before_destroy = true
}
drg_nat_policy_id = "string"
drg_nat_rule_priority = 0
original_destination = "string"
original_source = "string"
translated_destination = "string"
translated_source = "string"
}
var drgNatPolicyDrgNatRuleResource = new DrgNatPolicyDrgNatRule("drgNatPolicyDrgNatRuleResource", DrgNatPolicyDrgNatRuleArgs.builder()
.drgNatPolicyId("string")
.drgNatRulePriority(0)
.originalDestination("string")
.originalSource("string")
.translatedDestination("string")
.translatedSource("string")
.build());
drg_nat_policy_drg_nat_rule_resource = oci.core.DrgNatPolicyDrgNatRule("drgNatPolicyDrgNatRuleResource",
drg_nat_policy_id="string",
drg_nat_rule_priority=0,
original_destination="string",
original_source="string",
translated_destination="string",
translated_source="string")
const drgNatPolicyDrgNatRuleResource = new oci.core.DrgNatPolicyDrgNatRule("drgNatPolicyDrgNatRuleResource", {
drgNatPolicyId: "string",
drgNatRulePriority: 0,
originalDestination: "string",
originalSource: "string",
translatedDestination: "string",
translatedSource: "string",
});
type: oci:Core:DrgNatPolicyDrgNatRule
properties:
drgNatPolicyId: string
drgNatRulePriority: 0
originalDestination: string
originalSource: string
translatedDestination: string
translatedSource: string
DrgNatPolicyDrgNatRule 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 DrgNatPolicyDrgNatRule resource accepts the following input properties:
- Drg
Nat stringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- Drg
Nat intRule Priority - (Updatable) The priority associated with each DrgNatRule.
- Original
Destination string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- Original
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- Translated
Destination string (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- Translated
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- Drg
Nat stringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- Drg
Nat intRule Priority - (Updatable) The priority associated with each DrgNatRule.
- Original
Destination string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- Original
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- Translated
Destination string (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- Translated
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg_
nat_ stringpolicy_ id - The DrgNatPolicy's Oracle ID (OCID).
- drg_
nat_ numberrule_ priority - (Updatable) The priority associated with each DrgNatRule.
- original_
destination string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original_
source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated_
destination string (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated_
source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg
Nat StringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- drg
Nat IntegerRule Priority - (Updatable) The priority associated with each DrgNatRule.
- original
Destination String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original
Source String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated
Destination String (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated
Source String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg
Nat stringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- drg
Nat numberRule Priority - (Updatable) The priority associated with each DrgNatRule.
- original
Destination string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated
Destination string (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg_
nat_ strpolicy_ id - The DrgNatPolicy's Oracle ID (OCID).
- drg_
nat_ intrule_ priority - (Updatable) The priority associated with each DrgNatRule.
- original_
destination str - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original_
source str - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated_
destination str (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated_
source str - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg
Nat StringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- drg
Nat NumberRule Priority - (Updatable) The priority associated with each DrgNatRule.
- original
Destination String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original
Source String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated
Destination String (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated
Source String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
Outputs
All input properties are implicitly available as output properties. Additionally, the DrgNatPolicyDrgNatRule 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 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 DrgNatPolicyDrgNatRule Resource
Get an existing DrgNatPolicyDrgNatRule 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?: DrgNatPolicyDrgNatRuleState, opts?: CustomResourceOptions): DrgNatPolicyDrgNatRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
drg_nat_policy_id: Optional[str] = None,
drg_nat_rule_priority: Optional[int] = None,
original_destination: Optional[str] = None,
original_source: Optional[str] = None,
translated_destination: Optional[str] = None,
translated_source: Optional[str] = None) -> DrgNatPolicyDrgNatRulefunc GetDrgNatPolicyDrgNatRule(ctx *Context, name string, id IDInput, state *DrgNatPolicyDrgNatRuleState, opts ...ResourceOption) (*DrgNatPolicyDrgNatRule, error)public static DrgNatPolicyDrgNatRule Get(string name, Input<string> id, DrgNatPolicyDrgNatRuleState? state, CustomResourceOptions? opts = null)public static DrgNatPolicyDrgNatRule get(String name, Output<String> id, DrgNatPolicyDrgNatRuleState state, CustomResourceOptions options)resources: _: type: oci:Core:DrgNatPolicyDrgNatRule get: id: ${id}import {
to = oci_core_drg_nat_policy_drg_nat_rule.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.
- Drg
Nat stringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- Drg
Nat intRule Priority - (Updatable) The priority associated with each DrgNatRule.
- Original
Destination string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- Original
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- Translated
Destination string (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- Translated
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- Drg
Nat stringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- Drg
Nat intRule Priority - (Updatable) The priority associated with each DrgNatRule.
- Original
Destination string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- Original
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- Translated
Destination string (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- Translated
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg_
nat_ stringpolicy_ id - The DrgNatPolicy's Oracle ID (OCID).
- drg_
nat_ numberrule_ priority - (Updatable) The priority associated with each DrgNatRule.
- original_
destination string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original_
source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated_
destination string (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated_
source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg
Nat StringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- drg
Nat IntegerRule Priority - (Updatable) The priority associated with each DrgNatRule.
- original
Destination String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original
Source String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated
Destination String (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated
Source String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg
Nat stringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- drg
Nat numberRule Priority - (Updatable) The priority associated with each DrgNatRule.
- original
Destination string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated
Destination string (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated
Source string - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg_
nat_ strpolicy_ id - The DrgNatPolicy's Oracle ID (OCID).
- drg_
nat_ intrule_ priority - (Updatable) The priority associated with each DrgNatRule.
- original_
destination str - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original_
source str - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated_
destination str (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated_
source str - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
- drg
Nat StringPolicy Id - The DrgNatPolicy's Oracle ID (OCID).
- drg
Nat NumberRule Priority - (Updatable) The priority associated with each DrgNatRule.
- original
Destination String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Destination NAT.
- original
Source String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Original CIDR range for Source NAT.
- translated
Destination String (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Destination NAT.
IMPORTANT Changing certain properties that do not support update will force destruction and recreation of the resource with new property values.
- translated
Source String - (Updatable) Represents the range of IP addresses to match against when routing traffic. Translated CIDR range for Source NAT.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ociTerraform Provider.
published on Tuesday, Oct 13, 2026 by Pulumi