1. Packages
  2. Rancher2 Provider
  3. API Docs
  4. StorageClassV2
Rancher 2 v9.0.0 published on Wednesday, Apr 16, 2025 by Pulumi

rancher2.StorageClassV2

Explore with Pulumi AI

Provides a Rancher Storage Class v2 resource. This can be used to manage k8s storage classes for Rancher v2 clusters and retrieve their information. Storage Class v2 resource is available at Rancher v2.5.x and above.

Create StorageClassV2 Resource

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

Constructor syntax

new StorageClassV2(name: string, args: StorageClassV2Args, opts?: CustomResourceOptions);
@overload
def StorageClassV2(resource_name: str,
                   args: StorageClassV2Args,
                   opts: Optional[ResourceOptions] = None)

@overload
def StorageClassV2(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   cluster_id: Optional[str] = None,
                   k8s_provisioner: Optional[str] = None,
                   allow_volume_expansion: Optional[bool] = None,
                   annotations: Optional[Mapping[str, str]] = None,
                   labels: Optional[Mapping[str, str]] = None,
                   mount_options: Optional[Sequence[str]] = None,
                   name: Optional[str] = None,
                   parameters: Optional[Mapping[str, str]] = None,
                   reclaim_policy: Optional[str] = None,
                   volume_binding_mode: Optional[str] = None)
func NewStorageClassV2(ctx *Context, name string, args StorageClassV2Args, opts ...ResourceOption) (*StorageClassV2, error)
public StorageClassV2(string name, StorageClassV2Args args, CustomResourceOptions? opts = null)
public StorageClassV2(String name, StorageClassV2Args args)
public StorageClassV2(String name, StorageClassV2Args args, CustomResourceOptions options)
type: rancher2:StorageClassV2
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. StorageClassV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. StorageClassV2Args
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. StorageClassV2Args
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. StorageClassV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. StorageClassV2Args
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 storageClassV2Resource = new Rancher2.StorageClassV2("storageClassV2Resource", new()
{
    ClusterId = "string",
    K8sProvisioner = "string",
    AllowVolumeExpansion = false,
    Annotations = 
    {
        { "string", "string" },
    },
    Labels = 
    {
        { "string", "string" },
    },
    MountOptions = new[]
    {
        "string",
    },
    Name = "string",
    Parameters = 
    {
        { "string", "string" },
    },
    ReclaimPolicy = "string",
    VolumeBindingMode = "string",
});
Copy
example, err := rancher2.NewStorageClassV2(ctx, "storageClassV2Resource", &rancher2.StorageClassV2Args{
	ClusterId:            pulumi.String("string"),
	K8sProvisioner:       pulumi.String("string"),
	AllowVolumeExpansion: pulumi.Bool(false),
	Annotations: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	MountOptions: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name: pulumi.String("string"),
	Parameters: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	ReclaimPolicy:     pulumi.String("string"),
	VolumeBindingMode: pulumi.String("string"),
})
Copy
var storageClassV2Resource = new StorageClassV2("storageClassV2Resource", StorageClassV2Args.builder()
    .clusterId("string")
    .k8sProvisioner("string")
    .allowVolumeExpansion(false)
    .annotations(Map.of("string", "string"))
    .labels(Map.of("string", "string"))
    .mountOptions("string")
    .name("string")
    .parameters(Map.of("string", "string"))
    .reclaimPolicy("string")
    .volumeBindingMode("string")
    .build());
Copy
storage_class_v2_resource = rancher2.StorageClassV2("storageClassV2Resource",
    cluster_id="string",
    k8s_provisioner="string",
    allow_volume_expansion=False,
    annotations={
        "string": "string",
    },
    labels={
        "string": "string",
    },
    mount_options=["string"],
    name="string",
    parameters={
        "string": "string",
    },
    reclaim_policy="string",
    volume_binding_mode="string")
Copy
const storageClassV2Resource = new rancher2.StorageClassV2("storageClassV2Resource", {
    clusterId: "string",
    k8sProvisioner: "string",
    allowVolumeExpansion: false,
    annotations: {
        string: "string",
    },
    labels: {
        string: "string",
    },
    mountOptions: ["string"],
    name: "string",
    parameters: {
        string: "string",
    },
    reclaimPolicy: "string",
    volumeBindingMode: "string",
});
Copy
type: rancher2:StorageClassV2
properties:
    allowVolumeExpansion: false
    annotations:
        string: string
    clusterId: string
    k8sProvisioner: string
    labels:
        string: string
    mountOptions:
        - string
    name: string
    parameters:
        string: string
    reclaimPolicy: string
    volumeBindingMode: string
Copy

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

ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The cluster id of the storageClass V2 (string)
K8sProvisioner
This property is required.
Changes to this property will trigger replacement.
string
The provisioner of the storageClass v2 (string)
AllowVolumeExpansion bool
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
Annotations Dictionary<string, string>
Annotations for the storageClass v2 (map)
Labels Dictionary<string, string>
Labels for the storageClass v2 (map)
MountOptions List<string>
The mount options for storageClass v2 (list)
Name Changes to this property will trigger replacement. string
The name of the storageClass v2 (string)
Parameters Dictionary<string, string>
The parameters for storageClass v2 (string)
ReclaimPolicy Changes to this property will trigger replacement. string
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
VolumeBindingMode Changes to this property will trigger replacement. string
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The cluster id of the storageClass V2 (string)
K8sProvisioner
This property is required.
Changes to this property will trigger replacement.
string
The provisioner of the storageClass v2 (string)
AllowVolumeExpansion bool
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
Annotations map[string]string
Annotations for the storageClass v2 (map)
Labels map[string]string
Labels for the storageClass v2 (map)
MountOptions []string
The mount options for storageClass v2 (list)
Name Changes to this property will trigger replacement. string
The name of the storageClass v2 (string)
Parameters map[string]string
The parameters for storageClass v2 (string)
ReclaimPolicy Changes to this property will trigger replacement. string
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
VolumeBindingMode Changes to this property will trigger replacement. string
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The cluster id of the storageClass V2 (string)
k8sProvisioner
This property is required.
Changes to this property will trigger replacement.
String
The provisioner of the storageClass v2 (string)
allowVolumeExpansion Boolean
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
annotations Map<String,String>
Annotations for the storageClass v2 (map)
labels Map<String,String>
Labels for the storageClass v2 (map)
mountOptions List<String>
The mount options for storageClass v2 (list)
name Changes to this property will trigger replacement. String
The name of the storageClass v2 (string)
parameters Map<String,String>
The parameters for storageClass v2 (string)
reclaimPolicy Changes to this property will trigger replacement. String
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
volumeBindingMode Changes to this property will trigger replacement. String
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
clusterId
This property is required.
Changes to this property will trigger replacement.
string
The cluster id of the storageClass V2 (string)
k8sProvisioner
This property is required.
Changes to this property will trigger replacement.
string
The provisioner of the storageClass v2 (string)
allowVolumeExpansion boolean
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
annotations {[key: string]: string}
Annotations for the storageClass v2 (map)
labels {[key: string]: string}
Labels for the storageClass v2 (map)
mountOptions string[]
The mount options for storageClass v2 (list)
name Changes to this property will trigger replacement. string
The name of the storageClass v2 (string)
parameters {[key: string]: string}
The parameters for storageClass v2 (string)
reclaimPolicy Changes to this property will trigger replacement. string
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
volumeBindingMode Changes to this property will trigger replacement. string
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
cluster_id
This property is required.
Changes to this property will trigger replacement.
str
The cluster id of the storageClass V2 (string)
k8s_provisioner
This property is required.
Changes to this property will trigger replacement.
str
The provisioner of the storageClass v2 (string)
allow_volume_expansion bool
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
annotations Mapping[str, str]
Annotations for the storageClass v2 (map)
labels Mapping[str, str]
Labels for the storageClass v2 (map)
mount_options Sequence[str]
The mount options for storageClass v2 (list)
name Changes to this property will trigger replacement. str
The name of the storageClass v2 (string)
parameters Mapping[str, str]
The parameters for storageClass v2 (string)
reclaim_policy Changes to this property will trigger replacement. str
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
volume_binding_mode Changes to this property will trigger replacement. str
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The cluster id of the storageClass V2 (string)
k8sProvisioner
This property is required.
Changes to this property will trigger replacement.
String
The provisioner of the storageClass v2 (string)
allowVolumeExpansion Boolean
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
annotations Map<String>
Annotations for the storageClass v2 (map)
labels Map<String>
Labels for the storageClass v2 (map)
mountOptions List<String>
The mount options for storageClass v2 (list)
name Changes to this property will trigger replacement. String
The name of the storageClass v2 (string)
parameters Map<String>
The parameters for storageClass v2 (string)
reclaimPolicy Changes to this property will trigger replacement. String
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
volumeBindingMode Changes to this property will trigger replacement. String
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
ResourceVersion string
(Computed) The k8s resource version (string)
Id string
The provider-assigned unique ID for this managed resource.
ResourceVersion string
(Computed) The k8s resource version (string)
id String
The provider-assigned unique ID for this managed resource.
resourceVersion String
(Computed) The k8s resource version (string)
id string
The provider-assigned unique ID for this managed resource.
resourceVersion string
(Computed) The k8s resource version (string)
id str
The provider-assigned unique ID for this managed resource.
resource_version str
(Computed) The k8s resource version (string)
id String
The provider-assigned unique ID for this managed resource.
resourceVersion String
(Computed) The k8s resource version (string)

Look up Existing StorageClassV2 Resource

Get an existing StorageClassV2 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?: StorageClassV2State, opts?: CustomResourceOptions): StorageClassV2
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allow_volume_expansion: Optional[bool] = None,
        annotations: Optional[Mapping[str, str]] = None,
        cluster_id: Optional[str] = None,
        k8s_provisioner: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        mount_options: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        parameters: Optional[Mapping[str, str]] = None,
        reclaim_policy: Optional[str] = None,
        resource_version: Optional[str] = None,
        volume_binding_mode: Optional[str] = None) -> StorageClassV2
func GetStorageClassV2(ctx *Context, name string, id IDInput, state *StorageClassV2State, opts ...ResourceOption) (*StorageClassV2, error)
public static StorageClassV2 Get(string name, Input<string> id, StorageClassV2State? state, CustomResourceOptions? opts = null)
public static StorageClassV2 get(String name, Output<String> id, StorageClassV2State state, CustomResourceOptions options)
resources:  _:    type: rancher2:StorageClassV2    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AllowVolumeExpansion bool
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
Annotations Dictionary<string, string>
Annotations for the storageClass v2 (map)
ClusterId Changes to this property will trigger replacement. string
The cluster id of the storageClass V2 (string)
K8sProvisioner Changes to this property will trigger replacement. string
The provisioner of the storageClass v2 (string)
Labels Dictionary<string, string>
Labels for the storageClass v2 (map)
MountOptions List<string>
The mount options for storageClass v2 (list)
Name Changes to this property will trigger replacement. string
The name of the storageClass v2 (string)
Parameters Dictionary<string, string>
The parameters for storageClass v2 (string)
ReclaimPolicy Changes to this property will trigger replacement. string
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
ResourceVersion string
(Computed) The k8s resource version (string)
VolumeBindingMode Changes to this property will trigger replacement. string
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
AllowVolumeExpansion bool
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
Annotations map[string]string
Annotations for the storageClass v2 (map)
ClusterId Changes to this property will trigger replacement. string
The cluster id of the storageClass V2 (string)
K8sProvisioner Changes to this property will trigger replacement. string
The provisioner of the storageClass v2 (string)
Labels map[string]string
Labels for the storageClass v2 (map)
MountOptions []string
The mount options for storageClass v2 (list)
Name Changes to this property will trigger replacement. string
The name of the storageClass v2 (string)
Parameters map[string]string
The parameters for storageClass v2 (string)
ReclaimPolicy Changes to this property will trigger replacement. string
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
ResourceVersion string
(Computed) The k8s resource version (string)
VolumeBindingMode Changes to this property will trigger replacement. string
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
allowVolumeExpansion Boolean
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
annotations Map<String,String>
Annotations for the storageClass v2 (map)
clusterId Changes to this property will trigger replacement. String
The cluster id of the storageClass V2 (string)
k8sProvisioner Changes to this property will trigger replacement. String
The provisioner of the storageClass v2 (string)
labels Map<String,String>
Labels for the storageClass v2 (map)
mountOptions List<String>
The mount options for storageClass v2 (list)
name Changes to this property will trigger replacement. String
The name of the storageClass v2 (string)
parameters Map<String,String>
The parameters for storageClass v2 (string)
reclaimPolicy Changes to this property will trigger replacement. String
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
resourceVersion String
(Computed) The k8s resource version (string)
volumeBindingMode Changes to this property will trigger replacement. String
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
allowVolumeExpansion boolean
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
annotations {[key: string]: string}
Annotations for the storageClass v2 (map)
clusterId Changes to this property will trigger replacement. string
The cluster id of the storageClass V2 (string)
k8sProvisioner Changes to this property will trigger replacement. string
The provisioner of the storageClass v2 (string)
labels {[key: string]: string}
Labels for the storageClass v2 (map)
mountOptions string[]
The mount options for storageClass v2 (list)
name Changes to this property will trigger replacement. string
The name of the storageClass v2 (string)
parameters {[key: string]: string}
The parameters for storageClass v2 (string)
reclaimPolicy Changes to this property will trigger replacement. string
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
resourceVersion string
(Computed) The k8s resource version (string)
volumeBindingMode Changes to this property will trigger replacement. string
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
allow_volume_expansion bool
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
annotations Mapping[str, str]
Annotations for the storageClass v2 (map)
cluster_id Changes to this property will trigger replacement. str
The cluster id of the storageClass V2 (string)
k8s_provisioner Changes to this property will trigger replacement. str
The provisioner of the storageClass v2 (string)
labels Mapping[str, str]
Labels for the storageClass v2 (map)
mount_options Sequence[str]
The mount options for storageClass v2 (list)
name Changes to this property will trigger replacement. str
The name of the storageClass v2 (string)
parameters Mapping[str, str]
The parameters for storageClass v2 (string)
reclaim_policy Changes to this property will trigger replacement. str
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
resource_version str
(Computed) The k8s resource version (string)
volume_binding_mode Changes to this property will trigger replacement. str
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
allowVolumeExpansion Boolean
Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
annotations Map<String>
Annotations for the storageClass v2 (map)
clusterId Changes to this property will trigger replacement. String
The cluster id of the storageClass V2 (string)
k8sProvisioner Changes to this property will trigger replacement. String
The provisioner of the storageClass v2 (string)
labels Map<String>
Labels for the storageClass v2 (map)
mountOptions List<String>
The mount options for storageClass v2 (list)
name Changes to this property will trigger replacement. String
The name of the storageClass v2 (string)
parameters Map<String>
The parameters for storageClass v2 (string)
reclaimPolicy Changes to this property will trigger replacement. String
The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
resourceVersion String
(Computed) The k8s resource version (string)
volumeBindingMode Changes to this property will trigger replacement. String
The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)

Import

V2 storage classs can be imported using the Rancher cluster ID and StorageClass V2 name.

$ pulumi import rancher2:index/storageClassV2:StorageClassV2 foo &lt;CLUSTER_ID&gt;.&lt;STORAGE_CLASS_V2_NAME&gt;
Copy

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

Package Details

Repository
Rancher2 pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.