1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dcdn
  5. Kv
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

alicloud.dcdn.Kv

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

    Provides a Dcdn Kv resource.

    For information about Dcdn Kv and how to use it, see What is Kv.

    NOTE: Available since v1.198.0.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var defaultKvNamespace = new AliCloud.Dcdn.KvNamespace("defaultKvNamespace", new()
        {
            Description = name,
            Namespace = name,
        });
    
        var defaultKv = new AliCloud.Dcdn.Kv("defaultKv", new()
        {
            Value = "example-value",
            Key = name,
            Namespace = defaultKvNamespace.Namespace,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dcdn"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultKvNamespace, err := dcdn.NewKvNamespace(ctx, "defaultKvNamespace", &dcdn.KvNamespaceArgs{
    			Description: pulumi.String(name),
    			Namespace:   pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = dcdn.NewKv(ctx, "defaultKv", &dcdn.KvArgs{
    			Value:     pulumi.String("example-value"),
    			Key:       pulumi.String(name),
    			Namespace: defaultKvNamespace.Namespace,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dcdn.KvNamespace;
    import com.pulumi.alicloud.dcdn.KvNamespaceArgs;
    import com.pulumi.alicloud.dcdn.Kv;
    import com.pulumi.alicloud.dcdn.KvArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            var defaultKvNamespace = new KvNamespace("defaultKvNamespace", KvNamespaceArgs.builder()        
                .description(name)
                .namespace(name)
                .build());
    
            var defaultKv = new Kv("defaultKv", KvArgs.builder()        
                .value("example-value")
                .key(name)
                .namespace(defaultKvNamespace.namespace())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default_kv_namespace = alicloud.dcdn.KvNamespace("defaultKvNamespace",
        description=name,
        namespace=name)
    default_kv = alicloud.dcdn.Kv("defaultKv",
        value="example-value",
        key=name,
        namespace=default_kv_namespace.namespace)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const defaultKvNamespace = new alicloud.dcdn.KvNamespace("defaultKvNamespace", {
        description: name,
        namespace: name,
    });
    const defaultKv = new alicloud.dcdn.Kv("defaultKv", {
        value: "example-value",
        key: name,
        namespace: defaultKvNamespace.namespace,
    });
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultKvNamespace:
        type: alicloud:dcdn:KvNamespace
        properties:
          description: ${name}
          namespace: ${name}
      defaultKv:
        type: alicloud:dcdn:Kv
        properties:
          value: example-value
          key: ${name}
          namespace: ${defaultKvNamespace.namespace}
    

    Create Kv Resource

    new Kv(name: string, args: KvArgs, opts?: CustomResourceOptions);
    @overload
    def Kv(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           key: Optional[str] = None,
           namespace: Optional[str] = None,
           value: Optional[str] = None)
    @overload
    def Kv(resource_name: str,
           args: KvArgs,
           opts: Optional[ResourceOptions] = None)
    func NewKv(ctx *Context, name string, args KvArgs, opts ...ResourceOption) (*Kv, error)
    public Kv(string name, KvArgs args, CustomResourceOptions? opts = null)
    public Kv(String name, KvArgs args)
    public Kv(String name, KvArgs args, CustomResourceOptions options)
    
    type: alicloud:dcdn:Kv
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args KvArgs
    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 KvArgs
    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 KvArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KvArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KvArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Kv Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Kv resource accepts the following input properties:

    Key string

    The name of the key to Put, the longest 512, cannot contain spaces.

    Namespace string

    The name specified when the customer calls PutDcdnKvNamespace.

    Value string

    The content of key, up to 2M(210001000).

    Key string

    The name of the key to Put, the longest 512, cannot contain spaces.

    Namespace string

    The name specified when the customer calls PutDcdnKvNamespace.

    Value string

    The content of key, up to 2M(210001000).

    key String

    The name of the key to Put, the longest 512, cannot contain spaces.

    namespace String

    The name specified when the customer calls PutDcdnKvNamespace.

    value String

    The content of key, up to 2M(210001000).

    key string

    The name of the key to Put, the longest 512, cannot contain spaces.

    namespace string

    The name specified when the customer calls PutDcdnKvNamespace.

    value string

    The content of key, up to 2M(210001000).

    key str

    The name of the key to Put, the longest 512, cannot contain spaces.

    namespace str

    The name specified when the customer calls PutDcdnKvNamespace.

    value str

    The content of key, up to 2M(210001000).

    key String

    The name of the key to Put, the longest 512, cannot contain spaces.

    namespace String

    The name specified when the customer calls PutDcdnKvNamespace.

    value String

    The content of key, up to 2M(210001000).

    Outputs

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

    Get an existing Kv 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?: KvState, opts?: CustomResourceOptions): Kv
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            namespace: Optional[str] = None,
            value: Optional[str] = None) -> Kv
    func GetKv(ctx *Context, name string, id IDInput, state *KvState, opts ...ResourceOption) (*Kv, error)
    public static Kv Get(string name, Input<string> id, KvState? state, CustomResourceOptions? opts = null)
    public static Kv get(String name, Output<String> id, KvState 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.
    The following state arguments are supported:
    Key string

    The name of the key to Put, the longest 512, cannot contain spaces.

    Namespace string

    The name specified when the customer calls PutDcdnKvNamespace.

    Value string

    The content of key, up to 2M(210001000).

    Key string

    The name of the key to Put, the longest 512, cannot contain spaces.

    Namespace string

    The name specified when the customer calls PutDcdnKvNamespace.

    Value string

    The content of key, up to 2M(210001000).

    key String

    The name of the key to Put, the longest 512, cannot contain spaces.

    namespace String

    The name specified when the customer calls PutDcdnKvNamespace.

    value String

    The content of key, up to 2M(210001000).

    key string

    The name of the key to Put, the longest 512, cannot contain spaces.

    namespace string

    The name specified when the customer calls PutDcdnKvNamespace.

    value string

    The content of key, up to 2M(210001000).

    key str

    The name of the key to Put, the longest 512, cannot contain spaces.

    namespace str

    The name specified when the customer calls PutDcdnKvNamespace.

    value str

    The content of key, up to 2M(210001000).

    key String

    The name of the key to Put, the longest 512, cannot contain spaces.

    namespace String

    The name specified when the customer calls PutDcdnKvNamespace.

    value String

    The content of key, up to 2M(210001000).

    Import

    Dcdn Kv can be imported using the id, e.g.

     $ pulumi import alicloud:dcdn/kv:Kv example <namespace>:<key>
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the alicloud Terraform Provider.

    alicloud logo
    Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi