gcp.organizations.Folder
Explore with Pulumi AI
Allows management of a Google Cloud Platform folder. For more information see the official documentation and API.
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 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
doc for more information.
It may take a while for the attached tag bindings to be deleted after the folder is scheduled to be deleted.
Create Folder Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Folder(name: string, args: FolderArgs, opts?: CustomResourceOptions);
@overload
def Folder(resource_name: str,
args: FolderArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Folder(resource_name: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
parent: Optional[str] = None,
deletion_protection: Optional[bool] = None,
tags: Optional[Mapping[str, str]] = None)
func NewFolder(ctx *Context, name string, args FolderArgs, opts ...ResourceOption) (*Folder, error)
public Folder(string name, FolderArgs args, CustomResourceOptions? opts = null)
public Folder(String name, FolderArgs args)
public Folder(String name, FolderArgs args, CustomResourceOptions options)
type: gcp:organizations:Folder
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 FolderArgs
- 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 FolderArgs
- 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 FolderArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FolderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FolderArgs
- 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 folderResource = new Gcp.Organizations.Folder("folderResource", new()
{
DisplayName = "string",
Parent = "string",
DeletionProtection = false,
Tags =
{
{ "string", "string" },
},
});
example, err := organizations.NewFolder(ctx, "folderResource", &organizations.FolderArgs{
DisplayName: pulumi.String("string"),
Parent: pulumi.String("string"),
DeletionProtection: pulumi.Bool(false),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var folderResource = new Folder("folderResource", FolderArgs.builder()
.displayName("string")
.parent("string")
.deletionProtection(false)
.tags(Map.of("string", "string"))
.build());
folder_resource = gcp.organizations.Folder("folderResource",
display_name="string",
parent="string",
deletion_protection=False,
tags={
"string": "string",
})
const folderResource = new gcp.organizations.Folder("folderResource", {
displayName: "string",
parent: "string",
deletionProtection: false,
tags: {
string: "string",
},
});
type: gcp:organizations:Folder
properties:
deletionProtection: false
displayName: string
parent: string
tags:
string: string
Folder Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Folder resource accepts the following input properties:
- Display
Name string - 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.
- Parent string
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - Deletion
Protection bool - Dictionary<string, string>
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- Display
Name string - 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.
- Parent string
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - Deletion
Protection bool - map[string]string
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- display
Name String - 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.
- parent String
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - deletion
Protection Boolean - Map<String,String>
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- display
Name string - 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.
- parent string
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - deletion
Protection boolean - {[key: string]: string}
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- display_
name str - 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.
- parent str
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - deletion_
protection bool - Mapping[str, str]
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- display
Name String - 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.
- parent String
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - deletion
Protection Boolean - Map<String>
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Folder resource produces the following output properties:
- Create
Time string - 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".
- Folder
Id string - The folder id from the name "folders/{folder_id}"
- Id string
- The provider-assigned unique ID for this managed resource.
- Lifecycle
State string - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - Name string
- The resource name of the Folder. Its format is folders/{folder_id}.
- Create
Time string - 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".
- Folder
Id string - The folder id from the name "folders/{folder_id}"
- Id string
- The provider-assigned unique ID for this managed resource.
- Lifecycle
State string - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - Name string
- The resource name of the Folder. Its format is folders/{folder_id}.
- create
Time String - 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".
- folder
Id String - The folder id from the name "folders/{folder_id}"
- id String
- The provider-assigned unique ID for this managed resource.
- lifecycle
State String - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - name String
- The resource name of the Folder. Its format is folders/{folder_id}.
- create
Time string - 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".
- folder
Id string - The folder id from the name "folders/{folder_id}"
- id string
- The provider-assigned unique ID for this managed resource.
- lifecycle
State string - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - name string
- The resource name of the Folder. Its format is folders/{folder_id}.
- create_
time str - 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".
- folder_
id str - The folder id from the name "folders/{folder_id}"
- id str
- The provider-assigned unique ID for this managed resource.
- lifecycle_
state str - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - name str
- The resource name of the Folder. Its format is folders/{folder_id}.
- create
Time String - 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".
- folder
Id String - The folder id from the name "folders/{folder_id}"
- id String
- The provider-assigned unique ID for this managed resource.
- lifecycle
State String - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - name String
- The resource name of the Folder. Its format is folders/{folder_id}.
Look up Existing Folder Resource
Get an existing Folder 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?: FolderState, opts?: CustomResourceOptions): Folder
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
deletion_protection: Optional[bool] = None,
display_name: Optional[str] = None,
folder_id: Optional[str] = None,
lifecycle_state: Optional[str] = None,
name: Optional[str] = None,
parent: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None) -> Folder
func GetFolder(ctx *Context, name string, id IDInput, state *FolderState, opts ...ResourceOption) (*Folder, error)
public static Folder Get(string name, Input<string> id, FolderState? state, CustomResourceOptions? opts = null)
public static Folder get(String name, Output<String> id, FolderState 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.
- Create
Time string - 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".
- Deletion
Protection bool - Display
Name string - 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.
- Folder
Id string - The folder id from the name "folders/{folder_id}"
- Lifecycle
State string - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - Name string
- The resource name of the Folder. Its format is folders/{folder_id}.
- Parent string
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - Dictionary<string, string>
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- Create
Time string - 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".
- Deletion
Protection bool - Display
Name string - 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.
- Folder
Id string - The folder id from the name "folders/{folder_id}"
- Lifecycle
State string - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - Name string
- The resource name of the Folder. Its format is folders/{folder_id}.
- Parent string
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - map[string]string
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- create
Time String - 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".
- deletion
Protection Boolean - display
Name String - 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.
- folder
Id String - The folder id from the name "folders/{folder_id}"
- lifecycle
State String - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - name String
- The resource name of the Folder. Its format is folders/{folder_id}.
- parent String
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - Map<String,String>
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- create
Time string - 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".
- deletion
Protection boolean - display
Name string - 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.
- folder
Id string - The folder id from the name "folders/{folder_id}"
- lifecycle
State string - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - name string
- The resource name of the Folder. Its format is folders/{folder_id}.
- parent string
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - {[key: string]: string}
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- create_
time str - 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".
- deletion_
protection bool - display_
name str - 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.
- folder_
id str - The folder id from the name "folders/{folder_id}"
- lifecycle_
state str - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - name str
- The resource name of the Folder. Its format is folders/{folder_id}.
- parent str
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - Mapping[str, str]
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
- create
Time String - 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".
- deletion
Protection Boolean - display
Name String - 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.
- folder
Id String - The folder id from the name "folders/{folder_id}"
- lifecycle
State String - The lifecycle state of the folder such as
ACTIVE
orDELETE_REQUESTED
. - name String
- The resource name of the Folder. Its format is folders/{folder_id}.
- parent String
- The resource name of the parent Folder or Organization.
Must be of the form
folders/{folder_id}
ororganizations/{org_id}
. - Map<String>
- A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the
gcp.tags.TagValue
resource.
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:
$ pulumi import gcp:organizations/folder:Folder default {{folder_id}}
$ pulumi import gcp:organizations/folder:Folder default folders/{{folder_id}}
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.