All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.billing.kotlin.ProjectInfoArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.billing.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.billing.ProjectInfoArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Billing information for a project.
 * To get more information about ProjectInfo, see:
 * * [API documentation](https://cloud.google.com/billing/docs/reference/rest/v1/projects)
 * * How-to Guides
 *     * [Enable, disable, or change billing for a project](https://cloud.google.com/billing/docs/how-to/modify-project)
 * ## Example Usage
 * ### Billing Project Info Basic
 * 
 * ```typescript
 * 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",
 * });
 * ```
 * ```python
 * 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")
 * ```
 * ```csharp
 * 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",
 *     });
 * });
 * ```
 * ```go
 * 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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ```yaml
 * 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
 * ```
 * 
 * ## 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:
 * ```sh
 * $ pulumi import gcp:billing/projectInfo:ProjectInfo default projects/{{project}}
 * ```
 * ```sh
 * $ pulumi import gcp:billing/projectInfo:ProjectInfo default {{project}}
 * ```
 * @property billingAccount 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 `""`.
 * - - -
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 */
public data class ProjectInfoArgs(
    public val billingAccount: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.billing.ProjectInfoArgs =
        com.pulumi.gcp.billing.ProjectInfoArgs.builder()
            .billingAccount(billingAccount?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ProjectInfoArgs].
 */
@PulumiTagMarker
public class ProjectInfoArgsBuilder internal constructor() {
    private var billingAccount: Output? = null

    private var project: Output? = null

    /**
     * @param value 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 `""`.
     * - - -
     */
    @JvmName("gfsbqclfuodbcump")
    public suspend fun billingAccount(`value`: Output) {
        this.billingAccount = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("oyceexkrqynwbrop")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value 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 `""`.
     * - - -
     */
    @JvmName("cnrwabujqtlcncca")
    public suspend fun billingAccount(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.billingAccount = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("sdvyyjvlygqarjdx")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    internal fun build(): ProjectInfoArgs = ProjectInfoArgs(
        billingAccount = billingAccount,
        project = project,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy