1. Packages
  2. Vercel
  3. API Docs
  4. ProjectDeploymentRetention
Vercel v1.14.2 published on Sunday, Sep 22, 2024 by Pulumiverse

vercel.ProjectDeploymentRetention

Explore with Pulumi AI

vercel logo
Vercel v1.14.2 published on Sunday, Sep 22, 2024 by Pulumiverse

    Provides a Project Deployment Retention resource.

    A Project Deployment Retention resource defines an Deployment Retention on a Vercel Project.

    For more detailed information, please see the Vercel documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vercel from "@pulumiverse/vercel";
    
    const example = new vercel.Project("example", {gitRepository: {
        type: "github",
        repo: "vercel/some-repo",
    }});
    // An unlimited deployment retention policy that will be created
    // for this project for all deployments.
    const exampleUnlimited = new vercel.ProjectDeploymentRetention("exampleUnlimited", {
        projectId: example.id,
        teamId: example.teamId,
        expirationPreview: "unlimited",
        expirationProduction: "unlimited",
        expirationCanceled: "unlimited",
        expirationErrored: "unlimited",
    });
    // A customized deployment retention policy that will be created
    // for this project for all deployments.
    const exampleCustomized = new vercel.ProjectDeploymentRetention("exampleCustomized", {
        projectId: example.id,
        teamId: example.teamId,
        expirationPreview: "3m",
        expirationProduction: "1y",
        expirationCanceled: "1m",
        expirationErrored: "2m",
    });
    
    import pulumi
    import pulumiverse_vercel as vercel
    
    example = vercel.Project("example", git_repository={
        "type": "github",
        "repo": "vercel/some-repo",
    })
    # An unlimited deployment retention policy that will be created
    # for this project for all deployments.
    example_unlimited = vercel.ProjectDeploymentRetention("exampleUnlimited",
        project_id=example.id,
        team_id=example.team_id,
        expiration_preview="unlimited",
        expiration_production="unlimited",
        expiration_canceled="unlimited",
        expiration_errored="unlimited")
    # A customized deployment retention policy that will be created
    # for this project for all deployments.
    example_customized = vercel.ProjectDeploymentRetention("exampleCustomized",
        project_id=example.id,
        team_id=example.team_id,
        expiration_preview="3m",
        expiration_production="1y",
        expiration_canceled="1m",
        expiration_errored="2m")
    
    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 {
    		example, err := vercel.NewProject(ctx, "example", &vercel.ProjectArgs{
    			GitRepository: &vercel.ProjectGitRepositoryArgs{
    				Type: pulumi.String("github"),
    				Repo: pulumi.String("vercel/some-repo"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// An unlimited deployment retention policy that will be created
    		// for this project for all deployments.
    		_, err = vercel.NewProjectDeploymentRetention(ctx, "exampleUnlimited", &vercel.ProjectDeploymentRetentionArgs{
    			ProjectId:            example.ID(),
    			TeamId:               example.TeamId,
    			ExpirationPreview:    pulumi.String("unlimited"),
    			ExpirationProduction: pulumi.String("unlimited"),
    			ExpirationCanceled:   pulumi.String("unlimited"),
    			ExpirationErrored:    pulumi.String("unlimited"),
    		})
    		if err != nil {
    			return err
    		}
    		// A customized deployment retention policy that will be created
    		// for this project for all deployments.
    		_, err = vercel.NewProjectDeploymentRetention(ctx, "exampleCustomized", &vercel.ProjectDeploymentRetentionArgs{
    			ProjectId:            example.ID(),
    			TeamId:               example.TeamId,
    			ExpirationPreview:    pulumi.String("3m"),
    			ExpirationProduction: pulumi.String("1y"),
    			ExpirationCanceled:   pulumi.String("1m"),
    			ExpirationErrored:    pulumi.String("2m"),
    		})
    		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 example = new Vercel.Project("example", new()
        {
            GitRepository = new Vercel.Inputs.ProjectGitRepositoryArgs
            {
                Type = "github",
                Repo = "vercel/some-repo",
            },
        });
    
        // An unlimited deployment retention policy that will be created
        // for this project for all deployments.
        var exampleUnlimited = new Vercel.ProjectDeploymentRetention("exampleUnlimited", new()
        {
            ProjectId = example.Id,
            TeamId = example.TeamId,
            ExpirationPreview = "unlimited",
            ExpirationProduction = "unlimited",
            ExpirationCanceled = "unlimited",
            ExpirationErrored = "unlimited",
        });
    
        // A customized deployment retention policy that will be created
        // for this project for all deployments.
        var exampleCustomized = new Vercel.ProjectDeploymentRetention("exampleCustomized", new()
        {
            ProjectId = example.Id,
            TeamId = example.TeamId,
            ExpirationPreview = "3m",
            ExpirationProduction = "1y",
            ExpirationCanceled = "1m",
            ExpirationErrored = "2m",
        });
    
    });
    
    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.inputs.ProjectGitRepositoryArgs;
    import com.pulumi.vercel.ProjectDeploymentRetention;
    import com.pulumi.vercel.ProjectDeploymentRetentionArgs;
    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 example = new Project("example", ProjectArgs.builder()
                .gitRepository(ProjectGitRepositoryArgs.builder()
                    .type("github")
                    .repo("vercel/some-repo")
                    .build())
                .build());
    
            // An unlimited deployment retention policy that will be created
            // for this project for all deployments.
            var exampleUnlimited = new ProjectDeploymentRetention("exampleUnlimited", ProjectDeploymentRetentionArgs.builder()
                .projectId(example.id())
                .teamId(example.teamId())
                .expirationPreview("unlimited")
                .expirationProduction("unlimited")
                .expirationCanceled("unlimited")
                .expirationErrored("unlimited")
                .build());
    
            // A customized deployment retention policy that will be created
            // for this project for all deployments.
            var exampleCustomized = new ProjectDeploymentRetention("exampleCustomized", ProjectDeploymentRetentionArgs.builder()
                .projectId(example.id())
                .teamId(example.teamId())
                .expirationPreview("3m")
                .expirationProduction("1y")
                .expirationCanceled("1m")
                .expirationErrored("2m")
                .build());
    
        }
    }
    
    resources:
      example:
        type: vercel:Project
        properties:
          gitRepository:
            type: github
            repo: vercel/some-repo
      # An unlimited deployment retention policy that will be created
      # for this project for all deployments.
      exampleUnlimited:
        type: vercel:ProjectDeploymentRetention
        properties:
          projectId: ${example.id}
          teamId: ${example.teamId}
          expirationPreview: unlimited
          expirationProduction: unlimited
          expirationCanceled: unlimited
          expirationErrored: unlimited
      # A customized deployment retention policy that will be created
      # for this project for all deployments.
      exampleCustomized:
        type: vercel:ProjectDeploymentRetention
        properties:
          projectId: ${example.id}
          teamId: ${example.teamId}
          expirationPreview: 3m
          expirationProduction: 1y
          expirationCanceled: 1m
          expirationErrored: 2m
    

    Create ProjectDeploymentRetention Resource

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

    Constructor syntax

    new ProjectDeploymentRetention(name: string, args: ProjectDeploymentRetentionArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectDeploymentRetention(resource_name: str,
                                   args: ProjectDeploymentRetentionArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectDeploymentRetention(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   project_id: Optional[str] = None,
                                   expiration_canceled: Optional[str] = None,
                                   expiration_errored: Optional[str] = None,
                                   expiration_preview: Optional[str] = None,
                                   expiration_production: Optional[str] = None,
                                   team_id: Optional[str] = None)
    func NewProjectDeploymentRetention(ctx *Context, name string, args ProjectDeploymentRetentionArgs, opts ...ResourceOption) (*ProjectDeploymentRetention, error)
    public ProjectDeploymentRetention(string name, ProjectDeploymentRetentionArgs args, CustomResourceOptions? opts = null)
    public ProjectDeploymentRetention(String name, ProjectDeploymentRetentionArgs args)
    public ProjectDeploymentRetention(String name, ProjectDeploymentRetentionArgs args, CustomResourceOptions options)
    
    type: vercel:ProjectDeploymentRetention
    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 ProjectDeploymentRetentionArgs
    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 ProjectDeploymentRetentionArgs
    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 ProjectDeploymentRetentionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectDeploymentRetentionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectDeploymentRetentionArgs
    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 projectDeploymentRetentionResource = new Vercel.ProjectDeploymentRetention("projectDeploymentRetentionResource", new()
    {
        ProjectId = "string",
        ExpirationCanceled = "string",
        ExpirationErrored = "string",
        ExpirationPreview = "string",
        ExpirationProduction = "string",
        TeamId = "string",
    });
    
    example, err := vercel.NewProjectDeploymentRetention(ctx, "projectDeploymentRetentionResource", &vercel.ProjectDeploymentRetentionArgs{
    	ProjectId:            pulumi.String("string"),
    	ExpirationCanceled:   pulumi.String("string"),
    	ExpirationErrored:    pulumi.String("string"),
    	ExpirationPreview:    pulumi.String("string"),
    	ExpirationProduction: pulumi.String("string"),
    	TeamId:               pulumi.String("string"),
    })
    
    var projectDeploymentRetentionResource = new ProjectDeploymentRetention("projectDeploymentRetentionResource", ProjectDeploymentRetentionArgs.builder()
        .projectId("string")
        .expirationCanceled("string")
        .expirationErrored("string")
        .expirationPreview("string")
        .expirationProduction("string")
        .teamId("string")
        .build());
    
    project_deployment_retention_resource = vercel.ProjectDeploymentRetention("projectDeploymentRetentionResource",
        project_id="string",
        expiration_canceled="string",
        expiration_errored="string",
        expiration_preview="string",
        expiration_production="string",
        team_id="string")
    
    const projectDeploymentRetentionResource = new vercel.ProjectDeploymentRetention("projectDeploymentRetentionResource", {
        projectId: "string",
        expirationCanceled: "string",
        expirationErrored: "string",
        expirationPreview: "string",
        expirationProduction: "string",
        teamId: "string",
    });
    
    type: vercel:ProjectDeploymentRetention
    properties:
        expirationCanceled: string
        expirationErrored: string
        expirationPreview: string
        expirationProduction: string
        projectId: string
        teamId: string
    

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

    ProjectId string
    The ID of the Project for the retention policy
    ExpirationCanceled string
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationErrored string
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationPreview string
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationProduction string
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    TeamId string
    The ID of the Vercel team.
    ProjectId string
    The ID of the Project for the retention policy
    ExpirationCanceled string
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationErrored string
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationPreview string
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationProduction string
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    TeamId string
    The ID of the Vercel team.
    projectId String
    The ID of the Project for the retention policy
    expirationCanceled String
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationErrored String
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationPreview String
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationProduction String
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    teamId String
    The ID of the Vercel team.
    projectId string
    The ID of the Project for the retention policy
    expirationCanceled string
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationErrored string
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationPreview string
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationProduction string
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    teamId string
    The ID of the Vercel team.
    project_id str
    The ID of the Project for the retention policy
    expiration_canceled str
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expiration_errored str
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expiration_preview str
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expiration_production str
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    team_id str
    The ID of the Vercel team.
    projectId String
    The ID of the Project for the retention policy
    expirationCanceled String
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationErrored String
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationPreview String
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationProduction String
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    teamId String
    The ID of the Vercel team.

    Outputs

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

    Get an existing ProjectDeploymentRetention 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?: ProjectDeploymentRetentionState, opts?: CustomResourceOptions): ProjectDeploymentRetention
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            expiration_canceled: Optional[str] = None,
            expiration_errored: Optional[str] = None,
            expiration_preview: Optional[str] = None,
            expiration_production: Optional[str] = None,
            project_id: Optional[str] = None,
            team_id: Optional[str] = None) -> ProjectDeploymentRetention
    func GetProjectDeploymentRetention(ctx *Context, name string, id IDInput, state *ProjectDeploymentRetentionState, opts ...ResourceOption) (*ProjectDeploymentRetention, error)
    public static ProjectDeploymentRetention Get(string name, Input<string> id, ProjectDeploymentRetentionState? state, CustomResourceOptions? opts = null)
    public static ProjectDeploymentRetention get(String name, Output<String> id, ProjectDeploymentRetentionState 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:
    ExpirationCanceled string
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationErrored string
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationPreview string
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationProduction string
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ProjectId string
    The ID of the Project for the retention policy
    TeamId string
    The ID of the Vercel team.
    ExpirationCanceled string
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationErrored string
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationPreview string
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ExpirationProduction string
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    ProjectId string
    The ID of the Project for the retention policy
    TeamId string
    The ID of the Vercel team.
    expirationCanceled String
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationErrored String
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationPreview String
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationProduction String
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    projectId String
    The ID of the Project for the retention policy
    teamId String
    The ID of the Vercel team.
    expirationCanceled string
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationErrored string
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationPreview string
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationProduction string
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    projectId string
    The ID of the Project for the retention policy
    teamId string
    The ID of the Vercel team.
    expiration_canceled str
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expiration_errored str
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expiration_preview str
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expiration_production str
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    project_id str
    The ID of the Project for the retention policy
    team_id str
    The ID of the Vercel team.
    expirationCanceled String
    The retention period for canceled deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationErrored String
    The retention period for errored deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationPreview String
    The retention period for preview deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    expirationProduction String
    The retention period for production deployments. Should be one of '1m', '2m', '3m', '6m', '1y', 'unlimited'.
    projectId String
    The ID of the Project for the retention policy
    teamId String
    The ID of the Vercel team.

    Import

    You can import via the team_id and project_id.

    • 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/projectDeploymentRetention:ProjectDeploymentRetention example team_xxxxxxxxxxxxxxxxxxxxxxxx/prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    

    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.
    vercel logo
    Vercel v1.14.2 published on Sunday, Sep 22, 2024 by Pulumiverse