1. Packages
  2. Port
  3. API Docs
  4. Folder
Port v2.6.0 published on Tuesday, Apr 15, 2025 by port-labs

port.Folder

Explore with Pulumi AI

A full list of the available folder types and their identifiers can be found here.

WARNING The folder resource is currently in beta and is subject to change in future versions. Use it by setting the Environment Variable PORT_BETA_FEATURES_ENABLED=true. If this Environment Variable isn’t specified, you won’t be able to use the resource.

Example Usage

Basic Folder

import * as pulumi from "@pulumi/pulumi";
import * as port from "@pulumi/port";

const exampleFolder = new port.index.Port_folder("exampleFolder", {
    identifier: "example_folder",
    title: "Example Folder",
});
Copy
import pulumi
import pulumi_port as port

example_folder = port.index.Port_folder("exampleFolder",
    identifier=example_folder,
    title=Example Folder)
Copy
package main

import (
	"github.com/port-labs/pulumi-port/sdk/v2/go/port"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := port.NewPort_folder(ctx, "exampleFolder", &port.Port_folderArgs{
			Identifier: "example_folder",
			Title:      "Example Folder",
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Port = Pulumi.Port;

return await Deployment.RunAsync(() => 
{
    var exampleFolder = new Port.Index.Port_folder("exampleFolder", new()
    {
        Identifier = "example_folder",
        Title = "Example Folder",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.port.port_folder;
import com.pulumi.port.Port_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 exampleFolder = new Port_folder("exampleFolder", Port_folderArgs.builder()
            .identifier("example_folder")
            .title("Example Folder")
            .build());

    }
}
Copy
resources:
  exampleFolder:
    type: port:port_folder
    properties:
      identifier: example_folder
      title: Example Folder
Copy

Folder with Parent

Create a folder inside another folder.

import * as pulumi from "@pulumi/pulumi";
import * as port from "@pulumi/port";

const childFolder = new port.index.Port_folder("childFolder", {
    identifier: "child_folder",
    parent: port_folder.example_folder.identifier,
    title: "Child Folder",
});
Copy
import pulumi
import pulumi_port as port

child_folder = port.index.Port_folder("childFolder",
    identifier=child_folder,
    parent=port_folder.example_folder.identifier,
    title=Child Folder)
Copy
package main

import (
	"github.com/port-labs/pulumi-port/sdk/v2/go/port"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := port.NewPort_folder(ctx, "childFolder", &port.Port_folderArgs{
			Identifier: "child_folder",
			Parent:     port_folder.Example_folder.Identifier,
			Title:      "Child Folder",
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Port = Pulumi.Port;

return await Deployment.RunAsync(() => 
{
    var childFolder = new Port.Index.Port_folder("childFolder", new()
    {
        Identifier = "child_folder",
        Parent = port_folder.Example_folder.Identifier,
        Title = "Child Folder",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.port.port_folder;
import com.pulumi.port.Port_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 childFolder = new Port_folder("childFolder", Port_folderArgs.builder()
            .identifier("child_folder")
            .parent(port_folder.example_folder().identifier())
            .title("Child Folder")
            .build());

    }
}
Copy
resources:
  childFolder:
    type: port:port_folder
    properties:
      identifier: child_folder
      parent: ${port_folder.example_folder.identifier}
      title: Child Folder
Copy

Folder with After

Create a folder after another folder.

import * as pulumi from "@pulumi/pulumi";
import * as port from "@pulumi/port";

const anotherFolder = new port.index.Port_folder("anotherFolder", {
    identifier: "another_folder",
    after: port_folder.example_folder.identifier,
    title: "Another Folder",
});
Copy
import pulumi
import pulumi_port as port

another_folder = port.index.Port_folder("anotherFolder",
    identifier=another_folder,
    after=port_folder.example_folder.identifier,
    title=Another Folder)
Copy
package main

import (
	"github.com/port-labs/pulumi-port/sdk/v2/go/port"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := port.NewPort_folder(ctx, "anotherFolder", &port.Port_folderArgs{
			Identifier: "another_folder",
			After:      port_folder.Example_folder.Identifier,
			Title:      "Another Folder",
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Port = Pulumi.Port;

return await Deployment.RunAsync(() => 
{
    var anotherFolder = new Port.Index.Port_folder("anotherFolder", new()
    {
        Identifier = "another_folder",
        After = port_folder.Example_folder.Identifier,
        Title = "Another Folder",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.port.port_folder;
import com.pulumi.port.Port_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 anotherFolder = new Port_folder("anotherFolder", Port_folderArgs.builder()
            .identifier("another_folder")
            .after(port_folder.example_folder().identifier())
            .title("Another Folder")
            .build());

    }
}
Copy
resources:
  anotherFolder:
    type: port:port_folder
    properties:
      identifier: another_folder
      after: ${port_folder.example_folder.identifier}
      title: Another Folder
Copy

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,
           identifier: Optional[str] = None,
           after: Optional[str] = None,
           parent: Optional[str] = None,
           title: Optional[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: port:Folder
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. FolderArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. FolderArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. FolderArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 Port.Folder("folderResource", new()
{
    Identifier = "string",
    After = "string",
    Parent = "string",
    Title = "string",
});
Copy
example, err := port.NewFolder(ctx, "folderResource", &port.FolderArgs{
	Identifier: pulumi.String("string"),
	After:      pulumi.String("string"),
	Parent:     pulumi.String("string"),
	Title:      pulumi.String("string"),
})
Copy
var folderResource = new Folder("folderResource", FolderArgs.builder()
    .identifier("string")
    .after("string")
    .parent("string")
    .title("string")
    .build());
Copy
folder_resource = port.Folder("folderResource",
    identifier="string",
    after="string",
    parent="string",
    title="string")
Copy
const folderResource = new port.Folder("folderResource", {
    identifier: "string",
    after: "string",
    parent: "string",
    title: "string",
});
Copy
type: port:Folder
properties:
    after: string
    identifier: string
    parent: string
    title: string
Copy

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:

Identifier This property is required. string
The identifier of the folder
After string
The identifier of the folder after which the folder should be placed
Parent string
The identifier of the parent folder
Title string
The title of the folder
Identifier This property is required. string
The identifier of the folder
After string
The identifier of the folder after which the folder should be placed
Parent string
The identifier of the parent folder
Title string
The title of the folder
identifier This property is required. String
The identifier of the folder
after String
The identifier of the folder after which the folder should be placed
parent String
The identifier of the parent folder
title String
The title of the folder
identifier This property is required. string
The identifier of the folder
after string
The identifier of the folder after which the folder should be placed
parent string
The identifier of the parent folder
title string
The title of the folder
identifier This property is required. str
The identifier of the folder
after str
The identifier of the folder after which the folder should be placed
parent str
The identifier of the parent folder
title str
The title of the folder
identifier This property is required. String
The identifier of the folder
after String
The identifier of the folder after which the folder should be placed
parent String
The identifier of the parent folder
title String
The title of the folder

Outputs

All input properties are implicitly available as output properties. Additionally, the Folder resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

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,
        after: Optional[str] = None,
        identifier: Optional[str] = None,
        parent: Optional[str] = None,
        title: Optional[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)
resources:  _:    type: port:Folder    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
After string
The identifier of the folder after which the folder should be placed
Identifier string
The identifier of the folder
Parent string
The identifier of the parent folder
Title string
The title of the folder
After string
The identifier of the folder after which the folder should be placed
Identifier string
The identifier of the folder
Parent string
The identifier of the parent folder
Title string
The title of the folder
after String
The identifier of the folder after which the folder should be placed
identifier String
The identifier of the folder
parent String
The identifier of the parent folder
title String
The title of the folder
after string
The identifier of the folder after which the folder should be placed
identifier string
The identifier of the folder
parent string
The identifier of the parent folder
title string
The title of the folder
after str
The identifier of the folder after which the folder should be placed
identifier str
The identifier of the folder
parent str
The identifier of the parent folder
title str
The title of the folder
after String
The identifier of the folder after which the folder should be placed
identifier String
The identifier of the folder
parent String
The identifier of the parent folder
title String
The title of the folder

Package Details

Repository
port port-labs/pulumi-port
License
Apache-2.0
Notes
This Pulumi package is based on the port-labs Terraform Provider.