1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. PrivateDnsForwardRule
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.PrivateDnsForwardRule

Explore with Pulumi AI

Provides a resource to create a privatedns forward rule

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const examplePrivateDnsExtendEndPoint = new tencentcloud.PrivateDnsExtendEndPoint("examplePrivateDnsExtendEndPoint", {
    endPointName: "tf-example",
    endPointRegion: "ap-jakarta",
    forwardIp: {
        accessType: "CCN",
        host: "1.1.1.1",
        port: 8080,
        vpcId: "vpc-2qjckjg2",
        accessGatewayId: "ccn-eo13f8ub",
    },
});
const examplePrivateDnsForwardRule = new tencentcloud.PrivateDnsForwardRule("examplePrivateDnsForwardRule", {
    ruleName: "tf-example",
    ruleType: "DOWN",
    zoneId: "zone-cmmbvaq8",
    endPointId: examplePrivateDnsExtendEndPoint.privateDnsExtendEndPointId,
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

example_private_dns_extend_end_point = tencentcloud.PrivateDnsExtendEndPoint("examplePrivateDnsExtendEndPoint",
    end_point_name="tf-example",
    end_point_region="ap-jakarta",
    forward_ip={
        "access_type": "CCN",
        "host": "1.1.1.1",
        "port": 8080,
        "vpc_id": "vpc-2qjckjg2",
        "access_gateway_id": "ccn-eo13f8ub",
    })
example_private_dns_forward_rule = tencentcloud.PrivateDnsForwardRule("examplePrivateDnsForwardRule",
    rule_name="tf-example",
    rule_type="DOWN",
    zone_id="zone-cmmbvaq8",
    end_point_id=example_private_dns_extend_end_point.private_dns_extend_end_point_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		examplePrivateDnsExtendEndPoint, err := tencentcloud.NewPrivateDnsExtendEndPoint(ctx, "examplePrivateDnsExtendEndPoint", &tencentcloud.PrivateDnsExtendEndPointArgs{
			EndPointName:   pulumi.String("tf-example"),
			EndPointRegion: pulumi.String("ap-jakarta"),
			ForwardIp: &tencentcloud.PrivateDnsExtendEndPointForwardIpArgs{
				AccessType:      pulumi.String("CCN"),
				Host:            pulumi.String("1.1.1.1"),
				Port:            pulumi.Float64(8080),
				VpcId:           pulumi.String("vpc-2qjckjg2"),
				AccessGatewayId: pulumi.String("ccn-eo13f8ub"),
			},
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewPrivateDnsForwardRule(ctx, "examplePrivateDnsForwardRule", &tencentcloud.PrivateDnsForwardRuleArgs{
			RuleName:   pulumi.String("tf-example"),
			RuleType:   pulumi.String("DOWN"),
			ZoneId:     pulumi.String("zone-cmmbvaq8"),
			EndPointId: examplePrivateDnsExtendEndPoint.PrivateDnsExtendEndPointId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var examplePrivateDnsExtendEndPoint = new Tencentcloud.PrivateDnsExtendEndPoint("examplePrivateDnsExtendEndPoint", new()
    {
        EndPointName = "tf-example",
        EndPointRegion = "ap-jakarta",
        ForwardIp = new Tencentcloud.Inputs.PrivateDnsExtendEndPointForwardIpArgs
        {
            AccessType = "CCN",
            Host = "1.1.1.1",
            Port = 8080,
            VpcId = "vpc-2qjckjg2",
            AccessGatewayId = "ccn-eo13f8ub",
        },
    });

    var examplePrivateDnsForwardRule = new Tencentcloud.PrivateDnsForwardRule("examplePrivateDnsForwardRule", new()
    {
        RuleName = "tf-example",
        RuleType = "DOWN",
        ZoneId = "zone-cmmbvaq8",
        EndPointId = examplePrivateDnsExtendEndPoint.PrivateDnsExtendEndPointId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PrivateDnsExtendEndPoint;
import com.pulumi.tencentcloud.PrivateDnsExtendEndPointArgs;
import com.pulumi.tencentcloud.inputs.PrivateDnsExtendEndPointForwardIpArgs;
import com.pulumi.tencentcloud.PrivateDnsForwardRule;
import com.pulumi.tencentcloud.PrivateDnsForwardRuleArgs;
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 examplePrivateDnsExtendEndPoint = new PrivateDnsExtendEndPoint("examplePrivateDnsExtendEndPoint", PrivateDnsExtendEndPointArgs.builder()
            .endPointName("tf-example")
            .endPointRegion("ap-jakarta")
            .forwardIp(PrivateDnsExtendEndPointForwardIpArgs.builder()
                .accessType("CCN")
                .host("1.1.1.1")
                .port(8080)
                .vpcId("vpc-2qjckjg2")
                .accessGatewayId("ccn-eo13f8ub")
                .build())
            .build());

        var examplePrivateDnsForwardRule = new PrivateDnsForwardRule("examplePrivateDnsForwardRule", PrivateDnsForwardRuleArgs.builder()
            .ruleName("tf-example")
            .ruleType("DOWN")
            .zoneId("zone-cmmbvaq8")
            .endPointId(examplePrivateDnsExtendEndPoint.privateDnsExtendEndPointId())
            .build());

    }
}
Copy
resources:
  examplePrivateDnsExtendEndPoint:
    type: tencentcloud:PrivateDnsExtendEndPoint
    properties:
      endPointName: tf-example
      endPointRegion: ap-jakarta
      forwardIp:
        accessType: CCN
        host: 1.1.1.1
        port: 8080
        vpcId: vpc-2qjckjg2
        accessGatewayId: ccn-eo13f8ub
  examplePrivateDnsForwardRule:
    type: tencentcloud:PrivateDnsForwardRule
    properties:
      ruleName: tf-example
      ruleType: DOWN
      zoneId: zone-cmmbvaq8
      endPointId: ${examplePrivateDnsExtendEndPoint.privateDnsExtendEndPointId}
Copy

Create PrivateDnsForwardRule Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new PrivateDnsForwardRule(name: string, args: PrivateDnsForwardRuleArgs, opts?: CustomResourceOptions);
@overload
def PrivateDnsForwardRule(resource_name: str,
                          args: PrivateDnsForwardRuleArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def PrivateDnsForwardRule(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          end_point_id: Optional[str] = None,
                          rule_name: Optional[str] = None,
                          rule_type: Optional[str] = None,
                          zone_id: Optional[str] = None,
                          private_dns_forward_rule_id: Optional[str] = None)
func NewPrivateDnsForwardRule(ctx *Context, name string, args PrivateDnsForwardRuleArgs, opts ...ResourceOption) (*PrivateDnsForwardRule, error)
public PrivateDnsForwardRule(string name, PrivateDnsForwardRuleArgs args, CustomResourceOptions? opts = null)
public PrivateDnsForwardRule(String name, PrivateDnsForwardRuleArgs args)
public PrivateDnsForwardRule(String name, PrivateDnsForwardRuleArgs args, CustomResourceOptions options)
type: tencentcloud:PrivateDnsForwardRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PrivateDnsForwardRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. PrivateDnsForwardRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. PrivateDnsForwardRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PrivateDnsForwardRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PrivateDnsForwardRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

PrivateDnsForwardRule 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 PrivateDnsForwardRule resource accepts the following input properties:

EndPointId This property is required. string
Endpoint ID.
RuleName This property is required. string
Forwarding rule name.
RuleType This property is required. string
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
ZoneId This property is required. string
Private domain ID, which can be viewed on the private domain list page.
PrivateDnsForwardRuleId string
ID of the resource.
EndPointId This property is required. string
Endpoint ID.
RuleName This property is required. string
Forwarding rule name.
RuleType This property is required. string
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
ZoneId This property is required. string
Private domain ID, which can be viewed on the private domain list page.
PrivateDnsForwardRuleId string
ID of the resource.
endPointId This property is required. String
Endpoint ID.
ruleName This property is required. String
Forwarding rule name.
ruleType This property is required. String
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
zoneId This property is required. String
Private domain ID, which can be viewed on the private domain list page.
privateDnsForwardRuleId String
ID of the resource.
endPointId This property is required. string
Endpoint ID.
ruleName This property is required. string
Forwarding rule name.
ruleType This property is required. string
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
zoneId This property is required. string
Private domain ID, which can be viewed on the private domain list page.
privateDnsForwardRuleId string
ID of the resource.
end_point_id This property is required. str
Endpoint ID.
rule_name This property is required. str
Forwarding rule name.
rule_type This property is required. str
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
zone_id This property is required. str
Private domain ID, which can be viewed on the private domain list page.
private_dns_forward_rule_id str
ID of the resource.
endPointId This property is required. String
Endpoint ID.
ruleName This property is required. String
Forwarding rule name.
ruleType This property is required. String
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
zoneId This property is required. String
Private domain ID, which can be viewed on the private domain list page.
privateDnsForwardRuleId String
ID of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the PrivateDnsForwardRule 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 PrivateDnsForwardRule Resource

Get an existing PrivateDnsForwardRule 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?: PrivateDnsForwardRuleState, opts?: CustomResourceOptions): PrivateDnsForwardRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        end_point_id: Optional[str] = None,
        private_dns_forward_rule_id: Optional[str] = None,
        rule_name: Optional[str] = None,
        rule_type: Optional[str] = None,
        zone_id: Optional[str] = None) -> PrivateDnsForwardRule
func GetPrivateDnsForwardRule(ctx *Context, name string, id IDInput, state *PrivateDnsForwardRuleState, opts ...ResourceOption) (*PrivateDnsForwardRule, error)
public static PrivateDnsForwardRule Get(string name, Input<string> id, PrivateDnsForwardRuleState? state, CustomResourceOptions? opts = null)
public static PrivateDnsForwardRule get(String name, Output<String> id, PrivateDnsForwardRuleState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:PrivateDnsForwardRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
EndPointId string
Endpoint ID.
PrivateDnsForwardRuleId string
ID of the resource.
RuleName string
Forwarding rule name.
RuleType string
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
ZoneId string
Private domain ID, which can be viewed on the private domain list page.
EndPointId string
Endpoint ID.
PrivateDnsForwardRuleId string
ID of the resource.
RuleName string
Forwarding rule name.
RuleType string
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
ZoneId string
Private domain ID, which can be viewed on the private domain list page.
endPointId String
Endpoint ID.
privateDnsForwardRuleId String
ID of the resource.
ruleName String
Forwarding rule name.
ruleType String
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
zoneId String
Private domain ID, which can be viewed on the private domain list page.
endPointId string
Endpoint ID.
privateDnsForwardRuleId string
ID of the resource.
ruleName string
Forwarding rule name.
ruleType string
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
zoneId string
Private domain ID, which can be viewed on the private domain list page.
end_point_id str
Endpoint ID.
private_dns_forward_rule_id str
ID of the resource.
rule_name str
Forwarding rule name.
rule_type str
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
zone_id str
Private domain ID, which can be viewed on the private domain list page.
endPointId String
Endpoint ID.
privateDnsForwardRuleId String
ID of the resource.
ruleName String
Forwarding rule name.
ruleType String
Forwarding rule type. DOWN: From cloud to off-cloud; UP: From off-cloud to cloud.
zoneId String
Private domain ID, which can be viewed on the private domain list page.

Import

private dns forward rule can be imported using the id, e.g.

$ pulumi import tencentcloud:index/privateDnsForwardRule:PrivateDnsForwardRule example fid-dbc2c0a97c
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.