1. Packages
  2. Rancher2 Provider
  3. API Docs
  4. StorageClassV2
Rancher 2 v7.1.1 published on Monday, Oct 7, 2024 by Pulumi

rancher2.StorageClassV2

Explore with Pulumi AI

rancher2 logo
Rancher 2 v7.1.1 published on Monday, Oct 7, 2024 by Pulumi

    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 string
    The unique name of the resource.
    args StorageClassV2Args
    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 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 string
    The unique name of the resource.
    args StorageClassV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args StorageClassV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
    });
    
    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"),
    })
    
    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());
    
    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")
    
    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",
    });
    
    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
    

    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 string
    The cluster id of the storageClass V2 (string)
    K8sProvisioner 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 string
    The name of the storageClass v2 (string)
    Parameters Dictionary<string, string>
    The parameters for storageClass v2 (string)
    ReclaimPolicy string
    The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
    VolumeBindingMode string
    The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
    ClusterId string
    The cluster id of the storageClass V2 (string)
    K8sProvisioner 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 string
    The name of the storageClass v2 (string)
    Parameters map[string]string
    The parameters for storageClass v2 (string)
    ReclaimPolicy string
    The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
    VolumeBindingMode string
    The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
    clusterId String
    The cluster id of the storageClass V2 (string)
    k8sProvisioner 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 String
    The name of the storageClass v2 (string)
    parameters Map<String,String>
    The parameters for storageClass v2 (string)
    reclaimPolicy String
    The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
    volumeBindingMode String
    The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
    clusterId string
    The cluster id of the storageClass V2 (string)
    k8sProvisioner 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 string
    The name of the storageClass v2 (string)
    parameters {[key: string]: string}
    The parameters for storageClass v2 (string)
    reclaimPolicy string
    The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
    volumeBindingMode string
    The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
    cluster_id str
    The cluster id of the storageClass V2 (string)
    k8s_provisioner 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 str
    The name of the storageClass v2 (string)
    parameters Mapping[str, str]
    The parameters for storageClass v2 (string)
    reclaim_policy str
    The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
    volume_binding_mode str
    The volume binding mode for storageClass v2. Immediate and WaitForFirstConsumer values are allowed. Default: Immediate (string)
    clusterId String
    The cluster id of the storageClass V2 (string)
    k8sProvisioner 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 String
    The name of the storageClass v2 (string)
    parameters Map<String>
    The parameters for storageClass v2 (string)
    reclaimPolicy String
    The reclaim policy for storageClass v2. Delete, Recycle and Retain values are allowed. Default: Delete (string)
    volumeBindingMode 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)
    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:
    AllowVolumeExpansion bool
    Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
    Annotations Dictionary<string, string>
    Annotations for the storageClass v2 (map)
    ClusterId string
    The cluster id of the storageClass V2 (string)
    K8sProvisioner 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 string
    The name of the storageClass v2 (string)
    Parameters Dictionary<string, string>
    The parameters for storageClass v2 (string)
    ReclaimPolicy 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 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 string
    The cluster id of the storageClass V2 (string)
    K8sProvisioner 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 string
    The name of the storageClass v2 (string)
    Parameters map[string]string
    The parameters for storageClass v2 (string)
    ReclaimPolicy 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 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 String
    The cluster id of the storageClass V2 (string)
    k8sProvisioner 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 String
    The name of the storageClass v2 (string)
    parameters Map<String,String>
    The parameters for storageClass v2 (string)
    reclaimPolicy 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 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 string
    The cluster id of the storageClass V2 (string)
    k8sProvisioner 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 string
    The name of the storageClass v2 (string)
    parameters {[key: string]: string}
    The parameters for storageClass v2 (string)
    reclaimPolicy 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 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 str
    The cluster id of the storageClass V2 (string)
    k8s_provisioner 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 str
    The name of the storageClass v2 (string)
    parameters Mapping[str, str]
    The parameters for storageClass v2 (string)
    reclaim_policy 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 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 String
    The cluster id of the storageClass V2 (string)
    k8sProvisioner 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 String
    The name of the storageClass v2 (string)
    parameters Map<String>
    The parameters for storageClass v2 (string)
    reclaimPolicy 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 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;
    

    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.
    rancher2 logo
    Rancher 2 v7.1.1 published on Monday, Oct 7, 2024 by Pulumi