scm.Snippet
Explore with Pulumi AI
Retrieves a config item.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as scm from "@pulumi/scm";
const example = new scm.Snippet("example", {});
import pulumi
import pulumi_scm as scm
example = scm.Snippet("example")
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 {
_, err := scm.NewSnippet(ctx, "example", nil)
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 example = new Scm.Snippet("example");
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scm.Snippet;
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 example = new Snippet("example");
}
}
resources:
example:
type: scm:Snippet
Create Snippet Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Snippet(name: string, args?: SnippetArgs, opts?: CustomResourceOptions);
@overload
def Snippet(resource_name: str,
args: Optional[SnippetArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Snippet(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
labels: Optional[Sequence[str]] = None,
name: Optional[str] = None)
func NewSnippet(ctx *Context, name string, args *SnippetArgs, opts ...ResourceOption) (*Snippet, error)
public Snippet(string name, SnippetArgs? args = null, CustomResourceOptions? opts = null)
public Snippet(String name, SnippetArgs args)
public Snippet(String name, SnippetArgs args, CustomResourceOptions options)
type: scm:Snippet
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 SnippetArgs
- 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 SnippetArgs
- 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 SnippetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnippetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SnippetArgs
- 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 snippetResource = new Scm.Snippet("snippetResource", new()
{
Description = "string",
Labels = new[]
{
"string",
},
Name = "string",
});
example, err := scm.NewSnippet(ctx, "snippetResource", &scm.SnippetArgs{
Description: pulumi.String("string"),
Labels: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
})
var snippetResource = new Snippet("snippetResource", SnippetArgs.builder()
.description("string")
.labels("string")
.name("string")
.build());
snippet_resource = scm.Snippet("snippetResource",
description="string",
labels=["string"],
name="string")
const snippetResource = new scm.Snippet("snippetResource", {
description: "string",
labels: ["string"],
name: "string",
});
type: scm:Snippet
properties:
description: string
labels:
- string
name: string
Snippet 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 Snippet resource accepts the following input properties:
- Description string
- The Description param.
- Labels List<string>
- The Labels param.
- Name string
- The Name param.
- Description string
- The Description param.
- Labels []string
- The Labels param.
- Name string
- The Name param.
- description String
- The Description param.
- labels List<String>
- The Labels param.
- name String
- The Name param.
- description string
- The Description param.
- labels string[]
- The Labels param.
- name string
- The Name param.
- description str
- The Description param.
- labels Sequence[str]
- The Labels param.
- name str
- The Name param.
- description String
- The Description param.
- labels List<String>
- The Labels param.
- name String
- The Name param.
Outputs
All input properties are implicitly available as output properties. Additionally, the Snippet resource produces the following output properties:
- Created
In string - The CreatedIn param.
- Display
Name string - The DisplayName param.
- Folders
List<Snippet
Folder> - The Folders param.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Update string - The LastUpdate param.
- string
- The SharedIn param.
- Tfid string
- Type string
- The Type param. String must be one of these:
"predefined"
.
- Created
In string - The CreatedIn param.
- Display
Name string - The DisplayName param.
- Folders
[]Snippet
Folder - The Folders param.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Update string - The LastUpdate param.
- string
- The SharedIn param.
- Tfid string
- Type string
- The Type param. String must be one of these:
"predefined"
.
- created
In String - The CreatedIn param.
- display
Name String - The DisplayName param.
- folders
List<Snippet
Folder> - The Folders param.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Update String - The LastUpdate param.
- String
- The SharedIn param.
- tfid String
- type String
- The Type param. String must be one of these:
"predefined"
.
- created
In string - The CreatedIn param.
- display
Name string - The DisplayName param.
- folders
Snippet
Folder[] - The Folders param.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Update string - The LastUpdate param.
- string
- The SharedIn param.
- tfid string
- type string
- The Type param. String must be one of these:
"predefined"
.
- created_
in str - The CreatedIn param.
- display_
name str - The DisplayName param.
- folders
Sequence[Snippet
Folder] - The Folders param.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
update str - The LastUpdate param.
- str
- The SharedIn param.
- tfid str
- type str
- The Type param. String must be one of these:
"predefined"
.
- created
In String - The CreatedIn param.
- display
Name String - The DisplayName param.
- folders List<Property Map>
- The Folders param.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Update String - The LastUpdate param.
- String
- The SharedIn param.
- tfid String
- type String
- The Type param. String must be one of these:
"predefined"
.
Look up Existing Snippet Resource
Get an existing Snippet 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?: SnippetState, opts?: CustomResourceOptions): Snippet
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_in: Optional[str] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
folders: Optional[Sequence[SnippetFolderArgs]] = None,
labels: Optional[Sequence[str]] = None,
last_update: Optional[str] = None,
name: Optional[str] = None,
shared_in: Optional[str] = None,
tfid: Optional[str] = None,
type: Optional[str] = None) -> Snippet
func GetSnippet(ctx *Context, name string, id IDInput, state *SnippetState, opts ...ResourceOption) (*Snippet, error)
public static Snippet Get(string name, Input<string> id, SnippetState? state, CustomResourceOptions? opts = null)
public static Snippet get(String name, Output<String> id, SnippetState 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.
- Created
In string - The CreatedIn param.
- Description string
- The Description param.
- Display
Name string - The DisplayName param.
- Folders
List<Snippet
Folder> - The Folders param.
- Labels List<string>
- The Labels param.
- Last
Update string - The LastUpdate param.
- Name string
- The Name param.
- string
- The SharedIn param.
- Tfid string
- Type string
- The Type param. String must be one of these:
"predefined"
.
- Created
In string - The CreatedIn param.
- Description string
- The Description param.
- Display
Name string - The DisplayName param.
- Folders
[]Snippet
Folder Args - The Folders param.
- Labels []string
- The Labels param.
- Last
Update string - The LastUpdate param.
- Name string
- The Name param.
- string
- The SharedIn param.
- Tfid string
- Type string
- The Type param. String must be one of these:
"predefined"
.
- created
In String - The CreatedIn param.
- description String
- The Description param.
- display
Name String - The DisplayName param.
- folders
List<Snippet
Folder> - The Folders param.
- labels List<String>
- The Labels param.
- last
Update String - The LastUpdate param.
- name String
- The Name param.
- String
- The SharedIn param.
- tfid String
- type String
- The Type param. String must be one of these:
"predefined"
.
- created
In string - The CreatedIn param.
- description string
- The Description param.
- display
Name string - The DisplayName param.
- folders
Snippet
Folder[] - The Folders param.
- labels string[]
- The Labels param.
- last
Update string - The LastUpdate param.
- name string
- The Name param.
- string
- The SharedIn param.
- tfid string
- type string
- The Type param. String must be one of these:
"predefined"
.
- created_
in str - The CreatedIn param.
- description str
- The Description param.
- display_
name str - The DisplayName param.
- folders
Sequence[Snippet
Folder Args] - The Folders param.
- labels Sequence[str]
- The Labels param.
- last_
update str - The LastUpdate param.
- name str
- The Name param.
- str
- The SharedIn param.
- tfid str
- type str
- The Type param. String must be one of these:
"predefined"
.
- created
In String - The CreatedIn param.
- description String
- The Description param.
- display
Name String - The DisplayName param.
- folders List<Property Map>
- The Folders param.
- labels List<String>
- The Labels param.
- last
Update String - The LastUpdate param.
- name String
- The Name param.
- String
- The SharedIn param.
- tfid String
- type String
- The Type param. String must be one of these:
"predefined"
.
Supporting Types
SnippetFolder, SnippetFolderArgs
Package Details
- Repository
- scm pulumi/pulumi-scm
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scm
Terraform Provider.