Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Setting

Provides a Rancher v2 Setting resource. This can be used to create settings for Rancher v2 environments and retrieve their information.

On create, if setting already exists, provider will import it and update its value.

On destroy, if setting is a system setting like server-url, provider’ll not delete it from Rancher, it’ll just update setting value to default and remove it from tfstate.

Example Usage

using Pulumi;
using Rancher2 = Pulumi.Rancher2;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new rancher2 Setting
        var foo = new Rancher2.Setting("foo", new Rancher2.SettingArgs
        {
            Value = "<VALUE>",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-rancher2/sdk/v2/go/rancher2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := rancher2.NewSetting(ctx, "foo", &rancher2.SettingArgs{
            Value: pulumi.String("<VALUE>"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_rancher2 as rancher2

# Create a new rancher2 Setting
foo = rancher2.Setting("foo", value="<VALUE>")
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";

// Create a new rancher2 Setting
const foo = new rancher2.Setting("foo", {
    value: "<VALUE>",
});

Create a Setting Resource

new Setting(name: string, args: SettingArgs, opts?: CustomResourceOptions);
def Setting(resource_name: str, opts: Optional[ResourceOptions] = None, annotations: Optional[Mapping[str, Any]] = None, labels: Optional[Mapping[str, Any]] = None, name: Optional[str] = None, value: Optional[str] = None)
func NewSetting(ctx *Context, name string, args SettingArgs, opts ...ResourceOption) (*Setting, error)
public Setting(string name, SettingArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args SettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SettingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Setting Resource Properties

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

Inputs

The Setting resource accepts the following input properties:

Value string

The value of the setting (string)

Annotations Dictionary<string, object>

Annotations for setting object (map)

Labels Dictionary<string, object>

Labels for setting object (map)

Name string

The name of the setting (string)

Value string

The value of the setting (string)

Annotations map[string]interface{}

Annotations for setting object (map)

Labels map[string]interface{}

Labels for setting object (map)

Name string

The name of the setting (string)

value string

The value of the setting (string)

annotations {[key: string]: any}

Annotations for setting object (map)

labels {[key: string]: any}

Labels for setting object (map)

name string

The name of the setting (string)

value str

The value of the setting (string)

annotations Mapping[str, Any]

Annotations for setting object (map)

labels Mapping[str, Any]

Labels for setting object (map)

name str

The name of the setting (string)

Outputs

All input properties are implicitly available as output properties. Additionally, the Setting 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing Setting Resource

Get an existing Setting 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?: SettingState, opts?: CustomResourceOptions): Setting
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, annotations: Optional[Mapping[str, Any]] = None, labels: Optional[Mapping[str, Any]] = None, name: Optional[str] = None, value: Optional[str] = None) -> Setting
func GetSetting(ctx *Context, name string, id IDInput, state *SettingState, opts ...ResourceOption) (*Setting, error)
public static Setting Get(string name, Input<string> id, SettingState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Annotations Dictionary<string, object>

Annotations for setting object (map)

Labels Dictionary<string, object>

Labels for setting object (map)

Name string

The name of the setting (string)

Value string

The value of the setting (string)

Annotations map[string]interface{}

Annotations for setting object (map)

Labels map[string]interface{}

Labels for setting object (map)

Name string

The name of the setting (string)

Value string

The value of the setting (string)

annotations {[key: string]: any}

Annotations for setting object (map)

labels {[key: string]: any}

Labels for setting object (map)

name string

The name of the setting (string)

value string

The value of the setting (string)

annotations Mapping[str, Any]

Annotations for setting object (map)

labels Mapping[str, Any]

Labels for setting object (map)

name str

The name of the setting (string)

value str

The value of the setting (string)

Import

Setting can be imported using the Rancher setting ID.

 $ pulumi import rancher2:index/setting:Setting foo &lt;setting_id&gt;

Package Details

Repository
https://github.com/pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.