com.pulumi.gcp.organizations.kotlin.FolderArgs.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.organizations.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.organizations.FolderArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Allows management of a Google Cloud Platform folder. For more information see
* [the official documentation](https://cloud.google.com/resource-manager/docs/creating-managing-folders)
* and
* [API](https://cloud.google.com/resource-manager/reference/rest/v2/folders).
* A folder can contain projects, other folders, or a combination of both. You can use folders to group projects under an organization in a hierarchy. For example, your organization might contain multiple departments, each with its own set of Cloud Platform resources. Folders allows you to group these resources on a per-department basis. Folders are used to group resources that share common IAM policies.
* Folders created live inside an Organization. See the [Organization documentation](https://cloud.google.com/resource-manager/docs/quickstarts) for more details.
* The service account used to run the provider when creating a `gcp.organizations.Folder`
* resource must have `roles/resourcemanager.folderCreator`. See the
* [Access Control for Folders Using IAM](https://cloud.google.com/resource-manager/docs/access-control-folders)
* doc for more information.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* // Top-level folder under an organization.
* const department1 = new gcp.organizations.Folder("department1", {
* displayName: "Department 1",
* parent: "organizations/1234567",
* });
* // Folder nested under another folder.
* const team_abc = new gcp.organizations.Folder("team-abc", {
* displayName: "Team ABC",
* parent: department1.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* # Top-level folder under an organization.
* department1 = gcp.organizations.Folder("department1",
* display_name="Department 1",
* parent="organizations/1234567")
* # Folder nested under another folder.
* team_abc = gcp.organizations.Folder("team-abc",
* display_name="Team ABC",
* parent=department1.name)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* // Top-level folder under an organization.
* var department1 = new Gcp.Organizations.Folder("department1", new()
* {
* DisplayName = "Department 1",
* Parent = "organizations/1234567",
* });
* // Folder nested under another folder.
* var team_abc = new Gcp.Organizations.Folder("team-abc", new()
* {
* DisplayName = "Team ABC",
* Parent = 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 {
* // Top-level folder under an organization.
* department1, err := organizations.NewFolder(ctx, "department1", &organizations.FolderArgs{
* DisplayName: pulumi.String("Department 1"),
* Parent: pulumi.String("organizations/1234567"),
* })
* if err != nil {
* return err
* }
* // Folder nested under another folder.
* _, err = organizations.NewFolder(ctx, "team-abc", &organizations.FolderArgs{
* DisplayName: pulumi.String("Team ABC"),
* Parent: 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 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) {
* // Top-level folder under an organization.
* var department1 = new Folder("department1", FolderArgs.builder()
* .displayName("Department 1")
* .parent("organizations/1234567")
* .build());
* // Folder nested under another folder.
* var team_abc = new Folder("team-abc", FolderArgs.builder()
* .displayName("Team ABC")
* .parent(department1.name())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Top-level folder under an organization.
* department1:
* type: gcp:organizations:Folder
* properties:
* displayName: Department 1
* parent: organizations/1234567
* # Folder nested under another folder.
* team-abc:
* type: gcp:organizations:Folder
* properties:
* displayName: Team ABC
* parent: ${department1.name}
* ```
*
* ## Import
* Folders can be imported using the folder's id, e.g.
* * `folders/{{folder_id}}`
* * `{{folder_id}}`
* When using the `pulumi import` command, Folders can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:organizations/folder:Folder default {{folder_id}}
* ```
* ```sh
* $ pulumi import gcp:organizations/folder:Folder default folders/{{folder_id}}
* ```
* @property displayName The folder’s display name.
* A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters.
* @property parent The resource name of the parent Folder or Organization.
* Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
*/
public data class FolderArgs(
public val displayName: Output? = null,
public val parent: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.organizations.FolderArgs =
com.pulumi.gcp.organizations.FolderArgs.builder()
.displayName(displayName?.applyValue({ args0 -> args0 }))
.parent(parent?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [FolderArgs].
*/
@PulumiTagMarker
public class FolderArgsBuilder internal constructor() {
private var displayName: Output? = null
private var parent: Output? = null
/**
* @param value The folder’s display name.
* A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters.
*/
@JvmName("mwcukadhcenlifsq")
public suspend fun displayName(`value`: Output) {
this.displayName = value
}
/**
* @param value The resource name of the parent Folder or Organization.
* Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
*/
@JvmName("avokrdfeykrbktia")
public suspend fun parent(`value`: Output) {
this.parent = value
}
/**
* @param value The folder’s display name.
* A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters.
*/
@JvmName("rcwuhhkasbmipuky")
public suspend fun displayName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.displayName = mapped
}
/**
* @param value The resource name of the parent Folder or Organization.
* Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
*/
@JvmName("mudlanynejhrmwmm")
public suspend fun parent(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.parent = mapped
}
internal fun build(): FolderArgs = FolderArgs(
displayName = displayName,
parent = parent,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy