1. Packages
  2. Ucloud Provider
  3. API Docs
  4. Label
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.Label

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    Provides a label resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const foo = new ucloud.Label("foo", {
        key: "tf-acc-label-key",
        value: "tf-acc-label-value",
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    foo = ucloud.Label("foo",
        key="tf-acc-label-key",
        value="tf-acc-label-value")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ucloud.NewLabel(ctx, "foo", &ucloud.LabelArgs{
    			Key:   pulumi.String("tf-acc-label-key"),
    			Value: pulumi.String("tf-acc-label-value"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Ucloud.Label("foo", new()
        {
            Key = "tf-acc-label-key",
            Value = "tf-acc-label-value",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.Label;
    import com.pulumi.ucloud.LabelArgs;
    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 foo = new Label("foo", LabelArgs.builder()
                .key("tf-acc-label-key")
                .value("tf-acc-label-value")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: ucloud:Label
        properties:
          key: tf-acc-label-key
          value: tf-acc-label-value
    

    Create Label Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Label(name: string, args: LabelArgs, opts?: CustomResourceOptions);
    @overload
    def Label(resource_name: str,
              args: LabelArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Label(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              key: Optional[str] = None,
              value: Optional[str] = None,
              label_id: Optional[str] = None)
    func NewLabel(ctx *Context, name string, args LabelArgs, opts ...ResourceOption) (*Label, error)
    public Label(string name, LabelArgs args, CustomResourceOptions? opts = null)
    public Label(String name, LabelArgs args)
    public Label(String name, LabelArgs args, CustomResourceOptions options)
    
    type: ucloud:Label
    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 LabelArgs
    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 LabelArgs
    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 LabelArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LabelArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LabelArgs
    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 labelResource = new Ucloud.Label("labelResource", new()
    {
        Key = "string",
        Value = "string",
        LabelId = "string",
    });
    
    example, err := ucloud.NewLabel(ctx, "labelResource", &ucloud.LabelArgs{
    	Key:     pulumi.String("string"),
    	Value:   pulumi.String("string"),
    	LabelId: pulumi.String("string"),
    })
    
    var labelResource = new Label("labelResource", LabelArgs.builder()
        .key("string")
        .value("string")
        .labelId("string")
        .build());
    
    label_resource = ucloud.Label("labelResource",
        key="string",
        value="string",
        label_id="string")
    
    const labelResource = new ucloud.Label("labelResource", {
        key: "string",
        value: "string",
        labelId: "string",
    });
    
    type: ucloud:Label
    properties:
        key: string
        labelId: string
        value: string
    

    Label 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 Label resource accepts the following input properties:

    Key string
    key of the label.
    Value string
    value of the label
    LabelId string
    Key string
    key of the label.
    Value string
    value of the label
    LabelId string
    key String
    key of the label.
    value String
    value of the label
    labelId String
    key string
    key of the label.
    value string
    value of the label
    labelId string
    key str
    key of the label.
    value str
    value of the label
    label_id str
    key String
    key of the label.
    value String
    value of the label
    labelId String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Label 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 Label Resource

    Get an existing Label 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?: LabelState, opts?: CustomResourceOptions): Label
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            label_id: Optional[str] = None,
            value: Optional[str] = None) -> Label
    func GetLabel(ctx *Context, name string, id IDInput, state *LabelState, opts ...ResourceOption) (*Label, error)
    public static Label Get(string name, Input<string> id, LabelState? state, CustomResourceOptions? opts = null)
    public static Label get(String name, Output<String> id, LabelState state, CustomResourceOptions options)
    resources:  _:    type: ucloud:Label    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.
    The following state arguments are supported:
    Key string
    key of the label.
    LabelId string
    Value string
    value of the label
    Key string
    key of the label.
    LabelId string
    Value string
    value of the label
    key String
    key of the label.
    labelId String
    value String
    value of the label
    key string
    key of the label.
    labelId string
    value string
    value of the label
    key str
    key of the label.
    label_id str
    value str
    value of the label
    key String
    key of the label.
    labelId String
    value String
    value of the label

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud