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, Any]] = None,
labels: Optional[Mapping[str, Any]] = None,
mount_options: Optional[Sequence[str]] = None,
name: Optional[str] = None,
parameters: Optional[Mapping[str, Any]] = 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", "any" },
},
Labels =
{
{ "string", "any" },
},
MountOptions = new[]
{
"string",
},
Name = "string",
Parameters =
{
{ "string", "any" },
},
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.Map{
"string": pulumi.Any("any"),
},
Labels: pulumi.Map{
"string": pulumi.Any("any"),
},
MountOptions: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
Parameters: pulumi.Map{
"string": pulumi.Any("any"),
},
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", "any"))
.labels(Map.of("string", "any"))
.mountOptions("string")
.name("string")
.parameters(Map.of("string", "any"))
.reclaimPolicy("string")
.volumeBindingMode("string")
.build());
storage_class_v2_resource = rancher2.StorageClassV2("storageClassV2Resource",
cluster_id="string",
k8s_provisioner="string",
allow_volume_expansion=False,
annotations={
"string": "any",
},
labels={
"string": "any",
},
mount_options=["string"],
name="string",
parameters={
"string": "any",
},
reclaim_policy="string",
volume_binding_mode="string")
const storageClassV2Resource = new rancher2.StorageClassV2("storageClassV2Resource", {
clusterId: "string",
k8sProvisioner: "string",
allowVolumeExpansion: false,
annotations: {
string: "any",
},
labels: {
string: "any",
},
mountOptions: ["string"],
name: "string",
parameters: {
string: "any",
},
reclaimPolicy: "string",
volumeBindingMode: "string",
});
type: rancher2:StorageClassV2
properties:
allowVolumeExpansion: false
annotations:
string: any
clusterId: string
k8sProvisioner: string
labels:
string: any
mountOptions:
- string
name: string
parameters:
string: any
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
The StorageClassV2 resource accepts the following input properties:
- Cluster
Id string - The cluster id of the storageClass V2 (string)
- K8s
Provisioner string - The provisioner of the storageClass v2 (string)
- Allow
Volume boolExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- Annotations Dictionary<string, object>
- Annotations for the storageClass v2 (map)
- Labels Dictionary<string, object>
- Labels for the storageClass v2 (map)
- Mount
Options List<string> - The mount options for storageClass v2 (list)
- Name string
- The name of the storageClass v2 (string)
- Parameters Dictionary<string, object>
- The parameters for storageClass v2 (string)
- Reclaim
Policy string - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - Volume
Binding stringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- Cluster
Id string - The cluster id of the storageClass V2 (string)
- K8s
Provisioner string - The provisioner of the storageClass v2 (string)
- Allow
Volume boolExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- Annotations map[string]interface{}
- Annotations for the storageClass v2 (map)
- Labels map[string]interface{}
- Labels for the storageClass v2 (map)
- Mount
Options []string - The mount options for storageClass v2 (list)
- Name string
- The name of the storageClass v2 (string)
- Parameters map[string]interface{}
- The parameters for storageClass v2 (string)
- Reclaim
Policy string - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - Volume
Binding stringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- cluster
Id String - The cluster id of the storageClass V2 (string)
- k8s
Provisioner String - The provisioner of the storageClass v2 (string)
- allow
Volume BooleanExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- annotations Map<String,Object>
- Annotations for the storageClass v2 (map)
- labels Map<String,Object>
- Labels for the storageClass v2 (map)
- mount
Options List<String> - The mount options for storageClass v2 (list)
- name String
- The name of the storageClass v2 (string)
- parameters Map<String,Object>
- The parameters for storageClass v2 (string)
- reclaim
Policy String - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - volume
Binding StringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- cluster
Id string - The cluster id of the storageClass V2 (string)
- k8s
Provisioner string - The provisioner of the storageClass v2 (string)
- allow
Volume booleanExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- annotations {[key: string]: any}
- Annotations for the storageClass v2 (map)
- labels {[key: string]: any}
- Labels for the storageClass v2 (map)
- mount
Options string[] - The mount options for storageClass v2 (list)
- name string
- The name of the storageClass v2 (string)
- parameters {[key: string]: any}
- The parameters for storageClass v2 (string)
- reclaim
Policy string - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - volume
Binding stringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
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_ boolexpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- annotations Mapping[str, Any]
- Annotations for the storageClass v2 (map)
- labels Mapping[str, Any]
- 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, Any]
- The parameters for storageClass v2 (string)
- reclaim_
policy str - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - volume_
binding_ strmode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- cluster
Id String - The cluster id of the storageClass V2 (string)
- k8s
Provisioner String - The provisioner of the storageClass v2 (string)
- allow
Volume BooleanExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- annotations Map<Any>
- Annotations for the storageClass v2 (map)
- labels Map<Any>
- Labels for the storageClass v2 (map)
- mount
Options List<String> - The mount options for storageClass v2 (list)
- name String
- The name of the storageClass v2 (string)
- parameters Map<Any>
- The parameters for storageClass v2 (string)
- reclaim
Policy String - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - volume
Binding StringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
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.
- Resource
Version string - (Computed) The k8s resource version (string)
- Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Version string - (Computed) The k8s resource version (string)
- id String
- The provider-assigned unique ID for this managed resource.
- resource
Version String - (Computed) The k8s resource version (string)
- id string
- The provider-assigned unique ID for this managed resource.
- resource
Version 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.
- resource
Version 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, Any]] = None,
cluster_id: Optional[str] = None,
k8s_provisioner: Optional[str] = None,
labels: Optional[Mapping[str, Any]] = None,
mount_options: Optional[Sequence[str]] = None,
name: Optional[str] = None,
parameters: Optional[Mapping[str, Any]] = 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.
- Allow
Volume boolExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- Annotations Dictionary<string, object>
- Annotations for the storageClass v2 (map)
- Cluster
Id string - The cluster id of the storageClass V2 (string)
- K8s
Provisioner string - The provisioner of the storageClass v2 (string)
- Labels Dictionary<string, object>
- Labels for the storageClass v2 (map)
- Mount
Options List<string> - The mount options for storageClass v2 (list)
- Name string
- The name of the storageClass v2 (string)
- Parameters Dictionary<string, object>
- The parameters for storageClass v2 (string)
- Reclaim
Policy string - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - Resource
Version string - (Computed) The k8s resource version (string)
- Volume
Binding stringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- Allow
Volume boolExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- Annotations map[string]interface{}
- Annotations for the storageClass v2 (map)
- Cluster
Id string - The cluster id of the storageClass V2 (string)
- K8s
Provisioner string - The provisioner of the storageClass v2 (string)
- Labels map[string]interface{}
- Labels for the storageClass v2 (map)
- Mount
Options []string - The mount options for storageClass v2 (list)
- Name string
- The name of the storageClass v2 (string)
- Parameters map[string]interface{}
- The parameters for storageClass v2 (string)
- Reclaim
Policy string - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - Resource
Version string - (Computed) The k8s resource version (string)
- Volume
Binding stringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- allow
Volume BooleanExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- annotations Map<String,Object>
- Annotations for the storageClass v2 (map)
- cluster
Id String - The cluster id of the storageClass V2 (string)
- k8s
Provisioner String - The provisioner of the storageClass v2 (string)
- labels Map<String,Object>
- Labels for the storageClass v2 (map)
- mount
Options List<String> - The mount options for storageClass v2 (list)
- name String
- The name of the storageClass v2 (string)
- parameters Map<String,Object>
- The parameters for storageClass v2 (string)
- reclaim
Policy String - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - resource
Version String - (Computed) The k8s resource version (string)
- volume
Binding StringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- allow
Volume booleanExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- annotations {[key: string]: any}
- Annotations for the storageClass v2 (map)
- cluster
Id string - The cluster id of the storageClass V2 (string)
- k8s
Provisioner string - The provisioner of the storageClass v2 (string)
- labels {[key: string]: any}
- Labels for the storageClass v2 (map)
- mount
Options string[] - The mount options for storageClass v2 (list)
- name string
- The name of the storageClass v2 (string)
- parameters {[key: string]: any}
- The parameters for storageClass v2 (string)
- reclaim
Policy string - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - resource
Version string - (Computed) The k8s resource version (string)
- volume
Binding stringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- allow_
volume_ boolexpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- annotations Mapping[str, Any]
- 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, Any]
- 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, Any]
- The parameters for storageClass v2 (string)
- reclaim_
policy str - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - resource_
version str - (Computed) The k8s resource version (string)
- volume_
binding_ strmode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
values are allowed. Default:Immediate
(string)
- allow
Volume BooleanExpansion - Is the provisioner of the storageClass v2 allowing volume expansion? (bool)
- annotations Map<Any>
- Annotations for the storageClass v2 (map)
- cluster
Id String - The cluster id of the storageClass V2 (string)
- k8s
Provisioner String - The provisioner of the storageClass v2 (string)
- labels Map<Any>
- Labels for the storageClass v2 (map)
- mount
Options List<String> - The mount options for storageClass v2 (list)
- name String
- The name of the storageClass v2 (string)
- parameters Map<Any>
- The parameters for storageClass v2 (string)
- reclaim
Policy String - The reclaim policy for storageClass v2.
Delete
,Recycle
andRetain
values are allowed. Default:Delete
(string) - resource
Version String - (Computed) The k8s resource version (string)
- volume
Binding StringMode - The volume binding mode for storageClass v2.
Immediate
andWaitForFirstConsumer
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 <CLUSTER_ID>.<STORAGE_CLASS_V2_NAME>
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.