1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. organizations
  5. Project
Google Cloud Classic v8.5.0 published on Tuesday, Oct 8, 2024 by Pulumi

gcp.organizations.Project

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.5.0 published on Tuesday, Oct 8, 2024 by Pulumi

    Allows creation and management of a Google Cloud Platform project.

    Projects created with this resource must be associated with an Organization. See the Organization documentation for more details.

    The user or service account that is running this provider when creating a gcp.organizations.Project resource must have roles/resourcemanager.projectCreator on the specified organization. See the Access Control for Organizations Using IAM doc for more information.

    This resource reads the specified billing account on every pulumi up and plan operation so you must have permissions on the specified billing account.

    It is recommended to use the constraints/compute.skipDefaultNetworkCreation constraint to remove the default network instead of setting auto_create_network to false, when possible.

    It may take a while for the attached tag bindings to be deleted after the project is scheduled to be deleted.

    To get more information about projects, see:

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const myProject = new gcp.organizations.Project("my_project", {
        name: "My Project",
        projectId: "your-project-id",
        orgId: "1234567",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_project = gcp.organizations.Project("my_project",
        name="My Project",
        project_id="your-project-id",
        org_id="1234567")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := organizations.NewProject(ctx, "my_project", &organizations.ProjectArgs{
    			Name:      pulumi.String("My Project"),
    			ProjectId: pulumi.String("your-project-id"),
    			OrgId:     pulumi.String("1234567"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var myProject = new Gcp.Organizations.Project("my_project", new()
        {
            Name = "My Project",
            ProjectId = "your-project-id",
            OrgId = "1234567",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.organizations.Project;
    import com.pulumi.gcp.organizations.ProjectArgs;
    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 myProject = new Project("myProject", ProjectArgs.builder()
                .name("My Project")
                .projectId("your-project-id")
                .orgId("1234567")
                .build());
    
        }
    }
    
    resources:
      myProject:
        type: gcp:organizations:Project
        name: my_project
        properties:
          name: My Project
          projectId: your-project-id
          orgId: '1234567'
    

    To create a project under a specific folder

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const department1 = new gcp.organizations.Folder("department1", {
        displayName: "Department 1",
        parent: "organizations/1234567",
    });
    const myProject_in_a_folder = new gcp.organizations.Project("my_project-in-a-folder", {
        name: "My Project",
        projectId: "your-project-id",
        folderId: department1.name,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    department1 = gcp.organizations.Folder("department1",
        display_name="Department 1",
        parent="organizations/1234567")
    my_project_in_a_folder = gcp.organizations.Project("my_project-in-a-folder",
        name="My Project",
        project_id="your-project-id",
        folder_id=department1.name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		department1, err := organizations.NewFolder(ctx, "department1", &organizations.FolderArgs{
    			DisplayName: pulumi.String("Department 1"),
    			Parent:      pulumi.String("organizations/1234567"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = organizations.NewProject(ctx, "my_project-in-a-folder", &organizations.ProjectArgs{
    			Name:      pulumi.String("My Project"),
    			ProjectId: pulumi.String("your-project-id"),
    			FolderId:  department1.Name,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var department1 = new Gcp.Organizations.Folder("department1", new()
        {
            DisplayName = "Department 1",
            Parent = "organizations/1234567",
        });
    
        var myProject_in_a_folder = new Gcp.Organizations.Project("my_project-in-a-folder", new()
        {
            Name = "My Project",
            ProjectId = "your-project-id",
            FolderId = department1.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.organizations.Folder;
    import com.pulumi.gcp.organizations.FolderArgs;
    import com.pulumi.gcp.organizations.Project;
    import com.pulumi.gcp.organizations.ProjectArgs;
    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 department1 = new Folder("department1", FolderArgs.builder()
                .displayName("Department 1")
                .parent("organizations/1234567")
                .build());
    
            var myProject_in_a_folder = new Project("myProject-in-a-folder", ProjectArgs.builder()
                .name("My Project")
                .projectId("your-project-id")
                .folderId(department1.name())
                .build());
    
        }
    }
    
    resources:
      myProject-in-a-folder:
        type: gcp:organizations:Project
        name: my_project-in-a-folder
        properties:
          name: My Project
          projectId: your-project-id
          folderId: ${department1.name}
      department1:
        type: gcp:organizations:Folder
        properties:
          displayName: Department 1
          parent: organizations/1234567
    

    To create a project with a tag

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const myProject = new gcp.organizations.Project("my_project", {
        name: "My Project",
        projectId: "your-project-id",
        orgId: "1234567",
        tags: {
            "1234567/env": "staging",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_project = gcp.organizations.Project("my_project",
        name="My Project",
        project_id="your-project-id",
        org_id="1234567",
        tags={
            "1234567/env": "staging",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := organizations.NewProject(ctx, "my_project", &organizations.ProjectArgs{
    			Name:      pulumi.String("My Project"),
    			ProjectId: pulumi.String("your-project-id"),
    			OrgId:     pulumi.String("1234567"),
    			Tags: pulumi.StringMap{
    				"1234567/env": pulumi.String("staging"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var myProject = new Gcp.Organizations.Project("my_project", new()
        {
            Name = "My Project",
            ProjectId = "your-project-id",
            OrgId = "1234567",
            Tags = 
            {
                { "1234567/env", "staging" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.organizations.Project;
    import com.pulumi.gcp.organizations.ProjectArgs;
    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 myProject = new Project("myProject", ProjectArgs.builder()
                .name("My Project")
                .projectId("your-project-id")
                .orgId("1234567")
                .tags(Map.of("1234567/env", "staging"))
                .build());
    
        }
    }
    
    resources:
      myProject:
        type: gcp:organizations:Project
        name: my_project
        properties:
          name: My Project
          projectId: your-project-id
          orgId: '1234567'
          tags:
            1234567/env: staging
    

    Create Project Resource

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

    Constructor syntax

    new Project(name: string, args?: ProjectArgs, opts?: CustomResourceOptions);
    @overload
    def Project(resource_name: str,
                args: Optional[ProjectArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Project(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                auto_create_network: Optional[bool] = None,
                billing_account: Optional[str] = None,
                deletion_policy: Optional[str] = None,
                folder_id: Optional[str] = None,
                labels: Optional[Mapping[str, str]] = None,
                name: Optional[str] = None,
                org_id: Optional[str] = None,
                project_id: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None)
    func NewProject(ctx *Context, name string, args *ProjectArgs, opts ...ResourceOption) (*Project, error)
    public Project(string name, ProjectArgs? args = null, CustomResourceOptions? opts = null)
    public Project(String name, ProjectArgs args)
    public Project(String name, ProjectArgs args, CustomResourceOptions options)
    
    type: gcp:organizations:Project
    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 ProjectArgs
    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 ProjectArgs
    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 ProjectArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectArgs
    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 gcpProjectResource = new Gcp.Organizations.Project("gcpProjectResource", new()
    {
        AutoCreateNetwork = false,
        BillingAccount = "string",
        DeletionPolicy = "string",
        FolderId = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Name = "string",
        OrgId = "string",
        ProjectId = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := organizations.NewProject(ctx, "gcpProjectResource", &organizations.ProjectArgs{
    	AutoCreateNetwork: pulumi.Bool(false),
    	BillingAccount:    pulumi.String("string"),
    	DeletionPolicy:    pulumi.String("string"),
    	FolderId:          pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name:      pulumi.String("string"),
    	OrgId:     pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var gcpProjectResource = new Project("gcpProjectResource", ProjectArgs.builder()
        .autoCreateNetwork(false)
        .billingAccount("string")
        .deletionPolicy("string")
        .folderId("string")
        .labels(Map.of("string", "string"))
        .name("string")
        .orgId("string")
        .projectId("string")
        .tags(Map.of("string", "string"))
        .build());
    
    gcp_project_resource = gcp.organizations.Project("gcpProjectResource",
        auto_create_network=False,
        billing_account="string",
        deletion_policy="string",
        folder_id="string",
        labels={
            "string": "string",
        },
        name="string",
        org_id="string",
        project_id="string",
        tags={
            "string": "string",
        })
    
    const gcpProjectResource = new gcp.organizations.Project("gcpProjectResource", {
        autoCreateNetwork: false,
        billingAccount: "string",
        deletionPolicy: "string",
        folderId: "string",
        labels: {
            string: "string",
        },
        name: "string",
        orgId: "string",
        projectId: "string",
        tags: {
            string: "string",
        },
    });
    
    type: gcp:organizations:Project
    properties:
        autoCreateNetwork: false
        billingAccount: string
        deletionPolicy: string
        folderId: string
        labels:
            string: string
        name: string
        orgId: string
        projectId: string
        tags:
            string: string
    

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

    AutoCreateNetwork bool
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    BillingAccount string
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    DeletionPolicy string
    FolderId string
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    Labels Dictionary<string, string>
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    Name string
    The display name of the project.
    OrgId string
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    ProjectId string
    The project ID. Changing this forces a new project to be created.
    Tags Dictionary<string, string>
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    AutoCreateNetwork bool
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    BillingAccount string
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    DeletionPolicy string
    FolderId string
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    Labels map[string]string
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    Name string
    The display name of the project.
    OrgId string
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    ProjectId string
    The project ID. Changing this forces a new project to be created.
    Tags map[string]string
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    autoCreateNetwork Boolean
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    billingAccount String
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    deletionPolicy String
    folderId String
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    labels Map<String,String>
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name String
    The display name of the project.
    orgId String
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    projectId String
    The project ID. Changing this forces a new project to be created.
    tags Map<String,String>
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    autoCreateNetwork boolean
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    billingAccount string
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    deletionPolicy string
    folderId string
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    labels {[key: string]: string}
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name string
    The display name of the project.
    orgId string
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    projectId string
    The project ID. Changing this forces a new project to be created.
    tags {[key: string]: string}
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    auto_create_network bool
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    billing_account str
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    deletion_policy str
    folder_id str
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    labels Mapping[str, str]
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name str
    The display name of the project.
    org_id str
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    project_id str
    The project ID. Changing this forces a new project to be created.
    tags Mapping[str, str]
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    autoCreateNetwork Boolean
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    billingAccount String
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    deletionPolicy String
    folderId String
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    labels Map<String>
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name String
    The display name of the project.
    orgId String
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    projectId String
    The project ID. Changing this forces a new project to be created.
    tags Map<String>
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Project resource produces the following output properties:

    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    Number string
    The numeric identifier of the project.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    Number string
    The numeric identifier of the project.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    number String
    The numeric identifier of the project.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id string
    The provider-assigned unique ID for this managed resource.
    number string
    The numeric identifier of the project.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id str
    The provider-assigned unique ID for this managed resource.
    number str
    The numeric identifier of the project.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    number String
    The numeric identifier of the project.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.

    Look up Existing Project Resource

    Get an existing Project 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?: ProjectState, opts?: CustomResourceOptions): Project
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_create_network: Optional[bool] = None,
            billing_account: Optional[str] = None,
            deletion_policy: Optional[str] = None,
            effective_labels: Optional[Mapping[str, str]] = None,
            folder_id: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            name: Optional[str] = None,
            number: Optional[str] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None,
            pulumi_labels: Optional[Mapping[str, str]] = None,
            tags: Optional[Mapping[str, str]] = None) -> Project
    func GetProject(ctx *Context, name string, id IDInput, state *ProjectState, opts ...ResourceOption) (*Project, error)
    public static Project Get(string name, Input<string> id, ProjectState? state, CustomResourceOptions? opts = null)
    public static Project get(String name, Output<String> id, ProjectState 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:
    AutoCreateNetwork bool
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    BillingAccount string
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    DeletionPolicy string
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    FolderId string
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    Labels Dictionary<string, string>
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    Name string
    The display name of the project.
    Number string
    The numeric identifier of the project.
    OrgId string
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    ProjectId string
    The project ID. Changing this forces a new project to be created.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    Tags Dictionary<string, string>
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    AutoCreateNetwork bool
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    BillingAccount string
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    DeletionPolicy string
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    FolderId string
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    Labels map[string]string
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    Name string
    The display name of the project.
    Number string
    The numeric identifier of the project.
    OrgId string
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    ProjectId string
    The project ID. Changing this forces a new project to be created.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    Tags map[string]string
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    autoCreateNetwork Boolean
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    billingAccount String
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    deletionPolicy String
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    folderId String
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    labels Map<String,String>
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name String
    The display name of the project.
    number String
    The numeric identifier of the project.
    orgId String
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    projectId String
    The project ID. Changing this forces a new project to be created.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    tags Map<String,String>
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    autoCreateNetwork boolean
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    billingAccount string
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    deletionPolicy string
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    folderId string
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    labels {[key: string]: string}
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name string
    The display name of the project.
    number string
    The numeric identifier of the project.
    orgId string
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    projectId string
    The project ID. Changing this forces a new project to be created.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    tags {[key: string]: string}
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    auto_create_network bool
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    billing_account str
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    deletion_policy str
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    folder_id str
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    labels Mapping[str, str]
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name str
    The display name of the project.
    number str
    The numeric identifier of the project.
    org_id str
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    project_id str
    The project ID. Changing this forces a new project to be created.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    tags Mapping[str, str]
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.
    autoCreateNetwork Boolean
    Create the 'default' network automatically. Default true. If set to false, the default network will be deleted. Note that, for quota purposes, you will still need to have 1 network slot available to create the project successfully, even if you set auto_create_network to false, since the network will exist momentarily.
    billingAccount String
    The alphanumeric ID of the billing account this project belongs to. The user or service account performing this operation with the provider must have at mininum Billing Account User privileges (roles/billing.user) on the billing account. See Google Cloud Billing API Access Control for more details.
    deletionPolicy String
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    folderId String
    The numeric ID of the folder this project should be created under. Only one of org_id or folder_id may be specified. If the folder_id is specified, then the project is created under the specified folder. Changing this forces the project to be migrated to the newly specified folder.
    labels Map<String>
    A set of key/value label pairs to assign to the project. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
    name String
    The display name of the project.
    number String
    The numeric identifier of the project.
    orgId String
    The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.
    projectId String
    The project ID. Changing this forces a new project to be created.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    tags Map<String>
    A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated.

    Import

    Projects can be imported using the project_id, e.g.

    • {{project_id}}

    When using the pulumi import command, Projects can be imported using one of the formats above. For example:

    $ pulumi import gcp:organizations/project:Project default {{project_id}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.5.0 published on Tuesday, Oct 8, 2024 by Pulumi