1. Packages
  2. Confluent Provider
  3. API Docs
  4. DnsRecord
Confluent v2.23.0 published on Tuesday, Apr 1, 2025 by Pulumi

confluentcloud.DnsRecord

Explore with Pulumi AI

General Availability

confluentcloud.DnsRecord provides a DNS Record resource that enables creating, editing, and deleting DNS Records 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.DnsRecord("main", {
    displayName: "dns_record",
    environment: {
        id: development.id,
    },
    domain: "example.com",
    gateway: {
        id: mainConfluentNetwork.gateway[0].id,
    },
    privateLinkAccessPoint: {
        id: mainConfluentAccessPoint.id,
    },
});
Copy
import pulumi
import pulumi_confluentcloud as confluentcloud

development = confluentcloud.Environment("development", display_name="Development")
main = confluentcloud.DnsRecord("main",
    display_name="dns_record",
    environment={
        "id": development.id,
    },
    domain="example.com",
    gateway={
        "id": main_confluent_network["gateway"][0]["id"],
    },
    private_link_access_point={
        "id": main_confluent_access_point["id"],
    })
Copy
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.NewDnsRecord(ctx, "main", &confluentcloud.DnsRecordArgs{
			DisplayName: pulumi.String("dns_record"),
			Environment: &confluentcloud.DnsRecordEnvironmentArgs{
				Id: development.ID(),
			},
			Domain: pulumi.String("example.com"),
			Gateway: &confluentcloud.DnsRecordGatewayArgs{
				Id: pulumi.Any(mainConfluentNetwork.Gateway[0].Id),
			},
			PrivateLinkAccessPoint: &confluentcloud.DnsRecordPrivateLinkAccessPointArgs{
				Id: pulumi.Any(mainConfluentAccessPoint.Id),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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.DnsRecord("main", new()
    {
        DisplayName = "dns_record",
        Environment = new ConfluentCloud.Inputs.DnsRecordEnvironmentArgs
        {
            Id = development.Id,
        },
        Domain = "example.com",
        Gateway = new ConfluentCloud.Inputs.DnsRecordGatewayArgs
        {
            Id = mainConfluentNetwork.Gateway[0].Id,
        },
        PrivateLinkAccessPoint = new ConfluentCloud.Inputs.DnsRecordPrivateLinkAccessPointArgs
        {
            Id = mainConfluentAccessPoint.Id,
        },
    });

});
Copy
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.DnsRecord;
import com.pulumi.confluentcloud.DnsRecordArgs;
import com.pulumi.confluentcloud.inputs.DnsRecordEnvironmentArgs;
import com.pulumi.confluentcloud.inputs.DnsRecordGatewayArgs;
import com.pulumi.confluentcloud.inputs.DnsRecordPrivateLinkAccessPointArgs;
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 DnsRecord("main", DnsRecordArgs.builder()
            .displayName("dns_record")
            .environment(DnsRecordEnvironmentArgs.builder()
                .id(development.id())
                .build())
            .domain("example.com")
            .gateway(DnsRecordGatewayArgs.builder()
                .id(mainConfluentNetwork.gateway()[0].id())
                .build())
            .privateLinkAccessPoint(DnsRecordPrivateLinkAccessPointArgs.builder()
                .id(mainConfluentAccessPoint.id())
                .build())
            .build());

    }
}
Copy
resources:
  development:
    type: confluentcloud:Environment
    properties:
      displayName: Development
  main:
    type: confluentcloud:DnsRecord
    properties:
      displayName: dns_record
      environment:
        id: ${development.id}
      domain: example.com
      gateway:
        id: ${mainConfluentNetwork.gateway[0].id}
      privateLinkAccessPoint:
        id: ${mainConfluentAccessPoint.id}
Copy

Create DnsRecord Resource

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

Constructor syntax

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

@overload
def DnsRecord(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              domain: Optional[str] = None,
              environment: Optional[DnsRecordEnvironmentArgs] = None,
              gateway: Optional[DnsRecordGatewayArgs] = None,
              display_name: Optional[str] = None,
              private_link_access_point: Optional[DnsRecordPrivateLinkAccessPointArgs] = None)
func NewDnsRecord(ctx *Context, name string, args DnsRecordArgs, opts ...ResourceOption) (*DnsRecord, error)
public DnsRecord(string name, DnsRecordArgs args, CustomResourceOptions? opts = null)
public DnsRecord(String name, DnsRecordArgs args)
public DnsRecord(String name, DnsRecordArgs args, CustomResourceOptions options)
type: confluentcloud:DnsRecord
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. DnsRecordArgs
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. DnsRecordArgs
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. DnsRecordArgs
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. DnsRecordArgs
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. DnsRecordArgs
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 dnsRecordResource = new ConfluentCloud.DnsRecord("dnsRecordResource", new()
{
    Domain = "string",
    Environment = new ConfluentCloud.Inputs.DnsRecordEnvironmentArgs
    {
        Id = "string",
    },
    Gateway = new ConfluentCloud.Inputs.DnsRecordGatewayArgs
    {
        Id = "string",
    },
    DisplayName = "string",
    PrivateLinkAccessPoint = new ConfluentCloud.Inputs.DnsRecordPrivateLinkAccessPointArgs
    {
        Id = "string",
    },
});
Copy
example, err := confluentcloud.NewDnsRecord(ctx, "dnsRecordResource", &confluentcloud.DnsRecordArgs{
	Domain: pulumi.String("string"),
	Environment: &confluentcloud.DnsRecordEnvironmentArgs{
		Id: pulumi.String("string"),
	},
	Gateway: &confluentcloud.DnsRecordGatewayArgs{
		Id: pulumi.String("string"),
	},
	DisplayName: pulumi.String("string"),
	PrivateLinkAccessPoint: &confluentcloud.DnsRecordPrivateLinkAccessPointArgs{
		Id: pulumi.String("string"),
	},
})
Copy
var dnsRecordResource = new DnsRecord("dnsRecordResource", DnsRecordArgs.builder()
    .domain("string")
    .environment(DnsRecordEnvironmentArgs.builder()
        .id("string")
        .build())
    .gateway(DnsRecordGatewayArgs.builder()
        .id("string")
        .build())
    .displayName("string")
    .privateLinkAccessPoint(DnsRecordPrivateLinkAccessPointArgs.builder()
        .id("string")
        .build())
    .build());
Copy
dns_record_resource = confluentcloud.DnsRecord("dnsRecordResource",
    domain="string",
    environment={
        "id": "string",
    },
    gateway={
        "id": "string",
    },
    display_name="string",
    private_link_access_point={
        "id": "string",
    })
Copy
const dnsRecordResource = new confluentcloud.DnsRecord("dnsRecordResource", {
    domain: "string",
    environment: {
        id: "string",
    },
    gateway: {
        id: "string",
    },
    displayName: "string",
    privateLinkAccessPoint: {
        id: "string",
    },
});
Copy
type: confluentcloud:DnsRecord
properties:
    displayName: string
    domain: string
    environment:
        id: string
    gateway:
        id: string
    privateLinkAccessPoint:
        id: string
Copy

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

Domain
This property is required.
Changes to this property will trigger replacement.
string
The fully qualified domain name of the DNS Record.
Environment
This property is required.
Changes to this property will trigger replacement.
Pulumi.ConfluentCloud.Inputs.DnsRecordEnvironment
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
Gateway
This property is required.
Changes to this property will trigger replacement.
Pulumi.ConfluentCloud.Inputs.DnsRecordGateway
DisplayName string
The name of the DNS Record.
PrivateLinkAccessPoint Pulumi.ConfluentCloud.Inputs.DnsRecordPrivateLinkAccessPoint
Domain
This property is required.
Changes to this property will trigger replacement.
string
The fully qualified domain name of the DNS Record.
Environment
This property is required.
Changes to this property will trigger replacement.
DnsRecordEnvironmentArgs
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
Gateway
This property is required.
Changes to this property will trigger replacement.
DnsRecordGatewayArgs
DisplayName string
The name of the DNS Record.
PrivateLinkAccessPoint DnsRecordPrivateLinkAccessPointArgs
domain
This property is required.
Changes to this property will trigger replacement.
String
The fully qualified domain name of the DNS Record.
environment
This property is required.
Changes to this property will trigger replacement.
DnsRecordEnvironment
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
gateway
This property is required.
Changes to this property will trigger replacement.
DnsRecordGateway
displayName String
The name of the DNS Record.
privateLinkAccessPoint DnsRecordPrivateLinkAccessPoint
domain
This property is required.
Changes to this property will trigger replacement.
string
The fully qualified domain name of the DNS Record.
environment
This property is required.
Changes to this property will trigger replacement.
DnsRecordEnvironment
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
gateway
This property is required.
Changes to this property will trigger replacement.
DnsRecordGateway
displayName string
The name of the DNS Record.
privateLinkAccessPoint DnsRecordPrivateLinkAccessPoint
domain
This property is required.
Changes to this property will trigger replacement.
str
The fully qualified domain name of the DNS Record.
environment
This property is required.
Changes to this property will trigger replacement.
DnsRecordEnvironmentArgs
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
gateway
This property is required.
Changes to this property will trigger replacement.
DnsRecordGatewayArgs
display_name str
The name of the DNS Record.
private_link_access_point DnsRecordPrivateLinkAccessPointArgs
domain
This property is required.
Changes to this property will trigger replacement.
String
The fully qualified domain name of the DNS Record.
environment
This property is required.
Changes to this property will trigger replacement.
Property Map
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
gateway
This property is required.
Changes to this property will trigger replacement.
Property Map
displayName String
The name of the DNS Record.
privateLinkAccessPoint Property Map

Outputs

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

Get an existing DnsRecord 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?: DnsRecordState, opts?: CustomResourceOptions): DnsRecord
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        display_name: Optional[str] = None,
        domain: Optional[str] = None,
        environment: Optional[DnsRecordEnvironmentArgs] = None,
        gateway: Optional[DnsRecordGatewayArgs] = None,
        private_link_access_point: Optional[DnsRecordPrivateLinkAccessPointArgs] = None) -> DnsRecord
func GetDnsRecord(ctx *Context, name string, id IDInput, state *DnsRecordState, opts ...ResourceOption) (*DnsRecord, error)
public static DnsRecord Get(string name, Input<string> id, DnsRecordState? state, CustomResourceOptions? opts = null)
public static DnsRecord get(String name, Output<String> id, DnsRecordState state, CustomResourceOptions options)
resources:  _:    type: confluentcloud:DnsRecord    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:
DisplayName string
The name of the DNS Record.
Domain Changes to this property will trigger replacement. string
The fully qualified domain name of the DNS Record.
Environment Changes to this property will trigger replacement. Pulumi.ConfluentCloud.Inputs.DnsRecordEnvironment
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
Gateway Changes to this property will trigger replacement. Pulumi.ConfluentCloud.Inputs.DnsRecordGateway
PrivateLinkAccessPoint Pulumi.ConfluentCloud.Inputs.DnsRecordPrivateLinkAccessPoint
DisplayName string
The name of the DNS Record.
Domain Changes to this property will trigger replacement. string
The fully qualified domain name of the DNS Record.
Environment Changes to this property will trigger replacement. DnsRecordEnvironmentArgs
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
Gateway Changes to this property will trigger replacement. DnsRecordGatewayArgs
PrivateLinkAccessPoint DnsRecordPrivateLinkAccessPointArgs
displayName String
The name of the DNS Record.
domain Changes to this property will trigger replacement. String
The fully qualified domain name of the DNS Record.
environment Changes to this property will trigger replacement. DnsRecordEnvironment
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
gateway Changes to this property will trigger replacement. DnsRecordGateway
privateLinkAccessPoint DnsRecordPrivateLinkAccessPoint
displayName string
The name of the DNS Record.
domain Changes to this property will trigger replacement. string
The fully qualified domain name of the DNS Record.
environment Changes to this property will trigger replacement. DnsRecordEnvironment
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
gateway Changes to this property will trigger replacement. DnsRecordGateway
privateLinkAccessPoint DnsRecordPrivateLinkAccessPoint
display_name str
The name of the DNS Record.
domain Changes to this property will trigger replacement. str
The fully qualified domain name of the DNS Record.
environment Changes to this property will trigger replacement. DnsRecordEnvironmentArgs
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
gateway Changes to this property will trigger replacement. DnsRecordGatewayArgs
private_link_access_point DnsRecordPrivateLinkAccessPointArgs
displayName String
The name of the DNS Record.
domain Changes to this property will trigger replacement. String
The fully qualified domain name of the DNS Record.
environment Changes to this property will trigger replacement. Property Map
Environment objects represent an isolated namespace for your Confluent resources for organizational purposes.
gateway Changes to this property will trigger replacement. Property Map
privateLinkAccessPoint Property Map

Supporting Types

DnsRecordEnvironment
, DnsRecordEnvironmentArgs

Id
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Environment that the DNS Record belongs to, for example, env-abc123.
Id
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Environment that the DNS Record belongs to, for example, env-abc123.
id
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Environment that the DNS Record belongs to, for example, env-abc123.
id
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Environment that the DNS Record belongs to, for example, env-abc123.
id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Environment that the DNS Record belongs to, for example, env-abc123.
id
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Environment that the DNS Record belongs to, for example, env-abc123.

DnsRecordGateway
, DnsRecordGatewayArgs

Id
This property is required.
Changes to this property will trigger replacement.
string
The ID of the gateway to which the DNS Record belongs, for example, gw-abc123.
Id
This property is required.
Changes to this property will trigger replacement.
string
The ID of the gateway to which the DNS Record belongs, for example, gw-abc123.
id
This property is required.
Changes to this property will trigger replacement.
String
The ID of the gateway to which the DNS Record belongs, for example, gw-abc123.
id
This property is required.
Changes to this property will trigger replacement.
string
The ID of the gateway to which the DNS Record belongs, for example, gw-abc123.
id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the gateway to which the DNS Record belongs, for example, gw-abc123.
id
This property is required.
Changes to this property will trigger replacement.
String
The ID of the gateway to which the DNS Record belongs, for example, gw-abc123.

DnsRecordPrivateLinkAccessPoint
, DnsRecordPrivateLinkAccessPointArgs

Id This property is required. string
The ID of the Private Link access point to which the DNS Record is associated, for example ap-123abc.
Id This property is required. string
The ID of the Private Link access point to which the DNS Record is associated, for example ap-123abc.
id This property is required. String
The ID of the Private Link access point to which the DNS Record is associated, for example ap-123abc.
id This property is required. string
The ID of the Private Link access point to which the DNS Record is associated, for example ap-123abc.
id This property is required. str
The ID of the Private Link access point to which the DNS Record is associated, for example ap-123abc.
id This property is required. String
The ID of the Private Link access point to which the DNS Record is associated, for example ap-123abc.

Import

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

$ export CONFLUENT_CLOUD_API_KEY="<cloud_api_key>"

$ export CONFLUENT_CLOUD_API_SECRET="<cloud_api_secret>"

$ pulumi import confluentcloud:index/dnsRecord:DnsRecord main env-abc123/dnsrec-abc123
Copy

!> 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.