1. Packages
  2. Etcd Provider
  3. API Docs
  4. RangeScopedState
etcd 0.10.0 published on Tuesday, Apr 15, 2025 by ferlab-ste-justine

etcd.RangeScopedState

Explore with Pulumi AI

etcd logo
etcd 0.10.0 published on Tuesday, Apr 15, 2025 by ferlab-ste-justine

    Resource to manage the lifecycle of a state scoped by a key range.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as etcd from "@pulumi/etcd";
    
    const patroniPrefixRangeEnd = etcd.getPrefixRangeEnd({
        key: "/patroni/",
    });
    const patroniRangeScopedState = new etcd.RangeScopedState("patroniRangeScopedState", {
        key: patroniPrefixRangeEnd.then(patroniPrefixRangeEnd => patroniPrefixRangeEnd.key),
        rangeEnd: patroniPrefixRangeEnd.then(patroniPrefixRangeEnd => patroniPrefixRangeEnd.rangeEnd),
        clearOnCreation: false,
        clearOnDeletion: true,
    });
    
    import pulumi
    import pulumi_etcd as etcd
    
    patroni_prefix_range_end = etcd.get_prefix_range_end(key="/patroni/")
    patroni_range_scoped_state = etcd.RangeScopedState("patroniRangeScopedState",
        key=patroni_prefix_range_end.key,
        range_end=patroni_prefix_range_end.range_end,
        clear_on_creation=False,
        clear_on_deletion=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/etcd/etcd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		patroniPrefixRangeEnd, err := etcd.GetPrefixRangeEnd(ctx, &etcd.GetPrefixRangeEndArgs{
    			Key: "/patroni/",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = etcd.NewRangeScopedState(ctx, "patroniRangeScopedState", &etcd.RangeScopedStateArgs{
    			Key:             pulumi.String(patroniPrefixRangeEnd.Key),
    			RangeEnd:        pulumi.String(patroniPrefixRangeEnd.RangeEnd),
    			ClearOnCreation: pulumi.Bool(false),
    			ClearOnDeletion: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Etcd = Pulumi.Etcd;
    
    return await Deployment.RunAsync(() => 
    {
        var patroniPrefixRangeEnd = Etcd.GetPrefixRangeEnd.Invoke(new()
        {
            Key = "/patroni/",
        });
    
        var patroniRangeScopedState = new Etcd.RangeScopedState("patroniRangeScopedState", new()
        {
            Key = patroniPrefixRangeEnd.Apply(getPrefixRangeEndResult => getPrefixRangeEndResult.Key),
            RangeEnd = patroniPrefixRangeEnd.Apply(getPrefixRangeEndResult => getPrefixRangeEndResult.RangeEnd),
            ClearOnCreation = false,
            ClearOnDeletion = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.etcd.EtcdFunctions;
    import com.pulumi.etcd.inputs.GetPrefixRangeEndArgs;
    import com.pulumi.etcd.RangeScopedState;
    import com.pulumi.etcd.RangeScopedStateArgs;
    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 patroniPrefixRangeEnd = EtcdFunctions.getPrefixRangeEnd(GetPrefixRangeEndArgs.builder()
                .key("/patroni/")
                .build());
    
            var patroniRangeScopedState = new RangeScopedState("patroniRangeScopedState", RangeScopedStateArgs.builder()
                .key(patroniPrefixRangeEnd.applyValue(getPrefixRangeEndResult -> getPrefixRangeEndResult.key()))
                .rangeEnd(patroniPrefixRangeEnd.applyValue(getPrefixRangeEndResult -> getPrefixRangeEndResult.rangeEnd()))
                .clearOnCreation(false)
                .clearOnDeletion(true)
                .build());
    
        }
    }
    
    resources:
      patroniRangeScopedState:
        type: etcd:RangeScopedState
        properties:
          key: ${patroniPrefixRangeEnd.key}
          rangeEnd: ${patroniPrefixRangeEnd.rangeEnd}
          clearOnCreation: false
          clearOnDeletion: true
    variables:
      patroniPrefixRangeEnd:
        fn::invoke:
          function: etcd:getPrefixRangeEnd
          arguments:
            key: /patroni/
    

    Create RangeScopedState Resource

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

    Constructor syntax

    new RangeScopedState(name: string, args: RangeScopedStateArgs, opts?: CustomResourceOptions);
    @overload
    def RangeScopedState(resource_name: str,
                         args: RangeScopedStateArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def RangeScopedState(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         key: Optional[str] = None,
                         range_end: Optional[str] = None,
                         clear_on_creation: Optional[bool] = None,
                         clear_on_deletion: Optional[bool] = None,
                         range_scoped_state_id: Optional[str] = None)
    func NewRangeScopedState(ctx *Context, name string, args RangeScopedStateArgs, opts ...ResourceOption) (*RangeScopedState, error)
    public RangeScopedState(string name, RangeScopedStateArgs args, CustomResourceOptions? opts = null)
    public RangeScopedState(String name, RangeScopedStateArgs args)
    public RangeScopedState(String name, RangeScopedStateArgs args, CustomResourceOptions options)
    
    type: etcd:RangeScopedState
    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 RangeScopedStateArgs
    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 RangeScopedStateArgs
    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 RangeScopedStateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RangeScopedStateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RangeScopedStateArgs
    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 rangeScopedStateResource = new Etcd.RangeScopedState("rangeScopedStateResource", new()
    {
        Key = "string",
        RangeEnd = "string",
        ClearOnCreation = false,
        ClearOnDeletion = false,
        RangeScopedStateId = "string",
    });
    
    example, err := etcd.NewRangeScopedState(ctx, "rangeScopedStateResource", &etcd.RangeScopedStateArgs{
    	Key:                pulumi.String("string"),
    	RangeEnd:           pulumi.String("string"),
    	ClearOnCreation:    pulumi.Bool(false),
    	ClearOnDeletion:    pulumi.Bool(false),
    	RangeScopedStateId: pulumi.String("string"),
    })
    
    var rangeScopedStateResource = new RangeScopedState("rangeScopedStateResource", RangeScopedStateArgs.builder()
        .key("string")
        .rangeEnd("string")
        .clearOnCreation(false)
        .clearOnDeletion(false)
        .rangeScopedStateId("string")
        .build());
    
    range_scoped_state_resource = etcd.RangeScopedState("rangeScopedStateResource",
        key="string",
        range_end="string",
        clear_on_creation=False,
        clear_on_deletion=False,
        range_scoped_state_id="string")
    
    const rangeScopedStateResource = new etcd.RangeScopedState("rangeScopedStateResource", {
        key: "string",
        rangeEnd: "string",
        clearOnCreation: false,
        clearOnDeletion: false,
        rangeScopedStateId: "string",
    });
    
    type: etcd:RangeScopedState
    properties:
        clearOnCreation: false
        clearOnDeletion: false
        key: string
        rangeEnd: string
        rangeScopedStateId: string
    

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

    Key string
    Key specifying the beginning of the key range.
    RangeEnd string
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    ClearOnCreation bool
    Whether to clear all pre-existing keys in the range when the resource is created.
    ClearOnDeletion bool
    Whether to clear all existing keys in the range when the resource is deleted.
    RangeScopedStateId string
    The ID of this resource.
    Key string
    Key specifying the beginning of the key range.
    RangeEnd string
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    ClearOnCreation bool
    Whether to clear all pre-existing keys in the range when the resource is created.
    ClearOnDeletion bool
    Whether to clear all existing keys in the range when the resource is deleted.
    RangeScopedStateId string
    The ID of this resource.
    key String
    Key specifying the beginning of the key range.
    rangeEnd String
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    clearOnCreation Boolean
    Whether to clear all pre-existing keys in the range when the resource is created.
    clearOnDeletion Boolean
    Whether to clear all existing keys in the range when the resource is deleted.
    rangeScopedStateId String
    The ID of this resource.
    key string
    Key specifying the beginning of the key range.
    rangeEnd string
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    clearOnCreation boolean
    Whether to clear all pre-existing keys in the range when the resource is created.
    clearOnDeletion boolean
    Whether to clear all existing keys in the range when the resource is deleted.
    rangeScopedStateId string
    The ID of this resource.
    key str
    Key specifying the beginning of the key range.
    range_end str
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    clear_on_creation bool
    Whether to clear all pre-existing keys in the range when the resource is created.
    clear_on_deletion bool
    Whether to clear all existing keys in the range when the resource is deleted.
    range_scoped_state_id str
    The ID of this resource.
    key String
    Key specifying the beginning of the key range.
    rangeEnd String
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    clearOnCreation Boolean
    Whether to clear all pre-existing keys in the range when the resource is created.
    clearOnDeletion Boolean
    Whether to clear all existing keys in the range when the resource is deleted.
    rangeScopedStateId String
    The ID of this resource.

    Outputs

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

    Get an existing RangeScopedState 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?: RangeScopedStateState, opts?: CustomResourceOptions): RangeScopedState
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            clear_on_creation: Optional[bool] = None,
            clear_on_deletion: Optional[bool] = None,
            key: Optional[str] = None,
            range_end: Optional[str] = None,
            range_scoped_state_id: Optional[str] = None) -> RangeScopedState
    func GetRangeScopedState(ctx *Context, name string, id IDInput, state *RangeScopedStateState, opts ...ResourceOption) (*RangeScopedState, error)
    public static RangeScopedState Get(string name, Input<string> id, RangeScopedStateState? state, CustomResourceOptions? opts = null)
    public static RangeScopedState get(String name, Output<String> id, RangeScopedStateState state, CustomResourceOptions options)
    resources:  _:    type: etcd:RangeScopedState    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:
    ClearOnCreation bool
    Whether to clear all pre-existing keys in the range when the resource is created.
    ClearOnDeletion bool
    Whether to clear all existing keys in the range when the resource is deleted.
    Key string
    Key specifying the beginning of the key range.
    RangeEnd string
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    RangeScopedStateId string
    The ID of this resource.
    ClearOnCreation bool
    Whether to clear all pre-existing keys in the range when the resource is created.
    ClearOnDeletion bool
    Whether to clear all existing keys in the range when the resource is deleted.
    Key string
    Key specifying the beginning of the key range.
    RangeEnd string
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    RangeScopedStateId string
    The ID of this resource.
    clearOnCreation Boolean
    Whether to clear all pre-existing keys in the range when the resource is created.
    clearOnDeletion Boolean
    Whether to clear all existing keys in the range when the resource is deleted.
    key String
    Key specifying the beginning of the key range.
    rangeEnd String
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    rangeScopedStateId String
    The ID of this resource.
    clearOnCreation boolean
    Whether to clear all pre-existing keys in the range when the resource is created.
    clearOnDeletion boolean
    Whether to clear all existing keys in the range when the resource is deleted.
    key string
    Key specifying the beginning of the key range.
    rangeEnd string
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    rangeScopedStateId string
    The ID of this resource.
    clear_on_creation bool
    Whether to clear all pre-existing keys in the range when the resource is created.
    clear_on_deletion bool
    Whether to clear all existing keys in the range when the resource is deleted.
    key str
    Key specifying the beginning of the key range.
    range_end str
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    range_scoped_state_id str
    The ID of this resource.
    clearOnCreation Boolean
    Whether to clear all pre-existing keys in the range when the resource is created.
    clearOnDeletion Boolean
    Whether to clear all existing keys in the range when the resource is deleted.
    key String
    Key specifying the beginning of the key range.
    rangeEnd String
    Key specifying the end of the key range (exclusive). To you set it to the value of the key scopes the range to a single key. If you would like the range to be anything prefixed by the key, you can use the etcdprefixrange_end data helper.
    rangeScopedStateId String
    The ID of this resource.

    Package Details

    Repository
    etcd ferlab-ste-justine/terraform-provider-etcd
    License
    Notes
    This Pulumi package is based on the etcd Terraform Provider.
    etcd logo
    etcd 0.10.0 published on Tuesday, Apr 15, 2025 by ferlab-ste-justine