com.pulumi.gcp.projects.kotlin.UsageExportBucketArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.projects.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.projects.UsageExportBucketArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* 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](https://cloud.google.com/resource-manager/docs/quickstarts) 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](https://cloud.google.com/resource-manager/docs/access-control-org)
* 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.
* To get more information about projects, see:
* * [API documentation](https://cloud.google.com/resource-manager/reference/rest/v1/projects)
* * How-to Guides
* * [Creating and managing projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects)
* ## Example Usage
*
* ```typescript
* 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",
* });
* ```
* ```python
* 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")
* ```
* ```csharp
* 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",
* });
* });
* ```
* ```go
* package main
* import (
* "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 {
* _, 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
* })
* }
* ```
* ```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 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());
* }
* }
* ```
* ```yaml
* 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
*
* ```typescript
* 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,
* });
* ```
* ```python
* 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)
* ```
* ```csharp
* 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,
* });
* });
* ```
* ```go
* package main
* import (
* "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 {
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* ## 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:
* ```sh
* $ pulumi import gcp:projects/usageExportBucket:UsageExportBucket default {{project_id}}
* ```
* @property bucketName The bucket to store reports in.
* @property prefix A prefix for the reports, for instance, the project name.
* @property project The project to set the export bucket on. If it is not provided, the provider project is used.
*/
public data class UsageExportBucketArgs(
public val bucketName: Output? = null,
public val prefix: Output? = null,
public val project: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.projects.UsageExportBucketArgs =
com.pulumi.gcp.projects.UsageExportBucketArgs.builder()
.bucketName(bucketName?.applyValue({ args0 -> args0 }))
.prefix(prefix?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [UsageExportBucketArgs].
*/
@PulumiTagMarker
public class UsageExportBucketArgsBuilder internal constructor() {
private var bucketName: Output? = null
private var prefix: Output? = null
private var project: Output? = null
/**
* @param value The bucket to store reports in.
*/
@JvmName("ogrripppandcxtry")
public suspend fun bucketName(`value`: Output) {
this.bucketName = value
}
/**
* @param value A prefix for the reports, for instance, the project name.
*/
@JvmName("dqamhsnqitoybshd")
public suspend fun prefix(`value`: Output) {
this.prefix = value
}
/**
* @param value The project to set the export bucket on. If it is not provided, the provider project is used.
*/
@JvmName("xgefaxnqflbpkuna")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value The bucket to store reports in.
*/
@JvmName("kogronbvyspmhdnn")
public suspend fun bucketName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.bucketName = mapped
}
/**
* @param value A prefix for the reports, for instance, the project name.
*/
@JvmName("qksclxjwoksedjjh")
public suspend fun prefix(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.prefix = mapped
}
/**
* @param value The project to set the export bucket on. If it is not provided, the provider project is used.
*/
@JvmName("deesrxmmashcisis")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
internal fun build(): UsageExportBucketArgs = UsageExportBucketArgs(
bucketName = bucketName,
prefix = prefix,
project = project,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy