scm.Folder
Explore with Pulumi AI
Retrieves a config item.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as scm from "@pulumi/scm";
const snip1 = new scm.Snippet("snip1", {name: "foobar"});
const example = new scm.Folder("example", {
name: "my folder",
parent: "Shared",
description: "Made by Pulumi",
snippets: [snip1.name],
});
import pulumi
import pulumi_scm as scm
snip1 = scm.Snippet("snip1", name="foobar")
example = scm.Folder("example",
name="my folder",
parent="Shared",
description="Made by Pulumi",
snippets=[snip1.name])
package main
import (
"github.com/pulumi/pulumi-scm/sdk/go/scm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
snip1, err := scm.NewSnippet(ctx, "snip1", &scm.SnippetArgs{
Name: pulumi.String("foobar"),
})
if err != nil {
return err
}
_, err = scm.NewFolder(ctx, "example", &scm.FolderArgs{
Name: pulumi.String("my folder"),
Parent: pulumi.String("Shared"),
Description: pulumi.String("Made by Pulumi"),
Snippets: pulumi.StringArray{
snip1.Name,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scm = Pulumi.Scm;
return await Deployment.RunAsync(() =>
{
var snip1 = new Scm.Snippet("snip1", new()
{
Name = "foobar",
});
var example = new Scm.Folder("example", new()
{
Name = "my folder",
Parent = "Shared",
Description = "Made by Pulumi",
Snippets = new[]
{
snip1.Name,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scm.Snippet;
import com.pulumi.scm.SnippetArgs;
import com.pulumi.scm.Folder;
import com.pulumi.scm.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 snip1 = new Snippet("snip1", SnippetArgs.builder()
.name("foobar")
.build());
var example = new Folder("example", FolderArgs.builder()
.name("my folder")
.parent("Shared")
.description("Made by Pulumi")
.snippets(snip1.name())
.build());
}
}
resources:
example:
type: scm:Folder
properties:
name: my folder
parent: Shared
description: Made by Pulumi
snippets:
- ${snip1.name}
snip1:
type: scm:Snippet
properties:
name: foobar
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,
parent: Optional[str] = None,
description: Optional[str] = None,
labels: Optional[Sequence[str]] = None,
name: Optional[str] = None,
snippets: Optional[Sequence[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: scm: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 Scm.Folder("folderResource", new()
{
Parent = "string",
Description = "string",
Labels = new[]
{
"string",
},
Name = "string",
Snippets = new[]
{
"string",
},
});
example, err := scm.NewFolder(ctx, "folderResource", &scm.FolderArgs{
Parent: pulumi.String("string"),
Description: pulumi.String("string"),
Labels: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
Snippets: pulumi.StringArray{
pulumi.String("string"),
},
})
var folderResource = new Folder("folderResource", FolderArgs.builder()
.parent("string")
.description("string")
.labels("string")
.name("string")
.snippets("string")
.build());
folder_resource = scm.Folder("folderResource",
parent="string",
description="string",
labels=["string"],
name="string",
snippets=["string"])
const folderResource = new scm.Folder("folderResource", {
parent: "string",
description: "string",
labels: ["string"],
name: "string",
snippets: ["string"],
});
type: scm:Folder
properties:
description: string
labels:
- string
name: string
parent: string
snippets:
- 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:
- Parent string
- The Parent param.
- Description string
- The Description param.
- Labels List<string>
- The Labels param.
- Name string
- The Name param.
- Snippets List<string>
- The Snippets param.
- Parent string
- The Parent param.
- Description string
- The Description param.
- Labels []string
- The Labels param.
- Name string
- The Name param.
- Snippets []string
- The Snippets param.
- parent String
- The Parent param.
- description String
- The Description param.
- labels List<String>
- The Labels param.
- name String
- The Name param.
- snippets List<String>
- The Snippets param.
- parent string
- The Parent param.
- description string
- The Description param.
- labels string[]
- The Labels param.
- name string
- The Name param.
- snippets string[]
- The Snippets param.
- parent str
- The Parent param.
- description str
- The Description param.
- labels Sequence[str]
- The Labels param.
- name str
- The Name param.
- snippets Sequence[str]
- The Snippets param.
- parent String
- The Parent param.
- description String
- The Description param.
- labels List<String>
- The Labels param.
- name String
- The Name param.
- snippets List<String>
- The Snippets param.
Outputs
All input properties are implicitly available as output properties. Additionally, the Folder resource produces the following output properties:
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,
description: Optional[str] = None,
labels: Optional[Sequence[str]] = None,
name: Optional[str] = None,
parent: Optional[str] = None,
snippets: Optional[Sequence[str]] = None,
tfid: 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: scm:Folder get: id: ${id}
- 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.
Package Details
- Repository
- scm pulumi/pulumi-scm
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scm
Terraform Provider.