Package com.pulumi.gcp.organizations
Class Folder
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.organizations.Folder
-
public class Folder extends com.pulumi.resources.CustomResource
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 ```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) { var department1 = new Folder("department1", FolderArgs.builder() .displayName("Department 1") .parent("organizations/1234567") .build()); var team_abc = new Folder("team-abc", FolderArgs.builder() .displayName("Team ABC") .parent(department1.name()) .build()); } } ``` ## Import Folders can be imported using the folder's id, e.g. * `folders/{{folder_id}}` * `{{folder_id}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Folders using one of the formats above. For exampletf import { id = "folders/{{folder_id}}" to = google_folder.default } ```sh $ pulumi import gcp:organizations/folder:Folder When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}} ```
-
-
Constructor Summary
Constructors Constructor Description Folder(java.lang.String name)
Folder(java.lang.String name, FolderArgs args)
Folder(java.lang.String name, FolderArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>
createTime()
com.pulumi.core.Output<java.lang.String>
displayName()
com.pulumi.core.Output<java.lang.String>
folderId()
static Folder
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, FolderState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
lifecycleState()
com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.lang.String>
parent()
-
-
-
Constructor Detail
-
Folder
public Folder(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
Folder
public Folder(java.lang.String name, FolderArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
Folder
public Folder(java.lang.String name, FolderArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
createTime
public com.pulumi.core.Output<java.lang.String> createTime()
- Returns:
- Timestamp when the Folder was created. Assigned by the server. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".
-
displayName
public com.pulumi.core.Output<java.lang.String> displayName()
- Returns:
- 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.
-
folderId
public com.pulumi.core.Output<java.lang.String> folderId()
- Returns:
- The folder id from the name "folders/{folder_id}"
-
lifecycleState
public com.pulumi.core.Output<java.lang.String> lifecycleState()
- Returns:
- The lifecycle state of the folder such as `ACTIVE` or `DELETE_REQUESTED`.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- The resource name of the Folder. Its format is folders/{folder_id}.
-
parent
public com.pulumi.core.Output<java.lang.String> parent()
- Returns:
- The resource name of the parent Folder or Organization. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
-
get
public static Folder get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable FolderState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-