1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. billing
  5. ProjectInfo
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.billing.ProjectInfo

Explore with Pulumi AI

Billing information for a project.

To get more information about ProjectInfo, see:

Example Usage

Billing Project Info Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const project = new gcp.organizations.Project("project", {
    projectId: "tf-test_88717",
    name: "tf-test_85794",
    orgId: "123456789",
    deletionPolicy: "DELETE",
});
const _default = new gcp.billing.ProjectInfo("default", {
    project: project.projectId,
    billingAccount: "000000-0000000-0000000-000000",
});
Copy
import pulumi
import pulumi_gcp as gcp

project = gcp.organizations.Project("project",
    project_id="tf-test_88717",
    name="tf-test_85794",
    org_id="123456789",
    deletion_policy="DELETE")
default = gcp.billing.ProjectInfo("default",
    project=project.project_id,
    billing_account="000000-0000000-0000000-000000")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/billing"
	"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 {
		project, err := organizations.NewProject(ctx, "project", &organizations.ProjectArgs{
			ProjectId:      pulumi.String("tf-test_88717"),
			Name:           pulumi.String("tf-test_85794"),
			OrgId:          pulumi.String("123456789"),
			DeletionPolicy: pulumi.String("DELETE"),
		})
		if err != nil {
			return err
		}
		_, err = billing.NewProjectInfo(ctx, "default", &billing.ProjectInfoArgs{
			Project:        project.ProjectId,
			BillingAccount: pulumi.String("000000-0000000-0000000-000000"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var project = new Gcp.Organizations.Project("project", new()
    {
        ProjectId = "tf-test_88717",
        Name = "tf-test_85794",
        OrgId = "123456789",
        DeletionPolicy = "DELETE",
    });

    var @default = new Gcp.Billing.ProjectInfo("default", new()
    {
        Project = project.ProjectId,
        BillingAccount = "000000-0000000-0000000-000000",
    });

});
Copy
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 com.pulumi.gcp.billing.ProjectInfo;
import com.pulumi.gcp.billing.ProjectInfoArgs;
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 project = new Project("project", ProjectArgs.builder()
            .projectId("tf-test_88717")
            .name("tf-test_85794")
            .orgId("123456789")
            .deletionPolicy("DELETE")
            .build());

        var default_ = new ProjectInfo("default", ProjectInfoArgs.builder()
            .project(project.projectId())
            .billingAccount("000000-0000000-0000000-000000")
            .build());

    }
}
Copy
resources:
  project:
    type: gcp:organizations:Project
    properties:
      projectId: tf-test_88717
      name: tf-test_85794
      orgId: '123456789'
      deletionPolicy: DELETE
  default:
    type: gcp:billing:ProjectInfo
    properties:
      project: ${project.projectId}
      billingAccount: 000000-0000000-0000000-000000
Copy

Create ProjectInfo Resource

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

Constructor syntax

new ProjectInfo(name: string, args: ProjectInfoArgs, opts?: CustomResourceOptions);
@overload
def ProjectInfo(resource_name: str,
                args: ProjectInfoArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def ProjectInfo(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                billing_account: Optional[str] = None,
                project: Optional[str] = None)
func NewProjectInfo(ctx *Context, name string, args ProjectInfoArgs, opts ...ResourceOption) (*ProjectInfo, error)
public ProjectInfo(string name, ProjectInfoArgs args, CustomResourceOptions? opts = null)
public ProjectInfo(String name, ProjectInfoArgs args)
public ProjectInfo(String name, ProjectInfoArgs args, CustomResourceOptions options)
type: gcp:billing:ProjectInfo
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ProjectInfoArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ProjectInfoArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ProjectInfoArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ProjectInfoArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ProjectInfoArgs
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 projectInfoResource = new Gcp.Billing.ProjectInfo("projectInfoResource", new()
{
    BillingAccount = "string",
    Project = "string",
});
Copy
example, err := billing.NewProjectInfo(ctx, "projectInfoResource", &billing.ProjectInfoArgs{
	BillingAccount: pulumi.String("string"),
	Project:        pulumi.String("string"),
})
Copy
var projectInfoResource = new ProjectInfo("projectInfoResource", ProjectInfoArgs.builder()
    .billingAccount("string")
    .project("string")
    .build());
Copy
project_info_resource = gcp.billing.ProjectInfo("projectInfoResource",
    billing_account="string",
    project="string")
Copy
const projectInfoResource = new gcp.billing.ProjectInfo("projectInfoResource", {
    billingAccount: "string",
    project: "string",
});
Copy
type: gcp:billing:ProjectInfo
properties:
    billingAccount: string
    project: string
Copy

ProjectInfo Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ProjectInfo resource accepts the following input properties:

BillingAccount This property is required. string
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
BillingAccount This property is required. string
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
billingAccount This property is required. String
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
billingAccount This property is required. string
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
billing_account This property is required. str
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
billingAccount This property is required. String
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

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

Get an existing ProjectInfo 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?: ProjectInfoState, opts?: CustomResourceOptions): ProjectInfo
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        billing_account: Optional[str] = None,
        project: Optional[str] = None) -> ProjectInfo
func GetProjectInfo(ctx *Context, name string, id IDInput, state *ProjectInfoState, opts ...ResourceOption) (*ProjectInfo, error)
public static ProjectInfo Get(string name, Input<string> id, ProjectInfoState? state, CustomResourceOptions? opts = null)
public static ProjectInfo get(String name, Output<String> id, ProjectInfoState state, CustomResourceOptions options)
resources:  _:    type: gcp:billing:ProjectInfo    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
BillingAccount string
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
BillingAccount string
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
billingAccount String
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
billingAccount string
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
billing_account str
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
billingAccount String
The ID of the billing account associated with the project, if any. Set to empty string to disable billing for the project. For example, "012345-567890-ABCDEF" or "".


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Import

ProjectInfo can be imported using any of these accepted formats:

  • projects/{{project}}

  • {{project}}

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

$ pulumi import gcp:billing/projectInfo:ProjectInfo default projects/{{project}}
Copy
$ pulumi import gcp:billing/projectInfo:ProjectInfo default {{project}}
Copy

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.