github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/storage/v1beta1/storageClass.go (about)

     1  // Code generated by pulumigen DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package v1beta1
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/core/v1"
    12  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    13  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    14  )
    15  
    16  // StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.
    17  //
    18  // StorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.
    19  type StorageClass struct {
    20  	pulumi.CustomResourceState
    21  
    22  	// AllowVolumeExpansion shows whether the storage class allow volume expand
    23  	AllowVolumeExpansion pulumi.BoolPtrOutput `pulumi:"allowVolumeExpansion"`
    24  	// Restrict the node topologies where volumes can be dynamically provisioned. Each volume plugin defines its own supported topology specifications. An empty TopologySelectorTerm list means there is no topology restriction. This field is only honored by servers that enable the VolumeScheduling feature.
    25  	AllowedTopologies corev1.TopologySelectorTermArrayOutput `pulumi:"allowedTopologies"`
    26  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    27  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    28  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    29  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    30  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    31  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    32  	// Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid.
    33  	MountOptions pulumi.StringArrayOutput `pulumi:"mountOptions"`
    34  	// Parameters holds the parameters for the provisioner that should create volumes of this storage class.
    35  	Parameters pulumi.StringMapOutput `pulumi:"parameters"`
    36  	// Provisioner indicates the type of the provisioner.
    37  	Provisioner pulumi.StringOutput `pulumi:"provisioner"`
    38  	// Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.
    39  	ReclaimPolicy pulumi.StringPtrOutput `pulumi:"reclaimPolicy"`
    40  	// VolumeBindingMode indicates how PersistentVolumeClaims should be provisioned and bound.  When unset, VolumeBindingImmediate is used. This field is only honored by servers that enable the VolumeScheduling feature.
    41  	VolumeBindingMode pulumi.StringPtrOutput `pulumi:"volumeBindingMode"`
    42  }
    43  
    44  // NewStorageClass registers a new resource with the given unique name, arguments, and options.
    45  func NewStorageClass(ctx *pulumi.Context,
    46  	name string, args *StorageClassArgs, opts ...pulumi.ResourceOption) (*StorageClass, error) {
    47  	if args == nil {
    48  		return nil, errors.New("missing one or more required arguments")
    49  	}
    50  
    51  	if args.Provisioner == nil {
    52  		return nil, errors.New("invalid value for required argument 'Provisioner'")
    53  	}
    54  	args.ApiVersion = pulumi.StringPtr("storage.k8s.io/v1beta1")
    55  	args.Kind = pulumi.StringPtr("StorageClass")
    56  	aliases := pulumi.Aliases([]pulumi.Alias{
    57  		{
    58  			Type: pulumi.String("kubernetes:storage.k8s.io/v1:StorageClass"),
    59  		},
    60  	})
    61  	opts = append(opts, aliases)
    62  	var resource StorageClass
    63  	err := ctx.RegisterResource("kubernetes:storage.k8s.io/v1beta1:StorageClass", name, args, &resource, opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	return &resource, nil
    68  }
    69  
    70  // GetStorageClass gets an existing StorageClass resource's state with the given name, ID, and optional
    71  // state properties that are used to uniquely qualify the lookup (nil if not required).
    72  func GetStorageClass(ctx *pulumi.Context,
    73  	name string, id pulumi.IDInput, state *StorageClassState, opts ...pulumi.ResourceOption) (*StorageClass, error) {
    74  	var resource StorageClass
    75  	err := ctx.ReadResource("kubernetes:storage.k8s.io/v1beta1:StorageClass", name, id, state, &resource, opts...)
    76  	if err != nil {
    77  		return nil, err
    78  	}
    79  	return &resource, nil
    80  }
    81  
    82  // Input properties used for looking up and filtering StorageClass resources.
    83  type storageClassState struct {
    84  }
    85  
    86  type StorageClassState struct {
    87  }
    88  
    89  func (StorageClassState) ElementType() reflect.Type {
    90  	return reflect.TypeOf((*storageClassState)(nil)).Elem()
    91  }
    92  
    93  type storageClassArgs struct {
    94  	// AllowVolumeExpansion shows whether the storage class allow volume expand
    95  	AllowVolumeExpansion *bool `pulumi:"allowVolumeExpansion"`
    96  	// Restrict the node topologies where volumes can be dynamically provisioned. Each volume plugin defines its own supported topology specifications. An empty TopologySelectorTerm list means there is no topology restriction. This field is only honored by servers that enable the VolumeScheduling feature.
    97  	AllowedTopologies []corev1.TopologySelectorTerm `pulumi:"allowedTopologies"`
    98  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    99  	ApiVersion *string `pulumi:"apiVersion"`
   100  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
   101  	Kind *string `pulumi:"kind"`
   102  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   103  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
   104  	// Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid.
   105  	MountOptions []string `pulumi:"mountOptions"`
   106  	// Parameters holds the parameters for the provisioner that should create volumes of this storage class.
   107  	Parameters map[string]string `pulumi:"parameters"`
   108  	// Provisioner indicates the type of the provisioner.
   109  	Provisioner string `pulumi:"provisioner"`
   110  	// Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.
   111  	ReclaimPolicy *string `pulumi:"reclaimPolicy"`
   112  	// VolumeBindingMode indicates how PersistentVolumeClaims should be provisioned and bound.  When unset, VolumeBindingImmediate is used. This field is only honored by servers that enable the VolumeScheduling feature.
   113  	VolumeBindingMode *string `pulumi:"volumeBindingMode"`
   114  }
   115  
   116  // The set of arguments for constructing a StorageClass resource.
   117  type StorageClassArgs struct {
   118  	// AllowVolumeExpansion shows whether the storage class allow volume expand
   119  	AllowVolumeExpansion pulumi.BoolPtrInput
   120  	// Restrict the node topologies where volumes can be dynamically provisioned. Each volume plugin defines its own supported topology specifications. An empty TopologySelectorTerm list means there is no topology restriction. This field is only honored by servers that enable the VolumeScheduling feature.
   121  	AllowedTopologies corev1.TopologySelectorTermArrayInput
   122  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
   123  	ApiVersion pulumi.StringPtrInput
   124  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
   125  	Kind pulumi.StringPtrInput
   126  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   127  	Metadata metav1.ObjectMetaPtrInput
   128  	// Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid.
   129  	MountOptions pulumi.StringArrayInput
   130  	// Parameters holds the parameters for the provisioner that should create volumes of this storage class.
   131  	Parameters pulumi.StringMapInput
   132  	// Provisioner indicates the type of the provisioner.
   133  	Provisioner pulumi.StringInput
   134  	// Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.
   135  	ReclaimPolicy pulumi.StringPtrInput
   136  	// VolumeBindingMode indicates how PersistentVolumeClaims should be provisioned and bound.  When unset, VolumeBindingImmediate is used. This field is only honored by servers that enable the VolumeScheduling feature.
   137  	VolumeBindingMode pulumi.StringPtrInput
   138  }
   139  
   140  func (StorageClassArgs) ElementType() reflect.Type {
   141  	return reflect.TypeOf((*storageClassArgs)(nil)).Elem()
   142  }
   143  
   144  type StorageClassInput interface {
   145  	pulumi.Input
   146  
   147  	ToStorageClassOutput() StorageClassOutput
   148  	ToStorageClassOutputWithContext(ctx context.Context) StorageClassOutput
   149  }
   150  
   151  func (*StorageClass) ElementType() reflect.Type {
   152  	return reflect.TypeOf((**StorageClass)(nil)).Elem()
   153  }
   154  
   155  func (i *StorageClass) ToStorageClassOutput() StorageClassOutput {
   156  	return i.ToStorageClassOutputWithContext(context.Background())
   157  }
   158  
   159  func (i *StorageClass) ToStorageClassOutputWithContext(ctx context.Context) StorageClassOutput {
   160  	return pulumi.ToOutputWithContext(ctx, i).(StorageClassOutput)
   161  }
   162  
   163  // StorageClassArrayInput is an input type that accepts StorageClassArray and StorageClassArrayOutput values.
   164  // You can construct a concrete instance of `StorageClassArrayInput` via:
   165  //
   166  //	StorageClassArray{ StorageClassArgs{...} }
   167  type StorageClassArrayInput interface {
   168  	pulumi.Input
   169  
   170  	ToStorageClassArrayOutput() StorageClassArrayOutput
   171  	ToStorageClassArrayOutputWithContext(context.Context) StorageClassArrayOutput
   172  }
   173  
   174  type StorageClassArray []StorageClassInput
   175  
   176  func (StorageClassArray) ElementType() reflect.Type {
   177  	return reflect.TypeOf((*[]*StorageClass)(nil)).Elem()
   178  }
   179  
   180  func (i StorageClassArray) ToStorageClassArrayOutput() StorageClassArrayOutput {
   181  	return i.ToStorageClassArrayOutputWithContext(context.Background())
   182  }
   183  
   184  func (i StorageClassArray) ToStorageClassArrayOutputWithContext(ctx context.Context) StorageClassArrayOutput {
   185  	return pulumi.ToOutputWithContext(ctx, i).(StorageClassArrayOutput)
   186  }
   187  
   188  // StorageClassMapInput is an input type that accepts StorageClassMap and StorageClassMapOutput values.
   189  // You can construct a concrete instance of `StorageClassMapInput` via:
   190  //
   191  //	StorageClassMap{ "key": StorageClassArgs{...} }
   192  type StorageClassMapInput interface {
   193  	pulumi.Input
   194  
   195  	ToStorageClassMapOutput() StorageClassMapOutput
   196  	ToStorageClassMapOutputWithContext(context.Context) StorageClassMapOutput
   197  }
   198  
   199  type StorageClassMap map[string]StorageClassInput
   200  
   201  func (StorageClassMap) ElementType() reflect.Type {
   202  	return reflect.TypeOf((*map[string]*StorageClass)(nil)).Elem()
   203  }
   204  
   205  func (i StorageClassMap) ToStorageClassMapOutput() StorageClassMapOutput {
   206  	return i.ToStorageClassMapOutputWithContext(context.Background())
   207  }
   208  
   209  func (i StorageClassMap) ToStorageClassMapOutputWithContext(ctx context.Context) StorageClassMapOutput {
   210  	return pulumi.ToOutputWithContext(ctx, i).(StorageClassMapOutput)
   211  }
   212  
   213  type StorageClassOutput struct{ *pulumi.OutputState }
   214  
   215  func (StorageClassOutput) ElementType() reflect.Type {
   216  	return reflect.TypeOf((**StorageClass)(nil)).Elem()
   217  }
   218  
   219  func (o StorageClassOutput) ToStorageClassOutput() StorageClassOutput {
   220  	return o
   221  }
   222  
   223  func (o StorageClassOutput) ToStorageClassOutputWithContext(ctx context.Context) StorageClassOutput {
   224  	return o
   225  }
   226  
   227  // AllowVolumeExpansion shows whether the storage class allow volume expand
   228  func (o StorageClassOutput) AllowVolumeExpansion() pulumi.BoolPtrOutput {
   229  	return o.ApplyT(func(v *StorageClass) pulumi.BoolPtrOutput { return v.AllowVolumeExpansion }).(pulumi.BoolPtrOutput)
   230  }
   231  
   232  // Restrict the node topologies where volumes can be dynamically provisioned. Each volume plugin defines its own supported topology specifications. An empty TopologySelectorTerm list means there is no topology restriction. This field is only honored by servers that enable the VolumeScheduling feature.
   233  func (o StorageClassOutput) AllowedTopologies() corev1.TopologySelectorTermArrayOutput {
   234  	return o.ApplyT(func(v *StorageClass) corev1.TopologySelectorTermArrayOutput { return v.AllowedTopologies }).(corev1.TopologySelectorTermArrayOutput)
   235  }
   236  
   237  // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
   238  func (o StorageClassOutput) ApiVersion() pulumi.StringPtrOutput {
   239  	return o.ApplyT(func(v *StorageClass) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   240  }
   241  
   242  // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
   243  func (o StorageClassOutput) Kind() pulumi.StringPtrOutput {
   244  	return o.ApplyT(func(v *StorageClass) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   245  }
   246  
   247  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   248  func (o StorageClassOutput) Metadata() metav1.ObjectMetaPtrOutput {
   249  	return o.ApplyT(func(v *StorageClass) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   250  }
   251  
   252  // Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid.
   253  func (o StorageClassOutput) MountOptions() pulumi.StringArrayOutput {
   254  	return o.ApplyT(func(v *StorageClass) pulumi.StringArrayOutput { return v.MountOptions }).(pulumi.StringArrayOutput)
   255  }
   256  
   257  // Parameters holds the parameters for the provisioner that should create volumes of this storage class.
   258  func (o StorageClassOutput) Parameters() pulumi.StringMapOutput {
   259  	return o.ApplyT(func(v *StorageClass) pulumi.StringMapOutput { return v.Parameters }).(pulumi.StringMapOutput)
   260  }
   261  
   262  // Provisioner indicates the type of the provisioner.
   263  func (o StorageClassOutput) Provisioner() pulumi.StringOutput {
   264  	return o.ApplyT(func(v *StorageClass) pulumi.StringOutput { return v.Provisioner }).(pulumi.StringOutput)
   265  }
   266  
   267  // Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.
   268  func (o StorageClassOutput) ReclaimPolicy() pulumi.StringPtrOutput {
   269  	return o.ApplyT(func(v *StorageClass) pulumi.StringPtrOutput { return v.ReclaimPolicy }).(pulumi.StringPtrOutput)
   270  }
   271  
   272  // VolumeBindingMode indicates how PersistentVolumeClaims should be provisioned and bound.  When unset, VolumeBindingImmediate is used. This field is only honored by servers that enable the VolumeScheduling feature.
   273  func (o StorageClassOutput) VolumeBindingMode() pulumi.StringPtrOutput {
   274  	return o.ApplyT(func(v *StorageClass) pulumi.StringPtrOutput { return v.VolumeBindingMode }).(pulumi.StringPtrOutput)
   275  }
   276  
   277  type StorageClassArrayOutput struct{ *pulumi.OutputState }
   278  
   279  func (StorageClassArrayOutput) ElementType() reflect.Type {
   280  	return reflect.TypeOf((*[]*StorageClass)(nil)).Elem()
   281  }
   282  
   283  func (o StorageClassArrayOutput) ToStorageClassArrayOutput() StorageClassArrayOutput {
   284  	return o
   285  }
   286  
   287  func (o StorageClassArrayOutput) ToStorageClassArrayOutputWithContext(ctx context.Context) StorageClassArrayOutput {
   288  	return o
   289  }
   290  
   291  func (o StorageClassArrayOutput) Index(i pulumi.IntInput) StorageClassOutput {
   292  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StorageClass {
   293  		return vs[0].([]*StorageClass)[vs[1].(int)]
   294  	}).(StorageClassOutput)
   295  }
   296  
   297  type StorageClassMapOutput struct{ *pulumi.OutputState }
   298  
   299  func (StorageClassMapOutput) ElementType() reflect.Type {
   300  	return reflect.TypeOf((*map[string]*StorageClass)(nil)).Elem()
   301  }
   302  
   303  func (o StorageClassMapOutput) ToStorageClassMapOutput() StorageClassMapOutput {
   304  	return o
   305  }
   306  
   307  func (o StorageClassMapOutput) ToStorageClassMapOutputWithContext(ctx context.Context) StorageClassMapOutput {
   308  	return o
   309  }
   310  
   311  func (o StorageClassMapOutput) MapIndex(k pulumi.StringInput) StorageClassOutput {
   312  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StorageClass {
   313  		return vs[0].(map[string]*StorageClass)[vs[1].(string)]
   314  	}).(StorageClassOutput)
   315  }
   316  
   317  func init() {
   318  	pulumi.RegisterInputType(reflect.TypeOf((*StorageClassInput)(nil)).Elem(), &StorageClass{})
   319  	pulumi.RegisterInputType(reflect.TypeOf((*StorageClassArrayInput)(nil)).Elem(), StorageClassArray{})
   320  	pulumi.RegisterInputType(reflect.TypeOf((*StorageClassMapInput)(nil)).Elem(), StorageClassMap{})
   321  	pulumi.RegisterOutputType(StorageClassOutput{})
   322  	pulumi.RegisterOutputType(StorageClassArrayOutput{})
   323  	pulumi.RegisterOutputType(StorageClassMapOutput{})
   324  }