1. Packages
  2. Vercel Provider
  3. API Docs
  4. getDomainConfig
Vercel v3.15.1 published on Monday, Sep 8, 2025 by Pulumiverse

vercel.getDomainConfig

Explore with Pulumi AI

vercel logo
Vercel v3.15.1 published on Monday, Sep 8, 2025 by Pulumiverse

    Provides domain configuration information for a Vercel project.

    This data source returns configuration details for a domain associated with a specific project, including recommended CNAME and IPv4 values.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as vercel from "@pulumi/vercel";
    import * as vercel from "@pulumiverse/vercel";
    
    const myAwesomeProject = new vercel.Project("my_awesome_project", {name: "my-awesome-project"});
    // 
    // "vercel_domain_config" Usage
    // 
    const exampleCom = vercel.getDomainConfigOutput({
        domain: "example.com",
        projectIdOrName: myAwesomeProject.id,
    });
    const wwwExampleCom = vercel.getDomainConfigOutput({
        domain: "www.example.com",
        projectIdOrName: myAwesomeProject.id,
    });
    //
    // External DNS provider example
    // 
    const exampleComA = new aws.index.Route53Record("example_com_a", {
        zoneId: "...zone_id_from_somewhere...",
        name: exampleCom.domain,
        type: "A",
        ttl: 300,
        records: exampleCom.recommendedIpv4s,
    });
    const wwwExampleComCname = new aws.index.Route53Record("www_example_com_cname", {
        zoneId: "...zone_id_from_somewhere...",
        name: wwwExampleCom.domain,
        type: "CNAME",
        ttl: 300,
        records: [wwwExampleCom.recommendedCname],
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_vercel as vercel
    import pulumiverse_vercel as vercel
    
    my_awesome_project = vercel.Project("my_awesome_project", name="my-awesome-project")
    # 
    # "vercel_domain_config" Usage
    # 
    example_com = vercel.get_domain_config_output(domain="example.com",
        project_id_or_name=my_awesome_project.id)
    www_example_com = vercel.get_domain_config_output(domain="www.example.com",
        project_id_or_name=my_awesome_project.id)
    #
    # External DNS provider example
    # 
    example_com_a = aws.index.Route53Record("example_com_a",
        zone_id=...zone_id_from_somewhere...,
        name=example_com.domain,
        type=A,
        ttl=300,
        records=example_com.recommended_ipv4s)
    www_example_com_cname = aws.index.Route53Record("www_example_com_cname",
        zone_id=...zone_id_from_somewhere...,
        name=www_example_com.domain,
        type=CNAME,
        ttl=300,
        records=[www_example_com.recommended_cname])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/go/aws"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-vercel/sdk/v3/go/vercel"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myAwesomeProject, err := vercel.NewProject(ctx, "my_awesome_project", &vercel.ProjectArgs{
    			Name: pulumi.String("my-awesome-project"),
    		})
    		if err != nil {
    			return err
    		}
    		// "vercel_domain_config" Usage
    		exampleCom := vercel.GetDomainConfigOutput(ctx, vercel.GetDomainConfigOutputArgs{
    			Domain:          pulumi.String("example.com"),
    			ProjectIdOrName: myAwesomeProject.ID(),
    		}, nil)
    		wwwExampleCom := vercel.GetDomainConfigOutput(ctx, vercel.GetDomainConfigOutputArgs{
    			Domain:          pulumi.String("www.example.com"),
    			ProjectIdOrName: myAwesomeProject.ID(),
    		}, nil)
    		// External DNS provider example
    		_, err = aws.NewRoute53Record(ctx, "example_com_a", &aws.Route53RecordArgs{
    			ZoneId:  "...zone_id_from_somewhere...",
    			Name:    exampleCom.Domain,
    			Type:    "A",
    			Ttl:     300,
    			Records: exampleCom.RecommendedIpv4s,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = aws.NewRoute53Record(ctx, "www_example_com_cname", &aws.Route53RecordArgs{
    			ZoneId: "...zone_id_from_somewhere...",
    			Name:   wwwExampleCom.Domain,
    			Type:   "CNAME",
    			Ttl:    300,
    			Records: pulumi.StringArray{
    				wwwExampleCom.RecommendedCname,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Vercel = Pulumi.Vercel;
    using Vercel = Pulumiverse.Vercel;
    
    return await Deployment.RunAsync(() => 
    {
        var myAwesomeProject = new Vercel.Project("my_awesome_project", new()
        {
            Name = "my-awesome-project",
        });
    
        // 
        // "vercel_domain_config" Usage
        // 
        var exampleCom = Vercel.GetDomainConfig.Invoke(new()
        {
            Domain = "example.com",
            ProjectIdOrName = myAwesomeProject.Id,
        });
    
        var wwwExampleCom = Vercel.GetDomainConfig.Invoke(new()
        {
            Domain = "www.example.com",
            ProjectIdOrName = myAwesomeProject.Id,
        });
    
        //
        // External DNS provider example
        // 
        var exampleComA = new Aws.Index.Route53Record("example_com_a", new()
        {
            ZoneId = "...zone_id_from_somewhere...",
            Name = exampleCom.Apply(getDomainConfigResult => getDomainConfigResult.Domain),
            Type = "A",
            Ttl = 300,
            Records = exampleCom.Apply(getDomainConfigResult => getDomainConfigResult.RecommendedIpv4s),
        });
    
        var wwwExampleComCname = new Aws.Index.Route53Record("www_example_com_cname", new()
        {
            ZoneId = "...zone_id_from_somewhere...",
            Name = wwwExampleCom.Apply(getDomainConfigResult => getDomainConfigResult.Domain),
            Type = "CNAME",
            Ttl = 300,
            Records = new[]
            {
                wwwExampleCom.Apply(getDomainConfigResult => getDomainConfigResult.RecommendedCname),
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vercel.Project;
    import com.pulumi.vercel.ProjectArgs;
    import com.pulumi.vercel.VercelFunctions;
    import com.pulumi.vercel.inputs.GetDomainConfigArgs;
    import com.pulumi.aws.route53Record;
    import com.pulumi.aws.Route53RecordArgs;
    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 myAwesomeProject = new Project("myAwesomeProject", ProjectArgs.builder()
                .name("my-awesome-project")
                .build());
    
            // 
            // "vercel_domain_config" Usage
            // 
            final var exampleCom = VercelFunctions.getDomainConfig(GetDomainConfigArgs.builder()
                .domain("example.com")
                .projectIdOrName(myAwesomeProject.id())
                .build());
    
            final var wwwExampleCom = VercelFunctions.getDomainConfig(GetDomainConfigArgs.builder()
                .domain("www.example.com")
                .projectIdOrName(myAwesomeProject.id())
                .build());
    
            //
            // External DNS provider example
            // 
            var exampleComA = new Route53Record("exampleComA", Route53RecordArgs.builder()
                .zoneId("...zone_id_from_somewhere...")
                .name(exampleCom.applyValue(getDomainConfigResult -> getDomainConfigResult.domain()))
                .type("A")
                .ttl(300)
                .records(exampleCom.applyValue(getDomainConfigResult -> getDomainConfigResult.recommendedIpv4s()))
                .build());
    
            var wwwExampleComCname = new Route53Record("wwwExampleComCname", Route53RecordArgs.builder()
                .zoneId("...zone_id_from_somewhere...")
                .name(wwwExampleCom.applyValue(getDomainConfigResult -> getDomainConfigResult.domain()))
                .type("CNAME")
                .ttl(300)
                .records(wwwExampleCom.applyValue(getDomainConfigResult -> getDomainConfigResult.recommendedCname()))
                .build());
    
        }
    }
    
    resources:
      myAwesomeProject:
        type: vercel:Project
        name: my_awesome_project
        properties:
          name: my-awesome-project
      #
      # External DNS provider example
      #
      exampleComA:
        type: aws:route53Record
        name: example_com_a
        properties:
          zoneId: '...zone_id_from_somewhere...'
          name: ${exampleCom.domain}
          type: A
          ttl: 300
          records: ${exampleCom.recommendedIpv4s}
      wwwExampleComCname:
        type: aws:route53Record
        name: www_example_com_cname
        properties:
          zoneId: '...zone_id_from_somewhere...'
          name: ${wwwExampleCom.domain}
          type: CNAME
          ttl: 300
          records:
            - ${wwwExampleCom.recommendedCname}
    variables:
      # 
      # "vercel_domain_config" Usage
      #
      exampleCom:
        fn::invoke:
          Function: vercel:getDomainConfig
          Arguments:
            domain: example.com
            projectIdOrName: ${myAwesomeProject.id}
      wwwExampleCom:
        fn::invoke:
          Function: vercel:getDomainConfig
          Arguments:
            domain: www.example.com
            projectIdOrName: ${myAwesomeProject.id}
    

    Using getDomainConfig

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDomainConfig(args: GetDomainConfigArgs, opts?: InvokeOptions): Promise<GetDomainConfigResult>
    function getDomainConfigOutput(args: GetDomainConfigOutputArgs, opts?: InvokeOptions): Output<GetDomainConfigResult>
    def get_domain_config(domain: Optional[str] = None,
                          project_id_or_name: Optional[str] = None,
                          team_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetDomainConfigResult
    def get_domain_config_output(domain: Optional[pulumi.Input[str]] = None,
                          project_id_or_name: Optional[pulumi.Input[str]] = None,
                          team_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetDomainConfigResult]
    func GetDomainConfig(ctx *Context, args *GetDomainConfigArgs, opts ...InvokeOption) (*GetDomainConfigResult, error)
    func GetDomainConfigOutput(ctx *Context, args *GetDomainConfigOutputArgs, opts ...InvokeOption) GetDomainConfigResultOutput

    > Note: This function is named GetDomainConfig in the Go SDK.

    public static class GetDomainConfig 
    {
        public static Task<GetDomainConfigResult> InvokeAsync(GetDomainConfigArgs args, InvokeOptions? opts = null)
        public static Output<GetDomainConfigResult> Invoke(GetDomainConfigInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDomainConfigResult> getDomainConfig(GetDomainConfigArgs args, InvokeOptions options)
    public static Output<GetDomainConfigResult> getDomainConfig(GetDomainConfigArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vercel:index/getDomainConfig:getDomainConfig
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Domain string
    The domain name to get configuration for.
    ProjectIdOrName string
    The project ID or name associated with the domain.
    TeamId string
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    Domain string
    The domain name to get configuration for.
    ProjectIdOrName string
    The project ID or name associated with the domain.
    TeamId string
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    domain String
    The domain name to get configuration for.
    projectIdOrName String
    The project ID or name associated with the domain.
    teamId String
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    domain string
    The domain name to get configuration for.
    projectIdOrName string
    The project ID or name associated with the domain.
    teamId string
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    domain str
    The domain name to get configuration for.
    project_id_or_name str
    The project ID or name associated with the domain.
    team_id str
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    domain String
    The domain name to get configuration for.
    projectIdOrName String
    The project ID or name associated with the domain.
    teamId String
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.

    getDomainConfig Result

    The following output properties are available:

    Domain string
    The domain name to get configuration for.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectIdOrName string
    The project ID or name associated with the domain.
    RecommendedCname string
    The recommended CNAME value for the domain.
    RecommendedIpv4s List<string>
    The recommended IPv4 values for the domain.
    TeamId string
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    Domain string
    The domain name to get configuration for.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectIdOrName string
    The project ID or name associated with the domain.
    RecommendedCname string
    The recommended CNAME value for the domain.
    RecommendedIpv4s []string
    The recommended IPv4 values for the domain.
    TeamId string
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    domain String
    The domain name to get configuration for.
    id String
    The provider-assigned unique ID for this managed resource.
    projectIdOrName String
    The project ID or name associated with the domain.
    recommendedCname String
    The recommended CNAME value for the domain.
    recommendedIpv4s List<String>
    The recommended IPv4 values for the domain.
    teamId String
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    domain string
    The domain name to get configuration for.
    id string
    The provider-assigned unique ID for this managed resource.
    projectIdOrName string
    The project ID or name associated with the domain.
    recommendedCname string
    The recommended CNAME value for the domain.
    recommendedIpv4s string[]
    The recommended IPv4 values for the domain.
    teamId string
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    domain str
    The domain name to get configuration for.
    id str
    The provider-assigned unique ID for this managed resource.
    project_id_or_name str
    The project ID or name associated with the domain.
    recommended_cname str
    The recommended CNAME value for the domain.
    recommended_ipv4s Sequence[str]
    The recommended IPv4 values for the domain.
    team_id str
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.
    domain String
    The domain name to get configuration for.
    id String
    The provider-assigned unique ID for this managed resource.
    projectIdOrName String
    The project ID or name associated with the domain.
    recommendedCname String
    The recommended CNAME value for the domain.
    recommendedIpv4s List<String>
    The recommended IPv4 values for the domain.
    teamId String
    The ID of the team the domain config exists under. Required when configuring a team resource if a default team has not been set in the provider.

    Package Details

    Repository
    vercel pulumiverse/pulumi-vercel
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vercel Terraform Provider.
    vercel logo
    Vercel v3.15.1 published on Monday, Sep 8, 2025 by Pulumiverse