vercel.ProjectDomain
Explore with Pulumi AI
Provides a Project Domain resource.
A Project Domain is used to associate a domain name with a vercel.Project
.
By default, Project Domains will be automatically applied to any production
deployments.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vercel from "@pulumiverse/vercel";
const exampleProject = new vercel.Project("exampleProject", {});
// A simple domain that will be automatically
// applied to each production deployment
const exampleProjectDomain = new vercel.ProjectDomain("exampleProjectDomain", {
projectId: exampleProject.id,
domain: "i-love.vercel.app",
});
// A redirect of a domain name to a second domain name.
// The status_code can optionally be controlled.
const exampleRedirect = new vercel.ProjectDomain("exampleRedirect", {
projectId: exampleProject.id,
domain: "i-also-love.vercel.app",
redirect: exampleProjectDomain.domain,
redirectStatusCode: 307,
});
import pulumi
import pulumiverse_vercel as vercel
example_project = vercel.Project("exampleProject")
# A simple domain that will be automatically
# applied to each production deployment
example_project_domain = vercel.ProjectDomain("exampleProjectDomain",
project_id=example_project.id,
domain="i-love.vercel.app")
# A redirect of a domain name to a second domain name.
# The status_code can optionally be controlled.
example_redirect = vercel.ProjectDomain("exampleRedirect",
project_id=example_project.id,
domain="i-also-love.vercel.app",
redirect=example_project_domain.domain,
redirect_status_code=307)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-vercel/sdk/go/vercel"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleProject, err := vercel.NewProject(ctx, "exampleProject", nil)
if err != nil {
return err
}
// A simple domain that will be automatically
// applied to each production deployment
exampleProjectDomain, err := vercel.NewProjectDomain(ctx, "exampleProjectDomain", &vercel.ProjectDomainArgs{
ProjectId: exampleProject.ID(),
Domain: pulumi.String("i-love.vercel.app"),
})
if err != nil {
return err
}
// A redirect of a domain name to a second domain name.
// The status_code can optionally be controlled.
_, err = vercel.NewProjectDomain(ctx, "exampleRedirect", &vercel.ProjectDomainArgs{
ProjectId: exampleProject.ID(),
Domain: pulumi.String("i-also-love.vercel.app"),
Redirect: exampleProjectDomain.Domain,
RedirectStatusCode: pulumi.Int(307),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vercel = Pulumiverse.Vercel;
return await Deployment.RunAsync(() =>
{
var exampleProject = new Vercel.Project("exampleProject");
// A simple domain that will be automatically
// applied to each production deployment
var exampleProjectDomain = new Vercel.ProjectDomain("exampleProjectDomain", new()
{
ProjectId = exampleProject.Id,
Domain = "i-love.vercel.app",
});
// A redirect of a domain name to a second domain name.
// The status_code can optionally be controlled.
var exampleRedirect = new Vercel.ProjectDomain("exampleRedirect", new()
{
ProjectId = exampleProject.Id,
Domain = "i-also-love.vercel.app",
Redirect = exampleProjectDomain.Domain,
RedirectStatusCode = 307,
});
});
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.ProjectDomain;
import com.pulumi.vercel.ProjectDomainArgs;
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 exampleProject = new Project("exampleProject");
// A simple domain that will be automatically
// applied to each production deployment
var exampleProjectDomain = new ProjectDomain("exampleProjectDomain", ProjectDomainArgs.builder()
.projectId(exampleProject.id())
.domain("i-love.vercel.app")
.build());
// A redirect of a domain name to a second domain name.
// The status_code can optionally be controlled.
var exampleRedirect = new ProjectDomain("exampleRedirect", ProjectDomainArgs.builder()
.projectId(exampleProject.id())
.domain("i-also-love.vercel.app")
.redirect(exampleProjectDomain.domain())
.redirectStatusCode(307)
.build());
}
}
resources:
exampleProject:
type: vercel:Project
# A simple domain that will be automatically
# applied to each production deployment
exampleProjectDomain:
type: vercel:ProjectDomain
properties:
projectId: ${exampleProject.id}
domain: i-love.vercel.app
# A redirect of a domain name to a second domain name.
# The status_code can optionally be controlled.
exampleRedirect:
type: vercel:ProjectDomain
properties:
projectId: ${exampleProject.id}
domain: i-also-love.vercel.app
redirect: ${exampleProjectDomain.domain}
redirectStatusCode: 307
Create ProjectDomain Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectDomain(name: string, args: ProjectDomainArgs, opts?: CustomResourceOptions);
@overload
def ProjectDomain(resource_name: str,
args: ProjectDomainArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectDomain(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
project_id: Optional[str] = None,
git_branch: Optional[str] = None,
redirect: Optional[str] = None,
redirect_status_code: Optional[int] = None,
team_id: Optional[str] = None)
func NewProjectDomain(ctx *Context, name string, args ProjectDomainArgs, opts ...ResourceOption) (*ProjectDomain, error)
public ProjectDomain(string name, ProjectDomainArgs args, CustomResourceOptions? opts = null)
public ProjectDomain(String name, ProjectDomainArgs args)
public ProjectDomain(String name, ProjectDomainArgs args, CustomResourceOptions options)
type: vercel:ProjectDomain
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 ProjectDomainArgs
- 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 ProjectDomainArgs
- 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 ProjectDomainArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectDomainArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectDomainArgs
- 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 projectDomainResource = new Vercel.ProjectDomain("projectDomainResource", new()
{
Domain = "string",
ProjectId = "string",
GitBranch = "string",
Redirect = "string",
RedirectStatusCode = 0,
TeamId = "string",
});
example, err := vercel.NewProjectDomain(ctx, "projectDomainResource", &vercel.ProjectDomainArgs{
Domain: pulumi.String("string"),
ProjectId: pulumi.String("string"),
GitBranch: pulumi.String("string"),
Redirect: pulumi.String("string"),
RedirectStatusCode: pulumi.Int(0),
TeamId: pulumi.String("string"),
})
var projectDomainResource = new ProjectDomain("projectDomainResource", ProjectDomainArgs.builder()
.domain("string")
.projectId("string")
.gitBranch("string")
.redirect("string")
.redirectStatusCode(0)
.teamId("string")
.build());
project_domain_resource = vercel.ProjectDomain("projectDomainResource",
domain="string",
project_id="string",
git_branch="string",
redirect="string",
redirect_status_code=0,
team_id="string")
const projectDomainResource = new vercel.ProjectDomain("projectDomainResource", {
domain: "string",
projectId: "string",
gitBranch: "string",
redirect: "string",
redirectStatusCode: 0,
teamId: "string",
});
type: vercel:ProjectDomain
properties:
domain: string
gitBranch: string
projectId: string
redirect: string
redirectStatusCode: 0
teamId: string
ProjectDomain 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 ProjectDomain resource accepts the following input properties:
- Domain string
- The domain name to associate with the project.
- Project
Id string - The project ID to add the deployment to.
- Git
Branch string - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- Redirect string
- The domain name that serves as a target destination for redirects.
- Redirect
Status intCode - The HTTP status code to use when serving as a redirect.
- Team
Id string - The ID of the team the project 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 associate with the project.
- Project
Id string - The project ID to add the deployment to.
- Git
Branch string - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- Redirect string
- The domain name that serves as a target destination for redirects.
- Redirect
Status intCode - The HTTP status code to use when serving as a redirect.
- Team
Id string - The ID of the team the project 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 associate with the project.
- project
Id String - The project ID to add the deployment to.
- git
Branch String - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- redirect String
- The domain name that serves as a target destination for redirects.
- redirect
Status IntegerCode - The HTTP status code to use when serving as a redirect.
- team
Id String - The ID of the team the project 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 associate with the project.
- project
Id string - The project ID to add the deployment to.
- git
Branch string - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- redirect string
- The domain name that serves as a target destination for redirects.
- redirect
Status numberCode - The HTTP status code to use when serving as a redirect.
- team
Id string - The ID of the team the project 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 associate with the project.
- project_
id str - The project ID to add the deployment to.
- git_
branch str - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- redirect str
- The domain name that serves as a target destination for redirects.
- redirect_
status_ intcode - The HTTP status code to use when serving as a redirect.
- team_
id str - The ID of the team the project 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 associate with the project.
- project
Id String - The project ID to add the deployment to.
- git
Branch String - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- redirect String
- The domain name that serves as a target destination for redirects.
- redirect
Status NumberCode - The HTTP status code to use when serving as a redirect.
- team
Id String - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectDomain 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 ProjectDomain Resource
Get an existing ProjectDomain 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?: ProjectDomainState, opts?: CustomResourceOptions): ProjectDomain
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
git_branch: Optional[str] = None,
project_id: Optional[str] = None,
redirect: Optional[str] = None,
redirect_status_code: Optional[int] = None,
team_id: Optional[str] = None) -> ProjectDomain
func GetProjectDomain(ctx *Context, name string, id IDInput, state *ProjectDomainState, opts ...ResourceOption) (*ProjectDomain, error)
public static ProjectDomain Get(string name, Input<string> id, ProjectDomainState? state, CustomResourceOptions? opts = null)
public static ProjectDomain get(String name, Output<String> id, ProjectDomainState 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.
- Domain string
- The domain name to associate with the project.
- Git
Branch string - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- Project
Id string - The project ID to add the deployment to.
- Redirect string
- The domain name that serves as a target destination for redirects.
- Redirect
Status intCode - The HTTP status code to use when serving as a redirect.
- Team
Id string - The ID of the team the project 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 associate with the project.
- Git
Branch string - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- Project
Id string - The project ID to add the deployment to.
- Redirect string
- The domain name that serves as a target destination for redirects.
- Redirect
Status intCode - The HTTP status code to use when serving as a redirect.
- Team
Id string - The ID of the team the project 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 associate with the project.
- git
Branch String - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- project
Id String - The project ID to add the deployment to.
- redirect String
- The domain name that serves as a target destination for redirects.
- redirect
Status IntegerCode - The HTTP status code to use when serving as a redirect.
- team
Id String - The ID of the team the project 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 associate with the project.
- git
Branch string - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- project
Id string - The project ID to add the deployment to.
- redirect string
- The domain name that serves as a target destination for redirects.
- redirect
Status numberCode - The HTTP status code to use when serving as a redirect.
- team
Id string - The ID of the team the project 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 associate with the project.
- git_
branch str - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- project_
id str - The project ID to add the deployment to.
- redirect str
- The domain name that serves as a target destination for redirects.
- redirect_
status_ intcode - The HTTP status code to use when serving as a redirect.
- team_
id str - The ID of the team the project 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 associate with the project.
- git
Branch String - Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- project
Id String - The project ID to add the deployment to.
- redirect String
- The domain name that serves as a target destination for redirects.
- redirect
Status NumberCode - The HTTP status code to use when serving as a redirect.
- team
Id String - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
Import
If importing into a personal account, or with a team configured on
the provider, simply use the project ID and domain.
- project_id can be found in the project
settings
tab in the Vercel UI.
$ pulumi import vercel:index/projectDomain:ProjectDomain example prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/example.com
Alternatively, you can import via the team_id, project_id and domain name.
team_id can be found in the team
settings
tab in the Vercel UI.project_id can be found in the project
settings
tab in the Vercel UI.
$ pulumi import vercel:index/projectDomain:ProjectDomain example team_xxxxxxxxxxxxxxxxxxxxxxxx/prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/example.com
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vercel pulumiverse/pulumi-vercel
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vercel
Terraform Provider.