github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/rbac/v1alpha1/clusterRolePatch.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 v1alpha1 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 // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.20. 21 type ClusterRolePatch struct { 22 pulumi.CustomResourceState 23 24 // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller. 25 AggregationRule AggregationRulePatchPtrOutput `pulumi:"aggregationRule"` 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. 31 Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"` 32 // Rules holds all the PolicyRules for this ClusterRole 33 Rules PolicyRulePatchArrayOutput `pulumi:"rules"` 34 } 35 36 // NewClusterRolePatch registers a new resource with the given unique name, arguments, and options. 37 func NewClusterRolePatch(ctx *pulumi.Context, 38 name string, args *ClusterRolePatchArgs, opts ...pulumi.ResourceOption) (*ClusterRolePatch, error) { 39 if args == nil { 40 args = &ClusterRolePatchArgs{} 41 } 42 43 args.ApiVersion = pulumi.StringPtr("rbac.authorization.k8s.io/v1alpha1") 44 args.Kind = pulumi.StringPtr("ClusterRole") 45 aliases := pulumi.Aliases([]pulumi.Alias{ 46 { 47 Type: pulumi.String("kubernetes:rbac.authorization.k8s.io/v1:ClusterRolePatch"), 48 }, 49 { 50 Type: pulumi.String("kubernetes:rbac.authorization.k8s.io/v1beta1:ClusterRolePatch"), 51 }, 52 }) 53 opts = append(opts, aliases) 54 var resource ClusterRolePatch 55 err := ctx.RegisterResource("kubernetes:rbac.authorization.k8s.io/v1alpha1:ClusterRolePatch", name, args, &resource, opts...) 56 if err != nil { 57 return nil, err 58 } 59 return &resource, nil 60 } 61 62 // GetClusterRolePatch gets an existing ClusterRolePatch 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 GetClusterRolePatch(ctx *pulumi.Context, 65 name string, id pulumi.IDInput, state *ClusterRolePatchState, opts ...pulumi.ResourceOption) (*ClusterRolePatch, error) { 66 var resource ClusterRolePatch 67 err := ctx.ReadResource("kubernetes:rbac.authorization.k8s.io/v1alpha1:ClusterRolePatch", 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 ClusterRolePatch resources. 75 type clusterRolePatchState struct { 76 } 77 78 type ClusterRolePatchState struct { 79 } 80 81 func (ClusterRolePatchState) ElementType() reflect.Type { 82 return reflect.TypeOf((*clusterRolePatchState)(nil)).Elem() 83 } 84 85 type clusterRolePatchArgs struct { 86 // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller. 87 AggregationRule *AggregationRulePatch `pulumi:"aggregationRule"` 88 // 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 89 ApiVersion *string `pulumi:"apiVersion"` 90 // 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 91 Kind *string `pulumi:"kind"` 92 // Standard object's metadata. 93 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 94 // Rules holds all the PolicyRules for this ClusterRole 95 Rules []PolicyRulePatch `pulumi:"rules"` 96 } 97 98 // The set of arguments for constructing a ClusterRolePatch resource. 99 type ClusterRolePatchArgs struct { 100 // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller. 101 AggregationRule AggregationRulePatchPtrInput 102 // 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 103 ApiVersion pulumi.StringPtrInput 104 // 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 105 Kind pulumi.StringPtrInput 106 // Standard object's metadata. 107 Metadata metav1.ObjectMetaPatchPtrInput 108 // Rules holds all the PolicyRules for this ClusterRole 109 Rules PolicyRulePatchArrayInput 110 } 111 112 func (ClusterRolePatchArgs) ElementType() reflect.Type { 113 return reflect.TypeOf((*clusterRolePatchArgs)(nil)).Elem() 114 } 115 116 type ClusterRolePatchInput interface { 117 pulumi.Input 118 119 ToClusterRolePatchOutput() ClusterRolePatchOutput 120 ToClusterRolePatchOutputWithContext(ctx context.Context) ClusterRolePatchOutput 121 } 122 123 func (*ClusterRolePatch) ElementType() reflect.Type { 124 return reflect.TypeOf((**ClusterRolePatch)(nil)).Elem() 125 } 126 127 func (i *ClusterRolePatch) ToClusterRolePatchOutput() ClusterRolePatchOutput { 128 return i.ToClusterRolePatchOutputWithContext(context.Background()) 129 } 130 131 func (i *ClusterRolePatch) ToClusterRolePatchOutputWithContext(ctx context.Context) ClusterRolePatchOutput { 132 return pulumi.ToOutputWithContext(ctx, i).(ClusterRolePatchOutput) 133 } 134 135 // ClusterRolePatchArrayInput is an input type that accepts ClusterRolePatchArray and ClusterRolePatchArrayOutput values. 136 // You can construct a concrete instance of `ClusterRolePatchArrayInput` via: 137 // 138 // ClusterRolePatchArray{ ClusterRolePatchArgs{...} } 139 type ClusterRolePatchArrayInput interface { 140 pulumi.Input 141 142 ToClusterRolePatchArrayOutput() ClusterRolePatchArrayOutput 143 ToClusterRolePatchArrayOutputWithContext(context.Context) ClusterRolePatchArrayOutput 144 } 145 146 type ClusterRolePatchArray []ClusterRolePatchInput 147 148 func (ClusterRolePatchArray) ElementType() reflect.Type { 149 return reflect.TypeOf((*[]*ClusterRolePatch)(nil)).Elem() 150 } 151 152 func (i ClusterRolePatchArray) ToClusterRolePatchArrayOutput() ClusterRolePatchArrayOutput { 153 return i.ToClusterRolePatchArrayOutputWithContext(context.Background()) 154 } 155 156 func (i ClusterRolePatchArray) ToClusterRolePatchArrayOutputWithContext(ctx context.Context) ClusterRolePatchArrayOutput { 157 return pulumi.ToOutputWithContext(ctx, i).(ClusterRolePatchArrayOutput) 158 } 159 160 // ClusterRolePatchMapInput is an input type that accepts ClusterRolePatchMap and ClusterRolePatchMapOutput values. 161 // You can construct a concrete instance of `ClusterRolePatchMapInput` via: 162 // 163 // ClusterRolePatchMap{ "key": ClusterRolePatchArgs{...} } 164 type ClusterRolePatchMapInput interface { 165 pulumi.Input 166 167 ToClusterRolePatchMapOutput() ClusterRolePatchMapOutput 168 ToClusterRolePatchMapOutputWithContext(context.Context) ClusterRolePatchMapOutput 169 } 170 171 type ClusterRolePatchMap map[string]ClusterRolePatchInput 172 173 func (ClusterRolePatchMap) ElementType() reflect.Type { 174 return reflect.TypeOf((*map[string]*ClusterRolePatch)(nil)).Elem() 175 } 176 177 func (i ClusterRolePatchMap) ToClusterRolePatchMapOutput() ClusterRolePatchMapOutput { 178 return i.ToClusterRolePatchMapOutputWithContext(context.Background()) 179 } 180 181 func (i ClusterRolePatchMap) ToClusterRolePatchMapOutputWithContext(ctx context.Context) ClusterRolePatchMapOutput { 182 return pulumi.ToOutputWithContext(ctx, i).(ClusterRolePatchMapOutput) 183 } 184 185 type ClusterRolePatchOutput struct{ *pulumi.OutputState } 186 187 func (ClusterRolePatchOutput) ElementType() reflect.Type { 188 return reflect.TypeOf((**ClusterRolePatch)(nil)).Elem() 189 } 190 191 func (o ClusterRolePatchOutput) ToClusterRolePatchOutput() ClusterRolePatchOutput { 192 return o 193 } 194 195 func (o ClusterRolePatchOutput) ToClusterRolePatchOutputWithContext(ctx context.Context) ClusterRolePatchOutput { 196 return o 197 } 198 199 // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller. 200 func (o ClusterRolePatchOutput) AggregationRule() AggregationRulePatchPtrOutput { 201 return o.ApplyT(func(v *ClusterRolePatch) AggregationRulePatchPtrOutput { return v.AggregationRule }).(AggregationRulePatchPtrOutput) 202 } 203 204 // 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 205 func (o ClusterRolePatchOutput) ApiVersion() pulumi.StringPtrOutput { 206 return o.ApplyT(func(v *ClusterRolePatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 207 } 208 209 // 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 210 func (o ClusterRolePatchOutput) Kind() pulumi.StringPtrOutput { 211 return o.ApplyT(func(v *ClusterRolePatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 212 } 213 214 // Standard object's metadata. 215 func (o ClusterRolePatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 216 return o.ApplyT(func(v *ClusterRolePatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 217 } 218 219 // Rules holds all the PolicyRules for this ClusterRole 220 func (o ClusterRolePatchOutput) Rules() PolicyRulePatchArrayOutput { 221 return o.ApplyT(func(v *ClusterRolePatch) PolicyRulePatchArrayOutput { return v.Rules }).(PolicyRulePatchArrayOutput) 222 } 223 224 type ClusterRolePatchArrayOutput struct{ *pulumi.OutputState } 225 226 func (ClusterRolePatchArrayOutput) ElementType() reflect.Type { 227 return reflect.TypeOf((*[]*ClusterRolePatch)(nil)).Elem() 228 } 229 230 func (o ClusterRolePatchArrayOutput) ToClusterRolePatchArrayOutput() ClusterRolePatchArrayOutput { 231 return o 232 } 233 234 func (o ClusterRolePatchArrayOutput) ToClusterRolePatchArrayOutputWithContext(ctx context.Context) ClusterRolePatchArrayOutput { 235 return o 236 } 237 238 func (o ClusterRolePatchArrayOutput) Index(i pulumi.IntInput) ClusterRolePatchOutput { 239 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterRolePatch { 240 return vs[0].([]*ClusterRolePatch)[vs[1].(int)] 241 }).(ClusterRolePatchOutput) 242 } 243 244 type ClusterRolePatchMapOutput struct{ *pulumi.OutputState } 245 246 func (ClusterRolePatchMapOutput) ElementType() reflect.Type { 247 return reflect.TypeOf((*map[string]*ClusterRolePatch)(nil)).Elem() 248 } 249 250 func (o ClusterRolePatchMapOutput) ToClusterRolePatchMapOutput() ClusterRolePatchMapOutput { 251 return o 252 } 253 254 func (o ClusterRolePatchMapOutput) ToClusterRolePatchMapOutputWithContext(ctx context.Context) ClusterRolePatchMapOutput { 255 return o 256 } 257 258 func (o ClusterRolePatchMapOutput) MapIndex(k pulumi.StringInput) ClusterRolePatchOutput { 259 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterRolePatch { 260 return vs[0].(map[string]*ClusterRolePatch)[vs[1].(string)] 261 }).(ClusterRolePatchOutput) 262 } 263 264 func init() { 265 pulumi.RegisterInputType(reflect.TypeOf((*ClusterRolePatchInput)(nil)).Elem(), &ClusterRolePatch{}) 266 pulumi.RegisterInputType(reflect.TypeOf((*ClusterRolePatchArrayInput)(nil)).Elem(), ClusterRolePatchArray{}) 267 pulumi.RegisterInputType(reflect.TypeOf((*ClusterRolePatchMapInput)(nil)).Elem(), ClusterRolePatchMap{}) 268 pulumi.RegisterOutputType(ClusterRolePatchOutput{}) 269 pulumi.RegisterOutputType(ClusterRolePatchArrayOutput{}) 270 pulumi.RegisterOutputType(ClusterRolePatchMapOutput{}) 271 }