github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/rbac/v1beta1/roleBindingPatch.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  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Patch resources are used to modify existing Kubernetes resources by using
    15  // Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than
    16  // one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource.
    17  // Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the
    18  // [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for
    19  // additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi.
    20  // RoleBinding references a role, but does not contain it.  It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in.  RoleBindings in a given namespace only have effect in that namespace. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.20.
    21  type RoleBindingPatch struct {
    22  	pulumi.CustomResourceState
    23  
    24  	// 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
    25  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    26  	// 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
    27  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    28  	// Standard object's metadata.
    29  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    30  	// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.
    31  	RoleRef RoleRefPatchPtrOutput `pulumi:"roleRef"`
    32  	// Subjects holds references to the objects the role applies to.
    33  	Subjects SubjectPatchArrayOutput `pulumi:"subjects"`
    34  }
    35  
    36  // NewRoleBindingPatch registers a new resource with the given unique name, arguments, and options.
    37  func NewRoleBindingPatch(ctx *pulumi.Context,
    38  	name string, args *RoleBindingPatchArgs, opts ...pulumi.ResourceOption) (*RoleBindingPatch, error) {
    39  	if args == nil {
    40  		args = &RoleBindingPatchArgs{}
    41  	}
    42  
    43  	args.ApiVersion = pulumi.StringPtr("rbac.authorization.k8s.io/v1beta1")
    44  	args.Kind = pulumi.StringPtr("RoleBinding")
    45  	aliases := pulumi.Aliases([]pulumi.Alias{
    46  		{
    47  			Type: pulumi.String("kubernetes:rbac.authorization.k8s.io/v1:RoleBindingPatch"),
    48  		},
    49  		{
    50  			Type: pulumi.String("kubernetes:rbac.authorization.k8s.io/v1alpha1:RoleBindingPatch"),
    51  		},
    52  	})
    53  	opts = append(opts, aliases)
    54  	var resource RoleBindingPatch
    55  	err := ctx.RegisterResource("kubernetes:rbac.authorization.k8s.io/v1beta1:RoleBindingPatch", name, args, &resource, opts...)
    56  	if err != nil {
    57  		return nil, err
    58  	}
    59  	return &resource, nil
    60  }
    61  
    62  // GetRoleBindingPatch gets an existing RoleBindingPatch resource's state with the given name, ID, and optional
    63  // state properties that are used to uniquely qualify the lookup (nil if not required).
    64  func GetRoleBindingPatch(ctx *pulumi.Context,
    65  	name string, id pulumi.IDInput, state *RoleBindingPatchState, opts ...pulumi.ResourceOption) (*RoleBindingPatch, error) {
    66  	var resource RoleBindingPatch
    67  	err := ctx.ReadResource("kubernetes:rbac.authorization.k8s.io/v1beta1:RoleBindingPatch", name, id, state, &resource, opts...)
    68  	if err != nil {
    69  		return nil, err
    70  	}
    71  	return &resource, nil
    72  }
    73  
    74  // Input properties used for looking up and filtering RoleBindingPatch resources.
    75  type roleBindingPatchState struct {
    76  }
    77  
    78  type RoleBindingPatchState struct {
    79  }
    80  
    81  func (RoleBindingPatchState) ElementType() reflect.Type {
    82  	return reflect.TypeOf((*roleBindingPatchState)(nil)).Elem()
    83  }
    84  
    85  type roleBindingPatchArgs struct {
    86  	// 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
    87  	ApiVersion *string `pulumi:"apiVersion"`
    88  	// 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
    89  	Kind *string `pulumi:"kind"`
    90  	// Standard object's metadata.
    91  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    92  	// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.
    93  	RoleRef *RoleRefPatch `pulumi:"roleRef"`
    94  	// Subjects holds references to the objects the role applies to.
    95  	Subjects []SubjectPatch `pulumi:"subjects"`
    96  }
    97  
    98  // The set of arguments for constructing a RoleBindingPatch resource.
    99  type RoleBindingPatchArgs struct {
   100  	// 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
   101  	ApiVersion pulumi.StringPtrInput
   102  	// 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
   103  	Kind pulumi.StringPtrInput
   104  	// Standard object's metadata.
   105  	Metadata metav1.ObjectMetaPatchPtrInput
   106  	// RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.
   107  	RoleRef RoleRefPatchPtrInput
   108  	// Subjects holds references to the objects the role applies to.
   109  	Subjects SubjectPatchArrayInput
   110  }
   111  
   112  func (RoleBindingPatchArgs) ElementType() reflect.Type {
   113  	return reflect.TypeOf((*roleBindingPatchArgs)(nil)).Elem()
   114  }
   115  
   116  type RoleBindingPatchInput interface {
   117  	pulumi.Input
   118  
   119  	ToRoleBindingPatchOutput() RoleBindingPatchOutput
   120  	ToRoleBindingPatchOutputWithContext(ctx context.Context) RoleBindingPatchOutput
   121  }
   122  
   123  func (*RoleBindingPatch) ElementType() reflect.Type {
   124  	return reflect.TypeOf((**RoleBindingPatch)(nil)).Elem()
   125  }
   126  
   127  func (i *RoleBindingPatch) ToRoleBindingPatchOutput() RoleBindingPatchOutput {
   128  	return i.ToRoleBindingPatchOutputWithContext(context.Background())
   129  }
   130  
   131  func (i *RoleBindingPatch) ToRoleBindingPatchOutputWithContext(ctx context.Context) RoleBindingPatchOutput {
   132  	return pulumi.ToOutputWithContext(ctx, i).(RoleBindingPatchOutput)
   133  }
   134  
   135  // RoleBindingPatchArrayInput is an input type that accepts RoleBindingPatchArray and RoleBindingPatchArrayOutput values.
   136  // You can construct a concrete instance of `RoleBindingPatchArrayInput` via:
   137  //
   138  //	RoleBindingPatchArray{ RoleBindingPatchArgs{...} }
   139  type RoleBindingPatchArrayInput interface {
   140  	pulumi.Input
   141  
   142  	ToRoleBindingPatchArrayOutput() RoleBindingPatchArrayOutput
   143  	ToRoleBindingPatchArrayOutputWithContext(context.Context) RoleBindingPatchArrayOutput
   144  }
   145  
   146  type RoleBindingPatchArray []RoleBindingPatchInput
   147  
   148  func (RoleBindingPatchArray) ElementType() reflect.Type {
   149  	return reflect.TypeOf((*[]*RoleBindingPatch)(nil)).Elem()
   150  }
   151  
   152  func (i RoleBindingPatchArray) ToRoleBindingPatchArrayOutput() RoleBindingPatchArrayOutput {
   153  	return i.ToRoleBindingPatchArrayOutputWithContext(context.Background())
   154  }
   155  
   156  func (i RoleBindingPatchArray) ToRoleBindingPatchArrayOutputWithContext(ctx context.Context) RoleBindingPatchArrayOutput {
   157  	return pulumi.ToOutputWithContext(ctx, i).(RoleBindingPatchArrayOutput)
   158  }
   159  
   160  // RoleBindingPatchMapInput is an input type that accepts RoleBindingPatchMap and RoleBindingPatchMapOutput values.
   161  // You can construct a concrete instance of `RoleBindingPatchMapInput` via:
   162  //
   163  //	RoleBindingPatchMap{ "key": RoleBindingPatchArgs{...} }
   164  type RoleBindingPatchMapInput interface {
   165  	pulumi.Input
   166  
   167  	ToRoleBindingPatchMapOutput() RoleBindingPatchMapOutput
   168  	ToRoleBindingPatchMapOutputWithContext(context.Context) RoleBindingPatchMapOutput
   169  }
   170  
   171  type RoleBindingPatchMap map[string]RoleBindingPatchInput
   172  
   173  func (RoleBindingPatchMap) ElementType() reflect.Type {
   174  	return reflect.TypeOf((*map[string]*RoleBindingPatch)(nil)).Elem()
   175  }
   176  
   177  func (i RoleBindingPatchMap) ToRoleBindingPatchMapOutput() RoleBindingPatchMapOutput {
   178  	return i.ToRoleBindingPatchMapOutputWithContext(context.Background())
   179  }
   180  
   181  func (i RoleBindingPatchMap) ToRoleBindingPatchMapOutputWithContext(ctx context.Context) RoleBindingPatchMapOutput {
   182  	return pulumi.ToOutputWithContext(ctx, i).(RoleBindingPatchMapOutput)
   183  }
   184  
   185  type RoleBindingPatchOutput struct{ *pulumi.OutputState }
   186  
   187  func (RoleBindingPatchOutput) ElementType() reflect.Type {
   188  	return reflect.TypeOf((**RoleBindingPatch)(nil)).Elem()
   189  }
   190  
   191  func (o RoleBindingPatchOutput) ToRoleBindingPatchOutput() RoleBindingPatchOutput {
   192  	return o
   193  }
   194  
   195  func (o RoleBindingPatchOutput) ToRoleBindingPatchOutputWithContext(ctx context.Context) RoleBindingPatchOutput {
   196  	return o
   197  }
   198  
   199  // 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
   200  func (o RoleBindingPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   201  	return o.ApplyT(func(v *RoleBindingPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   202  }
   203  
   204  // 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
   205  func (o RoleBindingPatchOutput) Kind() pulumi.StringPtrOutput {
   206  	return o.ApplyT(func(v *RoleBindingPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   207  }
   208  
   209  // Standard object's metadata.
   210  func (o RoleBindingPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   211  	return o.ApplyT(func(v *RoleBindingPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   212  }
   213  
   214  // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.
   215  func (o RoleBindingPatchOutput) RoleRef() RoleRefPatchPtrOutput {
   216  	return o.ApplyT(func(v *RoleBindingPatch) RoleRefPatchPtrOutput { return v.RoleRef }).(RoleRefPatchPtrOutput)
   217  }
   218  
   219  // Subjects holds references to the objects the role applies to.
   220  func (o RoleBindingPatchOutput) Subjects() SubjectPatchArrayOutput {
   221  	return o.ApplyT(func(v *RoleBindingPatch) SubjectPatchArrayOutput { return v.Subjects }).(SubjectPatchArrayOutput)
   222  }
   223  
   224  type RoleBindingPatchArrayOutput struct{ *pulumi.OutputState }
   225  
   226  func (RoleBindingPatchArrayOutput) ElementType() reflect.Type {
   227  	return reflect.TypeOf((*[]*RoleBindingPatch)(nil)).Elem()
   228  }
   229  
   230  func (o RoleBindingPatchArrayOutput) ToRoleBindingPatchArrayOutput() RoleBindingPatchArrayOutput {
   231  	return o
   232  }
   233  
   234  func (o RoleBindingPatchArrayOutput) ToRoleBindingPatchArrayOutputWithContext(ctx context.Context) RoleBindingPatchArrayOutput {
   235  	return o
   236  }
   237  
   238  func (o RoleBindingPatchArrayOutput) Index(i pulumi.IntInput) RoleBindingPatchOutput {
   239  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RoleBindingPatch {
   240  		return vs[0].([]*RoleBindingPatch)[vs[1].(int)]
   241  	}).(RoleBindingPatchOutput)
   242  }
   243  
   244  type RoleBindingPatchMapOutput struct{ *pulumi.OutputState }
   245  
   246  func (RoleBindingPatchMapOutput) ElementType() reflect.Type {
   247  	return reflect.TypeOf((*map[string]*RoleBindingPatch)(nil)).Elem()
   248  }
   249  
   250  func (o RoleBindingPatchMapOutput) ToRoleBindingPatchMapOutput() RoleBindingPatchMapOutput {
   251  	return o
   252  }
   253  
   254  func (o RoleBindingPatchMapOutput) ToRoleBindingPatchMapOutputWithContext(ctx context.Context) RoleBindingPatchMapOutput {
   255  	return o
   256  }
   257  
   258  func (o RoleBindingPatchMapOutput) MapIndex(k pulumi.StringInput) RoleBindingPatchOutput {
   259  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RoleBindingPatch {
   260  		return vs[0].(map[string]*RoleBindingPatch)[vs[1].(string)]
   261  	}).(RoleBindingPatchOutput)
   262  }
   263  
   264  func init() {
   265  	pulumi.RegisterInputType(reflect.TypeOf((*RoleBindingPatchInput)(nil)).Elem(), &RoleBindingPatch{})
   266  	pulumi.RegisterInputType(reflect.TypeOf((*RoleBindingPatchArrayInput)(nil)).Elem(), RoleBindingPatchArray{})
   267  	pulumi.RegisterInputType(reflect.TypeOf((*RoleBindingPatchMapInput)(nil)).Elem(), RoleBindingPatchMap{})
   268  	pulumi.RegisterOutputType(RoleBindingPatchOutput{})
   269  	pulumi.RegisterOutputType(RoleBindingPatchArrayOutput{})
   270  	pulumi.RegisterOutputType(RoleBindingPatchMapOutput{})
   271  }