1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. Kv
Alibaba Cloud v3.82.0 published on Tuesday, Jul 8, 2025 by Pulumi

alicloud.esa.Kv

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.82.0 published on Tuesday, Jul 8, 2025 by Pulumi

    Provides a ESA Kv resource.

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

    NOTE: Available since v1.251.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.esa.KvNamespace("default", {
        description: "this is a example namespace.",
        kvNamespace: "namespace1",
    });
    const defaultKv = new alicloud.esa.Kv("default", {
        isbase: false,
        expirationTtl: 360,
        value: "example_value",
        expiration: 1690,
        namespace: _default.id,
        key: "example_key",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.esa.KvNamespace("default",
        description="this is a example namespace.",
        kv_namespace="namespace1")
    default_kv = alicloud.esa.Kv("default",
        isbase=False,
        expiration_ttl=360,
        value="example_value",
        expiration=1690,
        namespace=default.id,
        key="example_key")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := esa.NewKvNamespace(ctx, "default", &esa.KvNamespaceArgs{
    			Description: pulumi.String("this is a example namespace."),
    			KvNamespace: pulumi.String("namespace1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = esa.NewKv(ctx, "default", &esa.KvArgs{
    			Isbase:        pulumi.Bool(false),
    			ExpirationTtl: pulumi.Int(360),
    			Value:         pulumi.String("example_value"),
    			Expiration:    pulumi.Int(1690),
    			Namespace:     _default.ID(),
    			Key:           pulumi.String("example_key"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.Esa.KvNamespace("default", new()
        {
            Description = "this is a example namespace.",
            NamespaceValue = "namespace1",
        });
    
        var defaultKv = new AliCloud.Esa.Kv("default", new()
        {
            Isbase = false,
            ExpirationTtl = 360,
            Value = "example_value",
            Expiration = 1690,
            Namespace = @default.Id,
            Key = "example_key",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.esa.KvNamespace;
    import com.pulumi.alicloud.esa.KvNamespaceArgs;
    import com.pulumi.alicloud.esa.Kv;
    import com.pulumi.alicloud.esa.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) {
            var default_ = new KvNamespace("default", KvNamespaceArgs.builder()
                .description("this is a example namespace.")
                .kvNamespace("namespace1")
                .build());
    
            var defaultKv = new Kv("defaultKv", KvArgs.builder()
                .isbase(false)
                .expirationTtl(360)
                .value("example_value")
                .expiration(1690)
                .namespace(default_.id())
                .key("example_key")
                .build());
    
        }
    }
    
    resources:
      default:
        type: alicloud:esa:KvNamespace
        properties:
          description: this is a example namespace.
          kvNamespace: namespace1
      defaultKv:
        type: alicloud:esa:Kv
        name: default
        properties:
          isbase: 'false'
          expirationTtl: '360'
          value: example_value
          expiration: '1690'
          namespace: ${default.id}
          key: example_key
    

    Create Kv Resource

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

    Constructor syntax

    new Kv(name: string, args: KvArgs, opts?: CustomResourceOptions);
    @overload
    def Kv(resource_name: str,
           args: KvArgs,
           opts: Optional[ResourceOptions] = None)
    
    @overload
    def Kv(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           key: Optional[str] = None,
           namespace: Optional[str] = None,
           expiration: Optional[int] = None,
           expiration_ttl: Optional[int] = None,
           isbase: Optional[bool] = None,
           url: Optional[str] = None,
           value: Optional[str] = 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:esa:Kv
    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 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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var alicloudKvResource = new AliCloud.Esa.Kv("alicloudKvResource", new()
    {
        Key = "string",
        Namespace = "string",
        Expiration = 0,
        ExpirationTtl = 0,
        Isbase = false,
        Url = "string",
        Value = "string",
    });
    
    example, err := esa.NewKv(ctx, "alicloudKvResource", &esa.KvArgs{
    	Key:           pulumi.String("string"),
    	Namespace:     pulumi.String("string"),
    	Expiration:    pulumi.Int(0),
    	ExpirationTtl: pulumi.Int(0),
    	Isbase:        pulumi.Bool(false),
    	Url:           pulumi.String("string"),
    	Value:         pulumi.String("string"),
    })
    
    var alicloudKvResource = new com.pulumi.alicloud.esa.Kv("alicloudKvResource", com.pulumi.alicloud.esa.KvArgs.builder()
        .key("string")
        .namespace("string")
        .expiration(0)
        .expirationTtl(0)
        .isbase(false)
        .url("string")
        .value("string")
        .build());
    
    alicloud_kv_resource = alicloud.esa.Kv("alicloudKvResource",
        key="string",
        namespace="string",
        expiration=0,
        expiration_ttl=0,
        isbase=False,
        url="string",
        value="string")
    
    const alicloudKvResource = new alicloud.esa.Kv("alicloudKvResource", {
        key: "string",
        namespace: "string",
        expiration: 0,
        expirationTtl: 0,
        isbase: false,
        url: "string",
        value: "string",
    });
    
    type: alicloud:esa:Kv
    properties:
        expiration: 0
        expirationTtl: 0
        isbase: false
        key: string
        namespace: string
        url: string
        value: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Kv resource accepts the following input properties:

    Key string
    kv
    Namespace string
    The name specified when calling CreatevNamespace.
    Expiration int
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    ExpirationTtl int
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    Isbase bool
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    Url string
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    Value string
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    Key string
    kv
    Namespace string
    The name specified when calling CreatevNamespace.
    Expiration int
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    ExpirationTtl int
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    Isbase bool
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    Url string
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    Value string
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    key String
    kv
    namespace String
    The name specified when calling CreatevNamespace.
    expiration Integer
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    expirationTtl Integer
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    isbase Boolean
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    url String
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    value String
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    key string
    kv
    namespace string
    The name specified when calling CreatevNamespace.
    expiration number
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    expirationTtl number
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    isbase boolean
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    url string
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    value string
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    key str
    kv
    namespace str
    The name specified when calling CreatevNamespace.
    expiration int
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    expiration_ttl int
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    isbase bool
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    url str
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    value str
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    key String
    kv
    namespace String
    The name specified when calling CreatevNamespace.
    expiration Number
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    expirationTtl Number
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    isbase Boolean
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    url String
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    value String
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.

    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,
            expiration: Optional[int] = None,
            expiration_ttl: Optional[int] = None,
            isbase: Optional[bool] = None,
            key: Optional[str] = None,
            namespace: Optional[str] = None,
            url: 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)
    resources:  _:    type: alicloud:esa:Kv    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:
    Expiration int
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    ExpirationTtl int
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    Isbase bool
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    Key string
    kv
    Namespace string
    The name specified when calling CreatevNamespace.
    Url string
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    Value string
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    Expiration int
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    ExpirationTtl int
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    Isbase bool
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    Key string
    kv
    Namespace string
    The name specified when calling CreatevNamespace.
    Url string
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    Value string
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    expiration Integer
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    expirationTtl Integer
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    isbase Boolean
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    key String
    kv
    namespace String
    The name specified when calling CreatevNamespace.
    url String
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    value String
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    expiration number
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    expirationTtl number
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    isbase boolean
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    key string
    kv
    namespace string
    The name specified when calling CreatevNamespace.
    url string
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    value string
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    expiration int
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    expiration_ttl int
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    isbase bool
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    key str
    kv
    namespace str
    The name specified when calling CreatevNamespace.
    url str
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    value str
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.
    expiration Number
    The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call PutKvWithHighCapacity.
    expirationTtl Number
    The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    isbase Boolean
    The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
    key String
    kv
    namespace String
    The name specified when calling CreatevNamespace.
    url String
    The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\).
    value String
    The content of the key. If the content has more than 256 characters in length, the system displays the first 100 and the last 100 characters, and omits the middle part.

    Import

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

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

    To learn more about importing existing cloud resources, see Importing resources.

    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.82.0 published on Tuesday, Jul 8, 2025 by Pulumi