1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. dcdn
  5. KvNamespace
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.dcdn.KvNamespace

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a Dcdn Kv Namespace resource.

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

    NOTE: Available since v1.198.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const defaultKvNamespace = new alicloud.dcdn.KvNamespace("default", {
        description: name,
        namespace: `${name}-${_default.result}`,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = random.index.Integer("default",
        min=10000,
        max=99999)
    default_kv_namespace = alicloud.dcdn.KvNamespace("default",
        description=name,
        namespace=f"{name}-{default['result']}")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dcdn"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"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 := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = dcdn.NewKvNamespace(ctx, "default", &dcdn.KvNamespaceArgs{
    			Description: pulumi.String(name),
    			Namespace:   pulumi.Sprintf("%v-%v", name, _default.Result),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var defaultKvNamespace = new AliCloud.Dcdn.KvNamespace("default", new()
        {
            Description = name,
            Namespace = $"{name}-{@default.Result}",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.dcdn.KvNamespace;
    import com.pulumi.alicloud.dcdn.KvNamespaceArgs;
    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("terraform-example");
            var default_ = new Integer("default", IntegerArgs.builder()
                .min(10000)
                .max(99999)
                .build());
    
            var defaultKvNamespace = new KvNamespace("defaultKvNamespace", KvNamespaceArgs.builder()
                .description(name)
                .namespace(String.format("%s-%s", name,default_.result()))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: random:integer
        properties:
          min: 10000
          max: 99999
      defaultKvNamespace:
        type: alicloud:dcdn:KvNamespace
        name: default
        properties:
          description: ${name}
          namespace: ${name}-${default.result}
    

    Create KvNamespace Resource

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

    Constructor syntax

    new KvNamespace(name: string, args: KvNamespaceArgs, opts?: CustomResourceOptions);
    @overload
    def KvNamespace(resource_name: str,
                    args: KvNamespaceArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def KvNamespace(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    description: Optional[str] = None,
                    namespace: Optional[str] = None)
    func NewKvNamespace(ctx *Context, name string, args KvNamespaceArgs, opts ...ResourceOption) (*KvNamespace, error)
    public KvNamespace(string name, KvNamespaceArgs args, CustomResourceOptions? opts = null)
    public KvNamespace(String name, KvNamespaceArgs args)
    public KvNamespace(String name, KvNamespaceArgs args, CustomResourceOptions options)
    
    type: alicloud:dcdn:KvNamespace
    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 KvNamespaceArgs
    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 KvNamespaceArgs
    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 KvNamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KvNamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KvNamespaceArgs
    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 kvNamespaceResource = new AliCloud.Dcdn.KvNamespace("kvNamespaceResource", new()
    {
        Description = "string",
        Namespace = "string",
    });
    
    example, err := dcdn.NewKvNamespace(ctx, "kvNamespaceResource", &dcdn.KvNamespaceArgs{
    	Description: pulumi.String("string"),
    	Namespace:   pulumi.String("string"),
    })
    
    var kvNamespaceResource = new KvNamespace("kvNamespaceResource", KvNamespaceArgs.builder()
        .description("string")
        .namespace("string")
        .build());
    
    kv_namespace_resource = alicloud.dcdn.KvNamespace("kvNamespaceResource",
        description="string",
        namespace="string")
    
    const kvNamespaceResource = new alicloud.dcdn.KvNamespace("kvNamespaceResource", {
        description: "string",
        namespace: "string",
    });
    
    type: alicloud:dcdn:KvNamespace
    properties:
        description: string
        namespace: string
    

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

    Description string
    Namespace description information
    Namespace string
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    Description string
    Namespace description information
    Namespace string
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    description String
    Namespace description information
    namespace String
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    description string
    Namespace description information
    namespace string
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    description str
    Namespace description information
    namespace str
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    description String
    Namespace description information
    namespace String
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).

    Outputs

    All input properties are implicitly available as output properties. Additionally, the KvNamespace resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the resource
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the resource
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource

    Look up Existing KvNamespace Resource

    Get an existing KvNamespace 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?: KvNamespaceState, opts?: CustomResourceOptions): KvNamespace
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            namespace: Optional[str] = None,
            status: Optional[str] = None) -> KvNamespace
    func GetKvNamespace(ctx *Context, name string, id IDInput, state *KvNamespaceState, opts ...ResourceOption) (*KvNamespace, error)
    public static KvNamespace Get(string name, Input<string> id, KvNamespaceState? state, CustomResourceOptions? opts = null)
    public static KvNamespace get(String name, Output<String> id, KvNamespaceState 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:
    Description string
    Namespace description information
    Namespace string
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    Status string
    The status of the resource
    Description string
    Namespace description information
    Namespace string
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    Status string
    The status of the resource
    description String
    Namespace description information
    namespace String
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    status String
    The status of the resource
    description string
    Namespace description information
    namespace string
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    status string
    The status of the resource
    description str
    Namespace description information
    namespace str
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    status str
    The status of the resource
    description String
    Namespace description information
    namespace String
    Namespace name. The name can contain letters, digits, hyphens (-), and underscores (_).
    status String
    The status of the resource

    Import

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

    $ pulumi import alicloud:dcdn/kvNamespace:KvNamespace example
    

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi