1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. billing
  5. ProjectInfo
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

gcp.billing.ProjectInfo

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

    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_81126",
        name: "tf-test_88717",
        orgId: "123456789",
    });
    const _default = new gcp.billing.ProjectInfo("default", {
        project: project.projectId,
        billingAccount: "000000-0000000-0000000-000000",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    project = gcp.organizations.Project("project",
        project_id="tf-test_81126",
        name="tf-test_88717",
        org_id="123456789")
    default = gcp.billing.ProjectInfo("default",
        project=project.project_id,
        billing_account="000000-0000000-0000000-000000")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/billing"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/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_81126"),
    			Name:      pulumi.String("tf-test_88717"),
    			OrgId:     pulumi.String("123456789"),
    		})
    		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
    	})
    }
    
    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_81126",
            Name = "tf-test_88717",
            OrgId = "123456789",
        });
    
        var @default = new Gcp.Billing.ProjectInfo("default", new()
        {
            Project = project.ProjectId,
            BillingAccount = "000000-0000000-0000000-000000",
        });
    
    });
    
    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_81126")
                .name("tf-test_88717")
                .orgId("123456789")
                .build());
    
            var default_ = new ProjectInfo("default", ProjectInfoArgs.builder()
                .project(project.projectId())
                .billingAccount("000000-0000000-0000000-000000")
                .build());
    
        }
    }
    
    resources:
      project:
        type: gcp:organizations:Project
        properties:
          projectId: tf-test_81126
          name: tf-test_88717
          orgId: '123456789'
      default:
        type: gcp:billing:ProjectInfo
        properties:
          project: ${project.projectId}
          billingAccount: 000000-0000000-0000000-000000
    

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

    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

    The ProjectInfo resource accepts the following input properties:

    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 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 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 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 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 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 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)
    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:
    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 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 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 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 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 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 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}}
    
    $ pulumi import gcp:billing/projectInfo:ProjectInfo default {{project}}
    

    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 v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi