etcd.RangeScopedState
Explore with Pulumi AI
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.
- Range
End 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.
- Clear
On boolCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- Clear
On boolDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- Range
Scoped stringState Id - The ID of this resource.
- Key string
- Key specifying the beginning of the key range.
- Range
End 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.
- Clear
On boolCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- Clear
On boolDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- Range
Scoped stringState Id - The ID of this resource.
- key String
- Key specifying the beginning of the key range.
- range
End 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.
- clear
On BooleanCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- clear
On BooleanDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- range
Scoped StringState Id - The ID of this resource.
- key string
- Key specifying the beginning of the key range.
- range
End 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.
- clear
On booleanCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- clear
On booleanDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- range
Scoped stringState Id - 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_ boolcreation - Whether to clear all pre-existing keys in the range when the resource is created.
- clear_
on_ booldeletion - Whether to clear all existing keys in the range when the resource is deleted.
- range_
scoped_ strstate_ id - The ID of this resource.
- key String
- Key specifying the beginning of the key range.
- range
End 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.
- clear
On BooleanCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- clear
On BooleanDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- range
Scoped StringState Id - 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.
- Clear
On boolCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- Clear
On boolDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- Key string
- Key specifying the beginning of the key range.
- Range
End 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.
- Range
Scoped stringState Id - The ID of this resource.
- Clear
On boolCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- Clear
On boolDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- Key string
- Key specifying the beginning of the key range.
- Range
End 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.
- Range
Scoped stringState Id - The ID of this resource.
- clear
On BooleanCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- clear
On BooleanDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- key String
- Key specifying the beginning of the key range.
- range
End 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.
- range
Scoped StringState Id - The ID of this resource.
- clear
On booleanCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- clear
On booleanDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- key string
- Key specifying the beginning of the key range.
- range
End 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.
- range
Scoped stringState Id - The ID of this resource.
- clear_
on_ boolcreation - Whether to clear all pre-existing keys in the range when the resource is created.
- clear_
on_ booldeletion - 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_ strstate_ id - The ID of this resource.
- clear
On BooleanCreation - Whether to clear all pre-existing keys in the range when the resource is created.
- clear
On BooleanDeletion - Whether to clear all existing keys in the range when the resource is deleted.
- key String
- Key specifying the beginning of the key range.
- range
End 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.
- range
Scoped StringState Id - 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.