1. Packages
  2. Confluent Cloud
  3. API Docs
  4. DnsForwarder
Confluent v2.3.0 published on Friday, Sep 27, 2024 by Pulumi

confluentcloud.DnsForwarder

Explore with Pulumi AI

confluentcloud logo
Confluent v2.3.0 published on Friday, Sep 27, 2024 by Pulumi

    General Availability

    confluentcloud.DnsForwarder provides a DNS Forwarder resource that enables creating, editing, and deleting DNS Forwarders on Confluent Cloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as confluentcloud from "@pulumi/confluentcloud";
    
    const development = new confluentcloud.Environment("development", {displayName: "Development"});
    const main = new confluentcloud.DnsForwarder("main", {
        displayName: "dns_forwarder",
        environment: {
            id: development.id,
        },
        domains: [
            "example.com",
            "domainname.com",
        ],
        gateway: {
            id: mainConfluentNetwork.gateway[0].id,
        },
        forwardViaIp: {
            dnsServerIps: [
                "10.200.0.0",
                "10.200.0.1",
            ],
        },
    });
    
    import pulumi
    import pulumi_confluentcloud as confluentcloud
    
    development = confluentcloud.Environment("development", display_name="Development")
    main = confluentcloud.DnsForwarder("main",
        display_name="dns_forwarder",
        environment={
            "id": development.id,
        },
        domains=[
            "example.com",
            "domainname.com",
        ],
        gateway={
            "id": main_confluent_network["gateway"][0]["id"],
        },
        forward_via_ip={
            "dns_server_ips": [
                "10.200.0.0",
                "10.200.0.1",
            ],
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-confluentcloud/sdk/v2/go/confluentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		development, err := confluentcloud.NewEnvironment(ctx, "development", &confluentcloud.EnvironmentArgs{
    			DisplayName: pulumi.String("Development"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = confluentcloud.NewDnsForwarder(ctx, "main", &confluentcloud.DnsForwarderArgs{
    			DisplayName: pulumi.String("dns_forwarder"),
    			Environment: &confluentcloud.DnsForwarderEnvironmentArgs{
    				Id: development.ID(),
    			},
    			Domains: pulumi.StringArray{
    				pulumi.String("example.com"),
    				pulumi.String("domainname.com"),
    			},
    			Gateway: &confluentcloud.DnsForwarderGatewayArgs{
    				Id: pulumi.Any(mainConfluentNetwork.Gateway[0].Id),
    			},
    			ForwardViaIp: &confluentcloud.DnsForwarderForwardViaIpArgs{
    				DnsServerIps: pulumi.StringArray{
    					pulumi.String("10.200.0.0"),
    					pulumi.String("10.200.0.1"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using ConfluentCloud = Pulumi.ConfluentCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var development = new ConfluentCloud.Environment("development", new()
        {
            DisplayName = "Development",
        });
    
        var main = new ConfluentCloud.DnsForwarder("main", new()
        {
            DisplayName = "dns_forwarder",
            Environment = new ConfluentCloud.Inputs.DnsForwarderEnvironmentArgs
            {
                Id = development.Id,
            },
            Domains = new[]
            {
                "example.com",
                "domainname.com",
            },
            Gateway = new ConfluentCloud.Inputs.DnsForwarderGatewayArgs
            {
                Id = mainConfluentNetwork.Gateway[0].Id,
            },
            ForwardViaIp = new ConfluentCloud.Inputs.DnsForwarderForwardViaIpArgs
            {
                DnsServerIps = new[]
                {
                    "10.200.0.0",
                    "10.200.0.1",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.confluentcloud.Environment;
    import com.pulumi.confluentcloud.EnvironmentArgs;
    import com.pulumi.confluentcloud.DnsForwarder;
    import com.pulumi.confluentcloud.DnsForwarderArgs;
    import com.pulumi.confluentcloud.inputs.DnsForwarderEnvironmentArgs;
    import com.pulumi.confluentcloud.inputs.DnsForwarderGatewayArgs;
    import com.pulumi.confluentcloud.inputs.DnsForwarderForwardViaIpArgs;
    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 development = new Environment("development", EnvironmentArgs.builder()
                .displayName("Development")
                .build());
    
            var main = new DnsForwarder("main", DnsForwarderArgs.builder()
                .displayName("dns_forwarder")
                .environment(DnsForwarderEnvironmentArgs.builder()
                    .id(development.id())
                    .build())
                .domains(            
                    "example.com",
                    "domainname.com")
                .gateway(DnsForwarderGatewayArgs.builder()
                    .id(mainConfluentNetwork.gateway()[0].id())
                    .build())
                .forwardViaIp(DnsForwarderForwardViaIpArgs.builder()
                    .dnsServerIps(                
                        "10.200.0.0",
                        "10.200.0.1")
                    .build())
                .build());
    
        }
    }
    
    resources:
      development:
        type: confluentcloud:Environment
        properties:
          displayName: Development
      main:
        type: confluentcloud:DnsForwarder
        properties:
          displayName: dns_forwarder
          environment:
            id: ${development.id}
          domains:
            - example.com
            - domainname.com
          gateway:
            id: ${mainConfluentNetwork.gateway[0].id}
          forwardViaIp:
            dnsServerIps:
              - 10.200.0.0
              - 10.200.0.1
    

    Create DnsForwarder Resource

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

    Constructor syntax

    new DnsForwarder(name: string, args: DnsForwarderArgs, opts?: CustomResourceOptions);
    @overload
    def DnsForwarder(resource_name: str,
                     args: DnsForwarderArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def DnsForwarder(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     domains: Optional[Sequence[str]] = None,
                     environment: Optional[DnsForwarderEnvironmentArgs] = None,
                     gateway: Optional[DnsForwarderGatewayArgs] = None,
                     display_name: Optional[str] = None,
                     forward_via_ip: Optional[DnsForwarderForwardViaIpArgs] = None)
    func NewDnsForwarder(ctx *Context, name string, args DnsForwarderArgs, opts ...ResourceOption) (*DnsForwarder, error)
    public DnsForwarder(string name, DnsForwarderArgs args, CustomResourceOptions? opts = null)
    public DnsForwarder(String name, DnsForwarderArgs args)
    public DnsForwarder(String name, DnsForwarderArgs args, CustomResourceOptions options)
    
    type: confluentcloud:DnsForwarder
    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 DnsForwarderArgs
    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 DnsForwarderArgs
    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 DnsForwarderArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DnsForwarderArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DnsForwarderArgs
    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 dnsForwarderResource = new ConfluentCloud.DnsForwarder("dnsForwarderResource", new()
    {
        Domains = new[]
        {
            "string",
        },
        Environment = new ConfluentCloud.Inputs.DnsForwarderEnvironmentArgs
        {
            Id = "string",
        },
        Gateway = new ConfluentCloud.Inputs.DnsForwarderGatewayArgs
        {
            Id = "string",
        },
        DisplayName = "string",
        ForwardViaIp = new ConfluentCloud.Inputs.DnsForwarderForwardViaIpArgs
        {
            DnsServerIps = new[]
            {
                "string",
            },
        },
    });
    
    example, err := confluentcloud.NewDnsForwarder(ctx, "dnsForwarderResource", &confluentcloud.DnsForwarderArgs{
    	Domains: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Environment: &confluentcloud.DnsForwarderEnvironmentArgs{
    		Id: pulumi.String("string"),
    	},
    	Gateway: &confluentcloud.DnsForwarderGatewayArgs{
    		Id: pulumi.String("string"),
    	},
    	DisplayName: pulumi.String("string"),
    	ForwardViaIp: &confluentcloud.DnsForwarderForwardViaIpArgs{
    		DnsServerIps: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    })
    
    var dnsForwarderResource = new DnsForwarder("dnsForwarderResource", DnsForwarderArgs.builder()
        .domains("string")
        .environment(DnsForwarderEnvironmentArgs.builder()
            .id("string")
            .build())
        .gateway(DnsForwarderGatewayArgs.builder()
            .id("string")
            .build())
        .displayName("string")
        .forwardViaIp(DnsForwarderForwardViaIpArgs.builder()
            .dnsServerIps("string")
            .build())
        .build());
    
    dns_forwarder_resource = confluentcloud.DnsForwarder("dnsForwarderResource",
        domains=["string"],
        environment=confluentcloud.DnsForwarderEnvironmentArgs(
            id="string",
        ),
        gateway=confluentcloud.DnsForwarderGatewayArgs(
            id="string",
        ),
        display_name="string",
        forward_via_ip=confluentcloud.DnsForwarderForwardViaIpArgs(
            dns_server_ips=["string"],
        ))
    
    const dnsForwarderResource = new confluentcloud.DnsForwarder("dnsForwarderResource", {
        domains: ["string"],
        environment: {
            id: "string",
        },
        gateway: {
            id: "string",
        },
        displayName: "string",
        forwardViaIp: {
            dnsServerIps: ["string"],
        },
    });
    
    type: confluentcloud:DnsForwarder
    properties:
        displayName: string
        domains:
            - string
        environment:
            id: string
        forwardViaIp:
            dnsServerIps:
                - string
        gateway:
            id: string
    

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

    Domains List<string>
    List of domains for the DNS forwarder to use.
    Environment Pulumi.ConfluentCloud.Inputs.DnsForwarderEnvironment
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    Gateway Pulumi.ConfluentCloud.Inputs.DnsForwarderGateway
    DisplayName string
    The name of the DNS Forwarder.
    ForwardViaIp Pulumi.ConfluentCloud.Inputs.DnsForwarderForwardViaIp
    Domains []string
    List of domains for the DNS forwarder to use.
    Environment DnsForwarderEnvironmentArgs
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    Gateway DnsForwarderGatewayArgs
    DisplayName string
    The name of the DNS Forwarder.
    ForwardViaIp DnsForwarderForwardViaIpArgs
    domains List<String>
    List of domains for the DNS forwarder to use.
    environment DnsForwarderEnvironment
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    gateway DnsForwarderGateway
    displayName String
    The name of the DNS Forwarder.
    forwardViaIp DnsForwarderForwardViaIp
    domains string[]
    List of domains for the DNS forwarder to use.
    environment DnsForwarderEnvironment
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    gateway DnsForwarderGateway
    displayName string
    The name of the DNS Forwarder.
    forwardViaIp DnsForwarderForwardViaIp
    domains Sequence[str]
    List of domains for the DNS forwarder to use.
    environment DnsForwarderEnvironmentArgs
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    gateway DnsForwarderGatewayArgs
    display_name str
    The name of the DNS Forwarder.
    forward_via_ip DnsForwarderForwardViaIpArgs
    domains List<String>
    List of domains for the DNS forwarder to use.
    environment Property Map
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    gateway Property Map
    displayName String
    The name of the DNS Forwarder.
    forwardViaIp Property Map

    Outputs

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

    Get an existing DnsForwarder 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?: DnsForwarderState, opts?: CustomResourceOptions): DnsForwarder
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            display_name: Optional[str] = None,
            domains: Optional[Sequence[str]] = None,
            environment: Optional[DnsForwarderEnvironmentArgs] = None,
            forward_via_ip: Optional[DnsForwarderForwardViaIpArgs] = None,
            gateway: Optional[DnsForwarderGatewayArgs] = None) -> DnsForwarder
    func GetDnsForwarder(ctx *Context, name string, id IDInput, state *DnsForwarderState, opts ...ResourceOption) (*DnsForwarder, error)
    public static DnsForwarder Get(string name, Input<string> id, DnsForwarderState? state, CustomResourceOptions? opts = null)
    public static DnsForwarder get(String name, Output<String> id, DnsForwarderState 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.
    The following state arguments are supported:
    DisplayName string
    The name of the DNS Forwarder.
    Domains List<string>
    List of domains for the DNS forwarder to use.
    Environment Pulumi.ConfluentCloud.Inputs.DnsForwarderEnvironment
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    ForwardViaIp Pulumi.ConfluentCloud.Inputs.DnsForwarderForwardViaIp
    Gateway Pulumi.ConfluentCloud.Inputs.DnsForwarderGateway
    DisplayName string
    The name of the DNS Forwarder.
    Domains []string
    List of domains for the DNS forwarder to use.
    Environment DnsForwarderEnvironmentArgs
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    ForwardViaIp DnsForwarderForwardViaIpArgs
    Gateway DnsForwarderGatewayArgs
    displayName String
    The name of the DNS Forwarder.
    domains List<String>
    List of domains for the DNS forwarder to use.
    environment DnsForwarderEnvironment
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    forwardViaIp DnsForwarderForwardViaIp
    gateway DnsForwarderGateway
    displayName string
    The name of the DNS Forwarder.
    domains string[]
    List of domains for the DNS forwarder to use.
    environment DnsForwarderEnvironment
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    forwardViaIp DnsForwarderForwardViaIp
    gateway DnsForwarderGateway
    display_name str
    The name of the DNS Forwarder.
    domains Sequence[str]
    List of domains for the DNS forwarder to use.
    environment DnsForwarderEnvironmentArgs
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    forward_via_ip DnsForwarderForwardViaIpArgs
    gateway DnsForwarderGatewayArgs
    displayName String
    The name of the DNS Forwarder.
    domains List<String>
    List of domains for the DNS forwarder to use.
    environment Property Map
    Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
    forwardViaIp Property Map
    gateway Property Map

    Supporting Types

    DnsForwarderEnvironment, DnsForwarderEnvironmentArgs

    Id string
    The ID of the Environment that the DNS Forwarder belongs to, for example, env-abc123.
    Id string
    The ID of the Environment that the DNS Forwarder belongs to, for example, env-abc123.
    id String
    The ID of the Environment that the DNS Forwarder belongs to, for example, env-abc123.
    id string
    The ID of the Environment that the DNS Forwarder belongs to, for example, env-abc123.
    id str
    The ID of the Environment that the DNS Forwarder belongs to, for example, env-abc123.
    id String
    The ID of the Environment that the DNS Forwarder belongs to, for example, env-abc123.

    DnsForwarderForwardViaIp, DnsForwarderForwardViaIpArgs

    DnsServerIps List<string>
    List of IP addresses of the DNS server.
    DnsServerIps []string
    List of IP addresses of the DNS server.
    dnsServerIps List<String>
    List of IP addresses of the DNS server.
    dnsServerIps string[]
    List of IP addresses of the DNS server.
    dns_server_ips Sequence[str]
    List of IP addresses of the DNS server.
    dnsServerIps List<String>
    List of IP addresses of the DNS server.

    DnsForwarderGateway, DnsForwarderGatewayArgs

    Id string
    The ID of the gateway to which the DNS Forwarder belongs, for example, gw-abc123.
    Id string
    The ID of the gateway to which the DNS Forwarder belongs, for example, gw-abc123.
    id String
    The ID of the gateway to which the DNS Forwarder belongs, for example, gw-abc123.
    id string
    The ID of the gateway to which the DNS Forwarder belongs, for example, gw-abc123.
    id str
    The ID of the gateway to which the DNS Forwarder belongs, for example, gw-abc123.
    id String
    The ID of the gateway to which the DNS Forwarder belongs, for example, gw-abc123.

    Import

    You can import a DNS Forwarder by using Environment ID and DNS Forwarder ID, in the format <Environment ID>/<DNS Forwarder ID>. The following example shows how to import a DNS Forwarder:

    $ export CONFLUENT_CLOUD_API_KEY="<cloud_api_key>"

    $ export CONFLUENT_CLOUD_API_SECRET="<cloud_api_secret>"

    $ pulumi import confluentcloud:index/dnsForwarder:DnsForwarder main env-abc123/dnsf-abc123
    

    !> Warning: Do not forget to delete terminal command history afterwards for security purposes.

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

    Package Details

    Repository
    Confluent Cloud pulumi/pulumi-confluentcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the confluent Terraform Provider.
    confluentcloud logo
    Confluent v2.3.0 published on Friday, Sep 27, 2024 by Pulumi