1. Packages
  2. Vercel
  3. API Docs
  4. ProjectFunctionCpu
Vercel v1.11.0 published on Thursday, May 23, 2024 by Pulumiverse

vercel.ProjectFunctionCpu

Explore with Pulumi AI

vercel logo
Vercel v1.11.0 published on Thursday, May 23, 2024 by Pulumiverse

    Provides a Function CPU resource for a Project.

    This controls the maximum amount of CPU utilization your Serverless Functions can use while executing. Standard is optimal for most frontend workloads. You can override this per function using the vercel.json file.

    A new Deployment is required for your changes to take effect.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vercel from "@pulumiverse/vercel";
    
    const exampleProject = new vercel.Project("exampleProject", {});
    const exampleProjectFunctionCpu = new vercel.ProjectFunctionCpu("exampleProjectFunctionCpu", {
        projectId: exampleProject.id,
        cpu: "performance",
    });
    
    import pulumi
    import pulumiverse_vercel as vercel
    
    example_project = vercel.Project("exampleProject")
    example_project_function_cpu = vercel.ProjectFunctionCpu("exampleProjectFunctionCpu",
        project_id=example_project.id,
        cpu="performance")
    
    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
    		}
    		_, err = vercel.NewProjectFunctionCpu(ctx, "exampleProjectFunctionCpu", &vercel.ProjectFunctionCpuArgs{
    			ProjectId: exampleProject.ID(),
    			Cpu:       pulumi.String("performance"),
    		})
    		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");
    
        var exampleProjectFunctionCpu = new Vercel.ProjectFunctionCpu("exampleProjectFunctionCpu", new()
        {
            ProjectId = exampleProject.Id,
            Cpu = "performance",
        });
    
    });
    
    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.ProjectFunctionCpu;
    import com.pulumi.vercel.ProjectFunctionCpuArgs;
    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");
    
            var exampleProjectFunctionCpu = new ProjectFunctionCpu("exampleProjectFunctionCpu", ProjectFunctionCpuArgs.builder()        
                .projectId(exampleProject.id())
                .cpu("performance")
                .build());
    
        }
    }
    
    resources:
      exampleProject:
        type: vercel:Project
      exampleProjectFunctionCpu:
        type: vercel:ProjectFunctionCpu
        properties:
          projectId: ${exampleProject.id}
          cpu: performance
    

    Create ProjectFunctionCpu Resource

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

    Constructor syntax

    new ProjectFunctionCpu(name: string, args: ProjectFunctionCpuArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectFunctionCpu(resource_name: str,
                           args: ProjectFunctionCpuArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectFunctionCpu(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           cpu: Optional[str] = None,
                           project_id: Optional[str] = None,
                           team_id: Optional[str] = None)
    func NewProjectFunctionCpu(ctx *Context, name string, args ProjectFunctionCpuArgs, opts ...ResourceOption) (*ProjectFunctionCpu, error)
    public ProjectFunctionCpu(string name, ProjectFunctionCpuArgs args, CustomResourceOptions? opts = null)
    public ProjectFunctionCpu(String name, ProjectFunctionCpuArgs args)
    public ProjectFunctionCpu(String name, ProjectFunctionCpuArgs args, CustomResourceOptions options)
    
    type: vercel:ProjectFunctionCpu
    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 ProjectFunctionCpuArgs
    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 ProjectFunctionCpuArgs
    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 ProjectFunctionCpuArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectFunctionCpuArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectFunctionCpuArgs
    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 projectFunctionCpuResource = new Vercel.ProjectFunctionCpu("projectFunctionCpuResource", new()
    {
        Cpu = "string",
        ProjectId = "string",
        TeamId = "string",
    });
    
    example, err := vercel.NewProjectFunctionCpu(ctx, "projectFunctionCpuResource", &vercel.ProjectFunctionCpuArgs{
    	Cpu:       pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	TeamId:    pulumi.String("string"),
    })
    
    var projectFunctionCpuResource = new ProjectFunctionCpu("projectFunctionCpuResource", ProjectFunctionCpuArgs.builder()
        .cpu("string")
        .projectId("string")
        .teamId("string")
        .build());
    
    project_function_cpu_resource = vercel.ProjectFunctionCpu("projectFunctionCpuResource",
        cpu="string",
        project_id="string",
        team_id="string")
    
    const projectFunctionCpuResource = new vercel.ProjectFunctionCpu("projectFunctionCpuResource", {
        cpu: "string",
        projectId: "string",
        teamId: "string",
    });
    
    type: vercel:ProjectFunctionCpu
    properties:
        cpu: string
        projectId: string
        teamId: string
    

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

    Cpu string
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    ProjectId string
    The ID of the Project to adjust the CPU for.
    TeamId 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.
    Cpu string
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    ProjectId string
    The ID of the Project to adjust the CPU for.
    TeamId 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.
    cpu String
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    projectId String
    The ID of the Project to adjust the CPU for.
    teamId 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.
    cpu string
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    projectId string
    The ID of the Project to adjust the CPU for.
    teamId 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.
    cpu str
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    project_id str
    The ID of the Project to adjust the CPU for.
    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.
    cpu String
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    projectId String
    The ID of the Project to adjust the CPU for.
    teamId 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 ProjectFunctionCpu 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 ProjectFunctionCpu Resource

    Get an existing ProjectFunctionCpu 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?: ProjectFunctionCpuState, opts?: CustomResourceOptions): ProjectFunctionCpu
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cpu: Optional[str] = None,
            project_id: Optional[str] = None,
            team_id: Optional[str] = None) -> ProjectFunctionCpu
    func GetProjectFunctionCpu(ctx *Context, name string, id IDInput, state *ProjectFunctionCpuState, opts ...ResourceOption) (*ProjectFunctionCpu, error)
    public static ProjectFunctionCpu Get(string name, Input<string> id, ProjectFunctionCpuState? state, CustomResourceOptions? opts = null)
    public static ProjectFunctionCpu get(String name, Output<String> id, ProjectFunctionCpuState 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:
    Cpu string
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    ProjectId string
    The ID of the Project to adjust the CPU for.
    TeamId 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.
    Cpu string
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    ProjectId string
    The ID of the Project to adjust the CPU for.
    TeamId 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.
    cpu String
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    projectId String
    The ID of the Project to adjust the CPU for.
    teamId 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.
    cpu string
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    projectId string
    The ID of the Project to adjust the CPU for.
    teamId 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.
    cpu str
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    project_id str
    The ID of the Project to adjust the CPU for.
    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.
    cpu String
    The amount of CPU available to your Serverless Functions. Should be one of 'basic' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).
    projectId String
    The ID of the Project to adjust the CPU for.
    teamId 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

    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/projectFunctionCpu:ProjectFunctionCpu 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.11.0 published on Thursday, May 23, 2024 by Pulumiverse