pulumi-kubernetes 4.19.0a1733937243__py3-none-any.whl → 4.19.0a1733970382__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pulumi-kubernetes might be problematic. Click here for more details.

Files changed (87) hide show
  1. pulumi_kubernetes/__init__.py +36 -0
  2. pulumi_kubernetes/admissionregistration/v1/_inputs.py +6 -6
  3. pulumi_kubernetes/admissionregistration/v1/outputs.py +4 -4
  4. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicy.py +214 -0
  5. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBinding.py +222 -0
  6. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBindingList.py +215 -0
  7. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBindingPatch.py +234 -0
  8. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyList.py +215 -0
  9. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyPatch.py +226 -0
  10. pulumi_kubernetes/admissionregistration/v1alpha1/ValidatingAdmissionPolicyBinding.py +0 -8
  11. pulumi_kubernetes/admissionregistration/v1alpha1/ValidatingAdmissionPolicyBindingPatch.py +0 -8
  12. pulumi_kubernetes/admissionregistration/v1alpha1/__init__.py +6 -0
  13. pulumi_kubernetes/admissionregistration/v1alpha1/_inputs.py +1818 -315
  14. pulumi_kubernetes/admissionregistration/v1alpha1/outputs.py +1365 -246
  15. pulumi_kubernetes/admissionregistration/v1beta1/_inputs.py +6 -6
  16. pulumi_kubernetes/admissionregistration/v1beta1/outputs.py +4 -4
  17. pulumi_kubernetes/apiextensions/v1/_inputs.py +6 -6
  18. pulumi_kubernetes/apiextensions/v1/outputs.py +4 -4
  19. pulumi_kubernetes/apps/v1/_inputs.py +6 -6
  20. pulumi_kubernetes/apps/v1/outputs.py +4 -4
  21. pulumi_kubernetes/autoscaling/v2/_inputs.py +15 -15
  22. pulumi_kubernetes/autoscaling/v2/outputs.py +12 -12
  23. pulumi_kubernetes/batch/v1/_inputs.py +6 -6
  24. pulumi_kubernetes/batch/v1/outputs.py +4 -4
  25. pulumi_kubernetes/coordination/__init__.py +3 -0
  26. pulumi_kubernetes/coordination/v1alpha1/LeaseCandidate.py +2 -0
  27. pulumi_kubernetes/coordination/v1alpha1/LeaseCandidatePatch.py +2 -0
  28. pulumi_kubernetes/coordination/v1alpha2/LeaseCandidate.py +216 -0
  29. pulumi_kubernetes/coordination/v1alpha2/LeaseCandidateList.py +215 -0
  30. pulumi_kubernetes/coordination/v1alpha2/LeaseCandidatePatch.py +228 -0
  31. pulumi_kubernetes/coordination/v1alpha2/__init__.py +12 -0
  32. pulumi_kubernetes/coordination/v1alpha2/_inputs.py +393 -0
  33. pulumi_kubernetes/coordination/v1alpha2/outputs.py +313 -0
  34. pulumi_kubernetes/core/v1/Binding.py +2 -2
  35. pulumi_kubernetes/core/v1/BindingPatch.py +2 -2
  36. pulumi_kubernetes/core/v1/ServiceAccount.py +4 -4
  37. pulumi_kubernetes/core/v1/ServiceAccountPatch.py +4 -4
  38. pulumi_kubernetes/core/v1/_inputs.py +564 -313
  39. pulumi_kubernetes/core/v1/outputs.py +418 -230
  40. pulumi_kubernetes/flowcontrol/v1beta3/_inputs.py +12 -12
  41. pulumi_kubernetes/flowcontrol/v1beta3/outputs.py +8 -8
  42. pulumi_kubernetes/pulumi-plugin.json +1 -1
  43. pulumi_kubernetes/resource/__init__.py +3 -0
  44. pulumi_kubernetes/resource/v1alpha1/ResourceClaim.py +1 -1
  45. pulumi_kubernetes/resource/v1alpha1/ResourceClaimPatch.py +1 -1
  46. pulumi_kubernetes/resource/v1alpha1/ResourceClaimTemplate.py +1 -1
  47. pulumi_kubernetes/resource/v1alpha1/ResourceClaimTemplatePatch.py +1 -1
  48. pulumi_kubernetes/resource/v1alpha2/ResourceClaim.py +1 -1
  49. pulumi_kubernetes/resource/v1alpha2/ResourceClaimPatch.py +1 -1
  50. pulumi_kubernetes/resource/v1alpha2/ResourceClaimTemplate.py +1 -1
  51. pulumi_kubernetes/resource/v1alpha2/ResourceClaimTemplatePatch.py +1 -1
  52. pulumi_kubernetes/resource/v1alpha2/ResourceSlice.py +1 -1
  53. pulumi_kubernetes/resource/v1alpha2/ResourceSlicePatch.py +1 -1
  54. pulumi_kubernetes/resource/v1alpha3/DeviceClass.py +2 -0
  55. pulumi_kubernetes/resource/v1alpha3/DeviceClassPatch.py +2 -0
  56. pulumi_kubernetes/resource/v1alpha3/ResourceClaim.py +1 -1
  57. pulumi_kubernetes/resource/v1alpha3/ResourceClaimPatch.py +1 -1
  58. pulumi_kubernetes/resource/v1alpha3/ResourceClaimTemplate.py +1 -1
  59. pulumi_kubernetes/resource/v1alpha3/ResourceClaimTemplatePatch.py +1 -1
  60. pulumi_kubernetes/resource/v1alpha3/ResourceSlice.py +8 -8
  61. pulumi_kubernetes/resource/v1alpha3/ResourceSliceList.py +245 -0
  62. pulumi_kubernetes/resource/v1alpha3/ResourceSlicePatch.py +1 -1
  63. pulumi_kubernetes/resource/v1alpha3/__init__.py +1 -0
  64. pulumi_kubernetes/resource/v1alpha3/_inputs.py +455 -7
  65. pulumi_kubernetes/resource/v1alpha3/outputs.py +592 -5
  66. pulumi_kubernetes/resource/v1beta1/DeviceClass.py +237 -0
  67. pulumi_kubernetes/resource/v1beta1/DeviceClassList.py +215 -0
  68. pulumi_kubernetes/resource/v1beta1/DeviceClassPatch.py +248 -0
  69. pulumi_kubernetes/resource/v1beta1/ResourceClaim.py +232 -0
  70. pulumi_kubernetes/resource/v1beta1/ResourceClaimList.py +216 -0
  71. pulumi_kubernetes/resource/v1beta1/ResourceClaimPatch.py +243 -0
  72. pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplate.py +229 -0
  73. pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplateList.py +215 -0
  74. pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplatePatch.py +240 -0
  75. pulumi_kubernetes/resource/v1beta1/ResourceSlice.py +246 -0
  76. pulumi_kubernetes/resource/v1beta1/ResourceSliceList.py +216 -0
  77. pulumi_kubernetes/resource/v1beta1/ResourceSlicePatch.py +257 -0
  78. pulumi_kubernetes/resource/v1beta1/__init__.py +21 -0
  79. pulumi_kubernetes/resource/v1beta1/_inputs.py +3867 -0
  80. pulumi_kubernetes/resource/v1beta1/outputs.py +3334 -0
  81. pulumi_kubernetes/storage/v1/_inputs.py +4 -4
  82. pulumi_kubernetes/storage/v1/outputs.py +4 -4
  83. pulumi_kubernetes/yaml/yaml.py +90 -0
  84. {pulumi_kubernetes-4.19.0a1733937243.dist-info → pulumi_kubernetes-4.19.0a1733970382.dist-info}/METADATA +1 -1
  85. {pulumi_kubernetes-4.19.0a1733937243.dist-info → pulumi_kubernetes-4.19.0a1733970382.dist-info}/RECORD +87 -59
  86. {pulumi_kubernetes-4.19.0a1733937243.dist-info → pulumi_kubernetes-4.19.0a1733970382.dist-info}/WHEEL +0 -0
  87. {pulumi_kubernetes-4.19.0a1733937243.dist-info → pulumi_kubernetes-4.19.0a1733970382.dist-info}/top_level.txt +0 -0
@@ -16,12 +16,20 @@ from ... import _utilities
16
16
  from ... import meta as _meta
17
17
 
18
18
  __all__ = [
19
+ 'ApplyConfigurationPatchArgs',
20
+ 'ApplyConfigurationPatchArgsDict',
21
+ 'ApplyConfigurationArgs',
22
+ 'ApplyConfigurationArgsDict',
19
23
  'AuditAnnotationPatchArgs',
20
24
  'AuditAnnotationPatchArgsDict',
21
25
  'AuditAnnotationArgs',
22
26
  'AuditAnnotationArgsDict',
23
27
  'ExpressionWarningArgs',
24
28
  'ExpressionWarningArgsDict',
29
+ 'JSONPatchPatchArgs',
30
+ 'JSONPatchPatchArgsDict',
31
+ 'JSONPatchArgs',
32
+ 'JSONPatchArgsDict',
25
33
  'MatchConditionPatchArgs',
26
34
  'MatchConditionPatchArgsDict',
27
35
  'MatchConditionArgs',
@@ -30,6 +38,22 @@ __all__ = [
30
38
  'MatchResourcesPatchArgsDict',
31
39
  'MatchResourcesArgs',
32
40
  'MatchResourcesArgsDict',
41
+ 'MutatingAdmissionPolicyBindingSpecPatchArgs',
42
+ 'MutatingAdmissionPolicyBindingSpecPatchArgsDict',
43
+ 'MutatingAdmissionPolicyBindingSpecArgs',
44
+ 'MutatingAdmissionPolicyBindingSpecArgsDict',
45
+ 'MutatingAdmissionPolicyBindingArgs',
46
+ 'MutatingAdmissionPolicyBindingArgsDict',
47
+ 'MutatingAdmissionPolicySpecPatchArgs',
48
+ 'MutatingAdmissionPolicySpecPatchArgsDict',
49
+ 'MutatingAdmissionPolicySpecArgs',
50
+ 'MutatingAdmissionPolicySpecArgsDict',
51
+ 'MutatingAdmissionPolicyArgs',
52
+ 'MutatingAdmissionPolicyArgsDict',
53
+ 'MutationPatchArgs',
54
+ 'MutationPatchArgsDict',
55
+ 'MutationArgs',
56
+ 'MutationArgsDict',
33
57
  'NamedRuleWithOperationsPatchArgs',
34
58
  'NamedRuleWithOperationsPatchArgsDict',
35
59
  'NamedRuleWithOperationsArgs',
@@ -70,6 +94,240 @@ __all__ = [
70
94
 
71
95
  MYPY = False
72
96
 
97
+ if not MYPY:
98
+ class ApplyConfigurationPatchArgsDict(TypedDict):
99
+ """
100
+ ApplyConfiguration defines the desired configuration values of an object.
101
+ """
102
+ expression: NotRequired[pulumi.Input[str]]
103
+ """
104
+ expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
105
+
106
+ Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
107
+
108
+ Object{
109
+ spec: Object.spec{
110
+ serviceAccountName: "example"
111
+ }
112
+ }
113
+
114
+ Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
115
+
116
+ CEL expressions have access to the object types needed to create apply configurations:
117
+
118
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
119
+
120
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
121
+
122
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
123
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
124
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
125
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
126
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
127
+ request resource.
128
+
129
+ The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
130
+
131
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
132
+ """
133
+ elif False:
134
+ ApplyConfigurationPatchArgsDict: TypeAlias = Mapping[str, Any]
135
+
136
+ @pulumi.input_type
137
+ class ApplyConfigurationPatchArgs:
138
+ def __init__(__self__, *,
139
+ expression: Optional[pulumi.Input[str]] = None):
140
+ """
141
+ ApplyConfiguration defines the desired configuration values of an object.
142
+ :param pulumi.Input[str] expression: expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
143
+
144
+ Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
145
+
146
+ Object{
147
+ spec: Object.spec{
148
+ serviceAccountName: "example"
149
+ }
150
+ }
151
+
152
+ Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
153
+
154
+ CEL expressions have access to the object types needed to create apply configurations:
155
+
156
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
157
+
158
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
159
+
160
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
161
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
162
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
163
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
164
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
165
+ request resource.
166
+
167
+ The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
168
+
169
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
170
+ """
171
+ if expression is not None:
172
+ pulumi.set(__self__, "expression", expression)
173
+
174
+ @property
175
+ @pulumi.getter
176
+ def expression(self) -> Optional[pulumi.Input[str]]:
177
+ """
178
+ expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
179
+
180
+ Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
181
+
182
+ Object{
183
+ spec: Object.spec{
184
+ serviceAccountName: "example"
185
+ }
186
+ }
187
+
188
+ Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
189
+
190
+ CEL expressions have access to the object types needed to create apply configurations:
191
+
192
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
193
+
194
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
195
+
196
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
197
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
198
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
199
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
200
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
201
+ request resource.
202
+
203
+ The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
204
+
205
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
206
+ """
207
+ return pulumi.get(self, "expression")
208
+
209
+ @expression.setter
210
+ def expression(self, value: Optional[pulumi.Input[str]]):
211
+ pulumi.set(self, "expression", value)
212
+
213
+
214
+ if not MYPY:
215
+ class ApplyConfigurationArgsDict(TypedDict):
216
+ """
217
+ ApplyConfiguration defines the desired configuration values of an object.
218
+ """
219
+ expression: NotRequired[pulumi.Input[str]]
220
+ """
221
+ expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
222
+
223
+ Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
224
+
225
+ Object{
226
+ spec: Object.spec{
227
+ serviceAccountName: "example"
228
+ }
229
+ }
230
+
231
+ Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
232
+
233
+ CEL expressions have access to the object types needed to create apply configurations:
234
+
235
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
236
+
237
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
238
+
239
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
240
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
241
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
242
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
243
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
244
+ request resource.
245
+
246
+ The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
247
+
248
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
249
+ """
250
+ elif False:
251
+ ApplyConfigurationArgsDict: TypeAlias = Mapping[str, Any]
252
+
253
+ @pulumi.input_type
254
+ class ApplyConfigurationArgs:
255
+ def __init__(__self__, *,
256
+ expression: Optional[pulumi.Input[str]] = None):
257
+ """
258
+ ApplyConfiguration defines the desired configuration values of an object.
259
+ :param pulumi.Input[str] expression: expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
260
+
261
+ Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
262
+
263
+ Object{
264
+ spec: Object.spec{
265
+ serviceAccountName: "example"
266
+ }
267
+ }
268
+
269
+ Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
270
+
271
+ CEL expressions have access to the object types needed to create apply configurations:
272
+
273
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
274
+
275
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
276
+
277
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
278
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
279
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
280
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
281
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
282
+ request resource.
283
+
284
+ The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
285
+
286
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
287
+ """
288
+ if expression is not None:
289
+ pulumi.set(__self__, "expression", expression)
290
+
291
+ @property
292
+ @pulumi.getter
293
+ def expression(self) -> Optional[pulumi.Input[str]]:
294
+ """
295
+ expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
296
+
297
+ Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
298
+
299
+ Object{
300
+ spec: Object.spec{
301
+ serviceAccountName: "example"
302
+ }
303
+ }
304
+
305
+ Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of values not included in the apply configuration.
306
+
307
+ CEL expressions have access to the object types needed to create apply configurations:
308
+
309
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
310
+
311
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
312
+
313
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
314
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
315
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
316
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
317
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
318
+ request resource.
319
+
320
+ The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
321
+
322
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
323
+ """
324
+ return pulumi.get(self, "expression")
325
+
326
+ @expression.setter
327
+ def expression(self, value: Optional[pulumi.Input[str]]):
328
+ pulumi.set(self, "expression", value)
329
+
330
+
73
331
  if not MYPY:
74
332
  class AuditAnnotationPatchArgsDict(TypedDict):
75
333
  """
@@ -295,65 +553,192 @@ class ExpressionWarningArgs:
295
553
 
296
554
 
297
555
  if not MYPY:
298
- class MatchConditionPatchArgsDict(TypedDict):
556
+ class JSONPatchPatchArgsDict(TypedDict):
557
+ """
558
+ JSONPatch defines a JSON Patch.
559
+ """
299
560
  expression: NotRequired[pulumi.Input[str]]
300
561
  """
301
- Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
562
+ expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
302
563
 
303
- 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
564
+ expression must return an array of JSONPatch values.
565
+
566
+ For example, this CEL expression returns a JSON patch to conditionally modify a value:
567
+
568
+ [
569
+ JSONPatch{op: "test", path: "/spec/example", value: "Red"},
570
+ JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
571
+ ]
572
+
573
+ To define an object for the patch value, use Object types. For example:
574
+
575
+ [
576
+ JSONPatch{
577
+ op: "add",
578
+ path: "/spec/selector",
579
+ value: Object.spec.selector{matchLabels: {"environment": "test"}}
580
+ }
581
+ ]
582
+
583
+ To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
584
+
585
+ [
586
+ JSONPatch{
587
+ op: "add",
588
+ path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
589
+ value: "test"
590
+ },
591
+ ]
592
+
593
+ CEL expressions have access to the types needed to create JSON patches and objects:
594
+
595
+ - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
596
+ See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
597
+ integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
598
+ [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
599
+ function may be used to escape path keys containing '/' and '~'.
600
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
601
+
602
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
603
+
604
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
605
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
606
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
304
607
  See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
305
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
608
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
306
609
  request resource.
307
- Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
308
610
 
309
- Required.
310
- """
311
- name: NotRequired[pulumi.Input[str]]
312
- """
313
- Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
611
+ CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
314
612
 
315
- Required.
613
+ - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
614
+
615
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
316
616
  """
317
617
  elif False:
318
- MatchConditionPatchArgsDict: TypeAlias = Mapping[str, Any]
618
+ JSONPatchPatchArgsDict: TypeAlias = Mapping[str, Any]
319
619
 
320
620
  @pulumi.input_type
321
- class MatchConditionPatchArgs:
621
+ class JSONPatchPatchArgs:
322
622
  def __init__(__self__, *,
323
- expression: Optional[pulumi.Input[str]] = None,
324
- name: Optional[pulumi.Input[str]] = None):
623
+ expression: Optional[pulumi.Input[str]] = None):
325
624
  """
326
- :param pulumi.Input[str] expression: Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
625
+ JSONPatch defines a JSON Patch.
626
+ :param pulumi.Input[str] expression: expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
327
627
 
328
- 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
628
+ expression must return an array of JSONPatch values.
629
+
630
+ For example, this CEL expression returns a JSON patch to conditionally modify a value:
631
+
632
+ [
633
+ JSONPatch{op: "test", path: "/spec/example", value: "Red"},
634
+ JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
635
+ ]
636
+
637
+ To define an object for the patch value, use Object types. For example:
638
+
639
+ [
640
+ JSONPatch{
641
+ op: "add",
642
+ path: "/spec/selector",
643
+ value: Object.spec.selector{matchLabels: {"environment": "test"}}
644
+ }
645
+ ]
646
+
647
+ To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
648
+
649
+ [
650
+ JSONPatch{
651
+ op: "add",
652
+ path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
653
+ value: "test"
654
+ },
655
+ ]
656
+
657
+ CEL expressions have access to the types needed to create JSON patches and objects:
658
+
659
+ - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
660
+ See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
661
+ integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
662
+ [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
663
+ function may be used to escape path keys containing '/' and '~'.
664
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
665
+
666
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
667
+
668
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
669
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
670
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
329
671
  See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
330
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
672
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
331
673
  request resource.
332
- Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
333
674
 
334
- Required.
335
- :param pulumi.Input[str] name: Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
675
+ CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
336
676
 
337
- Required.
677
+ - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
678
+
679
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
338
680
  """
339
681
  if expression is not None:
340
682
  pulumi.set(__self__, "expression", expression)
341
- if name is not None:
342
- pulumi.set(__self__, "name", name)
343
683
 
344
684
  @property
345
685
  @pulumi.getter
346
686
  def expression(self) -> Optional[pulumi.Input[str]]:
347
687
  """
348
- Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
688
+ expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
349
689
 
350
- 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
690
+ expression must return an array of JSONPatch values.
691
+
692
+ For example, this CEL expression returns a JSON patch to conditionally modify a value:
693
+
694
+ [
695
+ JSONPatch{op: "test", path: "/spec/example", value: "Red"},
696
+ JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
697
+ ]
698
+
699
+ To define an object for the patch value, use Object types. For example:
700
+
701
+ [
702
+ JSONPatch{
703
+ op: "add",
704
+ path: "/spec/selector",
705
+ value: Object.spec.selector{matchLabels: {"environment": "test"}}
706
+ }
707
+ ]
708
+
709
+ To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
710
+
711
+ [
712
+ JSONPatch{
713
+ op: "add",
714
+ path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
715
+ value: "test"
716
+ },
717
+ ]
718
+
719
+ CEL expressions have access to the types needed to create JSON patches and objects:
720
+
721
+ - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
722
+ See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
723
+ integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
724
+ [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
725
+ function may be used to escape path keys containing '/' and '~'.
726
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
727
+
728
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
729
+
730
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
731
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
732
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
351
733
  See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
352
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
734
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
353
735
  request resource.
354
- Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
355
736
 
356
- Required.
737
+ CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
738
+
739
+ - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
740
+
741
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
357
742
  """
358
743
  return pulumi.get(self, "expression")
359
744
 
@@ -361,38 +746,301 @@ class MatchConditionPatchArgs:
361
746
  def expression(self, value: Optional[pulumi.Input[str]]):
362
747
  pulumi.set(self, "expression", value)
363
748
 
364
- @property
365
- @pulumi.getter
366
- def name(self) -> Optional[pulumi.Input[str]]:
367
- """
368
- Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
369
749
 
370
- Required.
750
+ if not MYPY:
751
+ class JSONPatchArgsDict(TypedDict):
371
752
  """
372
- return pulumi.get(self, "name")
753
+ JSONPatch defines a JSON Patch.
754
+ """
755
+ expression: NotRequired[pulumi.Input[str]]
756
+ """
757
+ expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
373
758
 
374
- @name.setter
375
- def name(self, value: Optional[pulumi.Input[str]]):
376
- pulumi.set(self, "name", value)
759
+ expression must return an array of JSONPatch values.
377
760
 
761
+ For example, this CEL expression returns a JSON patch to conditionally modify a value:
378
762
 
379
- if not MYPY:
380
- class MatchConditionArgsDict(TypedDict):
381
- expression: pulumi.Input[str]
382
- """
383
- Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
763
+ [
764
+ JSONPatch{op: "test", path: "/spec/example", value: "Red"},
765
+ JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
766
+ ]
384
767
 
385
- 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
386
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
387
- 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
388
- request resource.
389
- Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
768
+ To define an object for the patch value, use Object types. For example:
390
769
 
391
- Required.
392
- """
393
- name: pulumi.Input[str]
394
- """
395
- Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
770
+ [
771
+ JSONPatch{
772
+ op: "add",
773
+ path: "/spec/selector",
774
+ value: Object.spec.selector{matchLabels: {"environment": "test"}}
775
+ }
776
+ ]
777
+
778
+ To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
779
+
780
+ [
781
+ JSONPatch{
782
+ op: "add",
783
+ path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
784
+ value: "test"
785
+ },
786
+ ]
787
+
788
+ CEL expressions have access to the types needed to create JSON patches and objects:
789
+
790
+ - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
791
+ See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
792
+ integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
793
+ [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
794
+ function may be used to escape path keys containing '/' and '~'.
795
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
796
+
797
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
798
+
799
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
800
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
801
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
802
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
803
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
804
+ request resource.
805
+
806
+ CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
807
+
808
+ - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
809
+
810
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
811
+ """
812
+ elif False:
813
+ JSONPatchArgsDict: TypeAlias = Mapping[str, Any]
814
+
815
+ @pulumi.input_type
816
+ class JSONPatchArgs:
817
+ def __init__(__self__, *,
818
+ expression: Optional[pulumi.Input[str]] = None):
819
+ """
820
+ JSONPatch defines a JSON Patch.
821
+ :param pulumi.Input[str] expression: expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
822
+
823
+ expression must return an array of JSONPatch values.
824
+
825
+ For example, this CEL expression returns a JSON patch to conditionally modify a value:
826
+
827
+ [
828
+ JSONPatch{op: "test", path: "/spec/example", value: "Red"},
829
+ JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
830
+ ]
831
+
832
+ To define an object for the patch value, use Object types. For example:
833
+
834
+ [
835
+ JSONPatch{
836
+ op: "add",
837
+ path: "/spec/selector",
838
+ value: Object.spec.selector{matchLabels: {"environment": "test"}}
839
+ }
840
+ ]
841
+
842
+ To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
843
+
844
+ [
845
+ JSONPatch{
846
+ op: "add",
847
+ path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
848
+ value: "test"
849
+ },
850
+ ]
851
+
852
+ CEL expressions have access to the types needed to create JSON patches and objects:
853
+
854
+ - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
855
+ See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
856
+ integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
857
+ [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
858
+ function may be used to escape path keys containing '/' and '~'.
859
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
860
+
861
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
862
+
863
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
864
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
865
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
866
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
867
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
868
+ request resource.
869
+
870
+ CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
871
+
872
+ - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
873
+
874
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
875
+ """
876
+ if expression is not None:
877
+ pulumi.set(__self__, "expression", expression)
878
+
879
+ @property
880
+ @pulumi.getter
881
+ def expression(self) -> Optional[pulumi.Input[str]]:
882
+ """
883
+ expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
884
+
885
+ expression must return an array of JSONPatch values.
886
+
887
+ For example, this CEL expression returns a JSON patch to conditionally modify a value:
888
+
889
+ [
890
+ JSONPatch{op: "test", path: "/spec/example", value: "Red"},
891
+ JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
892
+ ]
893
+
894
+ To define an object for the patch value, use Object types. For example:
895
+
896
+ [
897
+ JSONPatch{
898
+ op: "add",
899
+ path: "/spec/selector",
900
+ value: Object.spec.selector{matchLabels: {"environment": "test"}}
901
+ }
902
+ ]
903
+
904
+ To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
905
+
906
+ [
907
+ JSONPatch{
908
+ op: "add",
909
+ path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
910
+ value: "test"
911
+ },
912
+ ]
913
+
914
+ CEL expressions have access to the types needed to create JSON patches and objects:
915
+
916
+ - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
917
+ See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
918
+ integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
919
+ [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
920
+ function may be used to escape path keys containing '/' and '~'.
921
+ - 'Object' - CEL type of the resource object. - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec') - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
922
+
923
+ CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
924
+
925
+ - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
926
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
927
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
928
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
929
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
930
+ request resource.
931
+
932
+ CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries) as well as:
933
+
934
+ - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
935
+
936
+ Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
937
+ """
938
+ return pulumi.get(self, "expression")
939
+
940
+ @expression.setter
941
+ def expression(self, value: Optional[pulumi.Input[str]]):
942
+ pulumi.set(self, "expression", value)
943
+
944
+
945
+ if not MYPY:
946
+ class MatchConditionPatchArgsDict(TypedDict):
947
+ expression: NotRequired[pulumi.Input[str]]
948
+ """
949
+ Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
950
+
951
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
952
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
953
+ 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
954
+ request resource.
955
+ Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
956
+
957
+ Required.
958
+ """
959
+ name: NotRequired[pulumi.Input[str]]
960
+ """
961
+ Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
962
+
963
+ Required.
964
+ """
965
+ elif False:
966
+ MatchConditionPatchArgsDict: TypeAlias = Mapping[str, Any]
967
+
968
+ @pulumi.input_type
969
+ class MatchConditionPatchArgs:
970
+ def __init__(__self__, *,
971
+ expression: Optional[pulumi.Input[str]] = None,
972
+ name: Optional[pulumi.Input[str]] = None):
973
+ """
974
+ :param pulumi.Input[str] expression: Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
975
+
976
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
977
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
978
+ 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
979
+ request resource.
980
+ Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
981
+
982
+ Required.
983
+ :param pulumi.Input[str] name: Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
984
+
985
+ Required.
986
+ """
987
+ if expression is not None:
988
+ pulumi.set(__self__, "expression", expression)
989
+ if name is not None:
990
+ pulumi.set(__self__, "name", name)
991
+
992
+ @property
993
+ @pulumi.getter
994
+ def expression(self) -> Optional[pulumi.Input[str]]:
995
+ """
996
+ Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
997
+
998
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
999
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
1000
+ 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
1001
+ request resource.
1002
+ Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
1003
+
1004
+ Required.
1005
+ """
1006
+ return pulumi.get(self, "expression")
1007
+
1008
+ @expression.setter
1009
+ def expression(self, value: Optional[pulumi.Input[str]]):
1010
+ pulumi.set(self, "expression", value)
1011
+
1012
+ @property
1013
+ @pulumi.getter
1014
+ def name(self) -> Optional[pulumi.Input[str]]:
1015
+ """
1016
+ Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
1017
+
1018
+ Required.
1019
+ """
1020
+ return pulumi.get(self, "name")
1021
+
1022
+ @name.setter
1023
+ def name(self, value: Optional[pulumi.Input[str]]):
1024
+ pulumi.set(self, "name", value)
1025
+
1026
+
1027
+ if not MYPY:
1028
+ class MatchConditionArgsDict(TypedDict):
1029
+ expression: pulumi.Input[str]
1030
+ """
1031
+ Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
1032
+
1033
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
1034
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
1035
+ 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
1036
+ request resource.
1037
+ Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
1038
+
1039
+ Required.
1040
+ """
1041
+ name: pulumi.Input[str]
1042
+ """
1043
+ Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
396
1044
 
397
1045
  Required.
398
1046
  """
@@ -716,192 +1364,1133 @@ if not MYPY:
716
1364
  ]
717
1365
  }
718
1366
 
719
- If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
720
- "matchExpressions": [
721
- {
722
- "key": "environment",
723
- "operator": "In",
724
- "values": [
725
- "prod",
726
- "staging"
727
- ]
728
- }
729
- ]
730
- }
1367
+ If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
1368
+ "matchExpressions": [
1369
+ {
1370
+ "key": "environment",
1371
+ "operator": "In",
1372
+ "values": [
1373
+ "prod",
1374
+ "staging"
1375
+ ]
1376
+ }
1377
+ ]
1378
+ }
1379
+
1380
+ See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
1381
+
1382
+ Default to the empty LabelSelector, which matches everything.
1383
+ """
1384
+ object_selector: NotRequired[pulumi.Input['_meta.v1.LabelSelectorArgsDict']]
1385
+ """
1386
+ ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
1387
+ """
1388
+ resource_rules: NotRequired[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgsDict']]]]
1389
+ """
1390
+ ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
1391
+ """
1392
+ elif False:
1393
+ MatchResourcesArgsDict: TypeAlias = Mapping[str, Any]
1394
+
1395
+ @pulumi.input_type
1396
+ class MatchResourcesArgs:
1397
+ def __init__(__self__, *,
1398
+ exclude_resource_rules: Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]] = None,
1399
+ match_policy: Optional[pulumi.Input[str]] = None,
1400
+ namespace_selector: Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']] = None,
1401
+ object_selector: Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']] = None,
1402
+ resource_rules: Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]] = None):
1403
+ """
1404
+ MatchResources decides whether to run the admission control policy on an object based on whether it meets the match criteria. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
1405
+ :param pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]] exclude_resource_rules: ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
1406
+ :param pulumi.Input[str] match_policy: matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
1407
+
1408
+ - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
1409
+
1410
+ - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
1411
+
1412
+ Defaults to "Equivalent"
1413
+ :param pulumi.Input['_meta.v1.LabelSelectorArgs'] namespace_selector: NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
1414
+
1415
+ For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
1416
+ "matchExpressions": [
1417
+ {
1418
+ "key": "runlevel",
1419
+ "operator": "NotIn",
1420
+ "values": [
1421
+ "0",
1422
+ "1"
1423
+ ]
1424
+ }
1425
+ ]
1426
+ }
1427
+
1428
+ If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
1429
+ "matchExpressions": [
1430
+ {
1431
+ "key": "environment",
1432
+ "operator": "In",
1433
+ "values": [
1434
+ "prod",
1435
+ "staging"
1436
+ ]
1437
+ }
1438
+ ]
1439
+ }
1440
+
1441
+ See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
1442
+
1443
+ Default to the empty LabelSelector, which matches everything.
1444
+ :param pulumi.Input['_meta.v1.LabelSelectorArgs'] object_selector: ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
1445
+ :param pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]] resource_rules: ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
1446
+ """
1447
+ if exclude_resource_rules is not None:
1448
+ pulumi.set(__self__, "exclude_resource_rules", exclude_resource_rules)
1449
+ if match_policy is not None:
1450
+ pulumi.set(__self__, "match_policy", match_policy)
1451
+ if namespace_selector is not None:
1452
+ pulumi.set(__self__, "namespace_selector", namespace_selector)
1453
+ if object_selector is not None:
1454
+ pulumi.set(__self__, "object_selector", object_selector)
1455
+ if resource_rules is not None:
1456
+ pulumi.set(__self__, "resource_rules", resource_rules)
1457
+
1458
+ @property
1459
+ @pulumi.getter(name="excludeResourceRules")
1460
+ def exclude_resource_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]]:
1461
+ """
1462
+ ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
1463
+ """
1464
+ return pulumi.get(self, "exclude_resource_rules")
1465
+
1466
+ @exclude_resource_rules.setter
1467
+ def exclude_resource_rules(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]]):
1468
+ pulumi.set(self, "exclude_resource_rules", value)
1469
+
1470
+ @property
1471
+ @pulumi.getter(name="matchPolicy")
1472
+ def match_policy(self) -> Optional[pulumi.Input[str]]:
1473
+ """
1474
+ matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
1475
+
1476
+ - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
1477
+
1478
+ - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
1479
+
1480
+ Defaults to "Equivalent"
1481
+ """
1482
+ return pulumi.get(self, "match_policy")
1483
+
1484
+ @match_policy.setter
1485
+ def match_policy(self, value: Optional[pulumi.Input[str]]):
1486
+ pulumi.set(self, "match_policy", value)
1487
+
1488
+ @property
1489
+ @pulumi.getter(name="namespaceSelector")
1490
+ def namespace_selector(self) -> Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]:
1491
+ """
1492
+ NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
1493
+
1494
+ For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
1495
+ "matchExpressions": [
1496
+ {
1497
+ "key": "runlevel",
1498
+ "operator": "NotIn",
1499
+ "values": [
1500
+ "0",
1501
+ "1"
1502
+ ]
1503
+ }
1504
+ ]
1505
+ }
1506
+
1507
+ If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
1508
+ "matchExpressions": [
1509
+ {
1510
+ "key": "environment",
1511
+ "operator": "In",
1512
+ "values": [
1513
+ "prod",
1514
+ "staging"
1515
+ ]
1516
+ }
1517
+ ]
1518
+ }
1519
+
1520
+ See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
1521
+
1522
+ Default to the empty LabelSelector, which matches everything.
1523
+ """
1524
+ return pulumi.get(self, "namespace_selector")
1525
+
1526
+ @namespace_selector.setter
1527
+ def namespace_selector(self, value: Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]):
1528
+ pulumi.set(self, "namespace_selector", value)
1529
+
1530
+ @property
1531
+ @pulumi.getter(name="objectSelector")
1532
+ def object_selector(self) -> Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]:
1533
+ """
1534
+ ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
1535
+ """
1536
+ return pulumi.get(self, "object_selector")
1537
+
1538
+ @object_selector.setter
1539
+ def object_selector(self, value: Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]):
1540
+ pulumi.set(self, "object_selector", value)
1541
+
1542
+ @property
1543
+ @pulumi.getter(name="resourceRules")
1544
+ def resource_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]]:
1545
+ """
1546
+ ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
1547
+ """
1548
+ return pulumi.get(self, "resource_rules")
1549
+
1550
+ @resource_rules.setter
1551
+ def resource_rules(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]]):
1552
+ pulumi.set(self, "resource_rules", value)
1553
+
1554
+
1555
+ if not MYPY:
1556
+ class MutatingAdmissionPolicyBindingSpecPatchArgsDict(TypedDict):
1557
+ """
1558
+ MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
1559
+ """
1560
+ match_resources: NotRequired[pulumi.Input['MatchResourcesPatchArgsDict']]
1561
+ """
1562
+ matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
1563
+ """
1564
+ param_ref: NotRequired[pulumi.Input['ParamRefPatchArgsDict']]
1565
+ """
1566
+ paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
1567
+ """
1568
+ policy_name: NotRequired[pulumi.Input[str]]
1569
+ """
1570
+ policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
1571
+ """
1572
+ elif False:
1573
+ MutatingAdmissionPolicyBindingSpecPatchArgsDict: TypeAlias = Mapping[str, Any]
1574
+
1575
+ @pulumi.input_type
1576
+ class MutatingAdmissionPolicyBindingSpecPatchArgs:
1577
+ def __init__(__self__, *,
1578
+ match_resources: Optional[pulumi.Input['MatchResourcesPatchArgs']] = None,
1579
+ param_ref: Optional[pulumi.Input['ParamRefPatchArgs']] = None,
1580
+ policy_name: Optional[pulumi.Input[str]] = None):
1581
+ """
1582
+ MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
1583
+ :param pulumi.Input['MatchResourcesPatchArgs'] match_resources: matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
1584
+ :param pulumi.Input['ParamRefPatchArgs'] param_ref: paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
1585
+ :param pulumi.Input[str] policy_name: policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
1586
+ """
1587
+ if match_resources is not None:
1588
+ pulumi.set(__self__, "match_resources", match_resources)
1589
+ if param_ref is not None:
1590
+ pulumi.set(__self__, "param_ref", param_ref)
1591
+ if policy_name is not None:
1592
+ pulumi.set(__self__, "policy_name", policy_name)
1593
+
1594
+ @property
1595
+ @pulumi.getter(name="matchResources")
1596
+ def match_resources(self) -> Optional[pulumi.Input['MatchResourcesPatchArgs']]:
1597
+ """
1598
+ matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
1599
+ """
1600
+ return pulumi.get(self, "match_resources")
1601
+
1602
+ @match_resources.setter
1603
+ def match_resources(self, value: Optional[pulumi.Input['MatchResourcesPatchArgs']]):
1604
+ pulumi.set(self, "match_resources", value)
1605
+
1606
+ @property
1607
+ @pulumi.getter(name="paramRef")
1608
+ def param_ref(self) -> Optional[pulumi.Input['ParamRefPatchArgs']]:
1609
+ """
1610
+ paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
1611
+ """
1612
+ return pulumi.get(self, "param_ref")
1613
+
1614
+ @param_ref.setter
1615
+ def param_ref(self, value: Optional[pulumi.Input['ParamRefPatchArgs']]):
1616
+ pulumi.set(self, "param_ref", value)
1617
+
1618
+ @property
1619
+ @pulumi.getter(name="policyName")
1620
+ def policy_name(self) -> Optional[pulumi.Input[str]]:
1621
+ """
1622
+ policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
1623
+ """
1624
+ return pulumi.get(self, "policy_name")
1625
+
1626
+ @policy_name.setter
1627
+ def policy_name(self, value: Optional[pulumi.Input[str]]):
1628
+ pulumi.set(self, "policy_name", value)
1629
+
1630
+
1631
+ if not MYPY:
1632
+ class MutatingAdmissionPolicyBindingSpecArgsDict(TypedDict):
1633
+ """
1634
+ MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
1635
+ """
1636
+ match_resources: NotRequired[pulumi.Input['MatchResourcesArgsDict']]
1637
+ """
1638
+ matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
1639
+ """
1640
+ param_ref: NotRequired[pulumi.Input['ParamRefArgsDict']]
1641
+ """
1642
+ paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
1643
+ """
1644
+ policy_name: NotRequired[pulumi.Input[str]]
1645
+ """
1646
+ policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
1647
+ """
1648
+ elif False:
1649
+ MutatingAdmissionPolicyBindingSpecArgsDict: TypeAlias = Mapping[str, Any]
1650
+
1651
+ @pulumi.input_type
1652
+ class MutatingAdmissionPolicyBindingSpecArgs:
1653
+ def __init__(__self__, *,
1654
+ match_resources: Optional[pulumi.Input['MatchResourcesArgs']] = None,
1655
+ param_ref: Optional[pulumi.Input['ParamRefArgs']] = None,
1656
+ policy_name: Optional[pulumi.Input[str]] = None):
1657
+ """
1658
+ MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
1659
+ :param pulumi.Input['MatchResourcesArgs'] match_resources: matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
1660
+ :param pulumi.Input['ParamRefArgs'] param_ref: paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
1661
+ :param pulumi.Input[str] policy_name: policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
1662
+ """
1663
+ if match_resources is not None:
1664
+ pulumi.set(__self__, "match_resources", match_resources)
1665
+ if param_ref is not None:
1666
+ pulumi.set(__self__, "param_ref", param_ref)
1667
+ if policy_name is not None:
1668
+ pulumi.set(__self__, "policy_name", policy_name)
1669
+
1670
+ @property
1671
+ @pulumi.getter(name="matchResources")
1672
+ def match_resources(self) -> Optional[pulumi.Input['MatchResourcesArgs']]:
1673
+ """
1674
+ matchResources limits what resources match this binding and may be mutated by it. Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and matchConditions before the resource may be mutated. When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints and matchConditions must match for the resource to be mutated. Additionally, matchResources.resourceRules are optional and do not constraint matching when unset. Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT.
1675
+ """
1676
+ return pulumi.get(self, "match_resources")
1677
+
1678
+ @match_resources.setter
1679
+ def match_resources(self, value: Optional[pulumi.Input['MatchResourcesArgs']]):
1680
+ pulumi.set(self, "match_resources", value)
1681
+
1682
+ @property
1683
+ @pulumi.getter(name="paramRef")
1684
+ def param_ref(self) -> Optional[pulumi.Input['ParamRefArgs']]:
1685
+ """
1686
+ paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
1687
+ """
1688
+ return pulumi.get(self, "param_ref")
1689
+
1690
+ @param_ref.setter
1691
+ def param_ref(self, value: Optional[pulumi.Input['ParamRefArgs']]):
1692
+ pulumi.set(self, "param_ref", value)
1693
+
1694
+ @property
1695
+ @pulumi.getter(name="policyName")
1696
+ def policy_name(self) -> Optional[pulumi.Input[str]]:
1697
+ """
1698
+ policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
1699
+ """
1700
+ return pulumi.get(self, "policy_name")
1701
+
1702
+ @policy_name.setter
1703
+ def policy_name(self, value: Optional[pulumi.Input[str]]):
1704
+ pulumi.set(self, "policy_name", value)
1705
+
1706
+
1707
+ if not MYPY:
1708
+ class MutatingAdmissionPolicyBindingArgsDict(TypedDict):
1709
+ """
1710
+ MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters.
1711
+
1712
+ For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).
1713
+
1714
+ Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
1715
+ """
1716
+ api_version: NotRequired[pulumi.Input[str]]
1717
+ """
1718
+ 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
1719
+ """
1720
+ kind: NotRequired[pulumi.Input[str]]
1721
+ """
1722
+ 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
1723
+ """
1724
+ metadata: NotRequired[pulumi.Input['_meta.v1.ObjectMetaArgsDict']]
1725
+ """
1726
+ Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
1727
+ """
1728
+ spec: NotRequired[pulumi.Input['MutatingAdmissionPolicyBindingSpecArgsDict']]
1729
+ """
1730
+ Specification of the desired behavior of the MutatingAdmissionPolicyBinding.
1731
+ """
1732
+ elif False:
1733
+ MutatingAdmissionPolicyBindingArgsDict: TypeAlias = Mapping[str, Any]
1734
+
1735
+ @pulumi.input_type
1736
+ class MutatingAdmissionPolicyBindingArgs:
1737
+ def __init__(__self__, *,
1738
+ api_version: Optional[pulumi.Input[str]] = None,
1739
+ kind: Optional[pulumi.Input[str]] = None,
1740
+ metadata: Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']] = None,
1741
+ spec: Optional[pulumi.Input['MutatingAdmissionPolicyBindingSpecArgs']] = None):
1742
+ """
1743
+ MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters.
1744
+
1745
+ For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).
1746
+
1747
+ Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
1748
+ :param pulumi.Input[str] api_version: 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
1749
+ :param pulumi.Input[str] kind: 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
1750
+ :param pulumi.Input['_meta.v1.ObjectMetaArgs'] metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
1751
+ :param pulumi.Input['MutatingAdmissionPolicyBindingSpecArgs'] spec: Specification of the desired behavior of the MutatingAdmissionPolicyBinding.
1752
+ """
1753
+ if api_version is not None:
1754
+ pulumi.set(__self__, "api_version", 'admissionregistration.k8s.io/v1alpha1')
1755
+ if kind is not None:
1756
+ pulumi.set(__self__, "kind", 'MutatingAdmissionPolicyBinding')
1757
+ if metadata is not None:
1758
+ pulumi.set(__self__, "metadata", metadata)
1759
+ if spec is not None:
1760
+ pulumi.set(__self__, "spec", spec)
1761
+
1762
+ @property
1763
+ @pulumi.getter(name="apiVersion")
1764
+ def api_version(self) -> Optional[pulumi.Input[str]]:
1765
+ """
1766
+ 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
1767
+ """
1768
+ return pulumi.get(self, "api_version")
1769
+
1770
+ @api_version.setter
1771
+ def api_version(self, value: Optional[pulumi.Input[str]]):
1772
+ pulumi.set(self, "api_version", value)
1773
+
1774
+ @property
1775
+ @pulumi.getter
1776
+ def kind(self) -> Optional[pulumi.Input[str]]:
1777
+ """
1778
+ 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
1779
+ """
1780
+ return pulumi.get(self, "kind")
1781
+
1782
+ @kind.setter
1783
+ def kind(self, value: Optional[pulumi.Input[str]]):
1784
+ pulumi.set(self, "kind", value)
1785
+
1786
+ @property
1787
+ @pulumi.getter
1788
+ def metadata(self) -> Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]:
1789
+ """
1790
+ Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
1791
+ """
1792
+ return pulumi.get(self, "metadata")
1793
+
1794
+ @metadata.setter
1795
+ def metadata(self, value: Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]):
1796
+ pulumi.set(self, "metadata", value)
1797
+
1798
+ @property
1799
+ @pulumi.getter
1800
+ def spec(self) -> Optional[pulumi.Input['MutatingAdmissionPolicyBindingSpecArgs']]:
1801
+ """
1802
+ Specification of the desired behavior of the MutatingAdmissionPolicyBinding.
1803
+ """
1804
+ return pulumi.get(self, "spec")
1805
+
1806
+ @spec.setter
1807
+ def spec(self, value: Optional[pulumi.Input['MutatingAdmissionPolicyBindingSpecArgs']]):
1808
+ pulumi.set(self, "spec", value)
1809
+
1810
+
1811
+ if not MYPY:
1812
+ class MutatingAdmissionPolicySpecPatchArgsDict(TypedDict):
1813
+ """
1814
+ MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
1815
+ """
1816
+ failure_policy: NotRequired[pulumi.Input[str]]
1817
+ """
1818
+ failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
1819
+
1820
+ A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
1821
+
1822
+ failurePolicy does not define how validations that evaluate to false are handled.
1823
+
1824
+ Allowed values are Ignore or Fail. Defaults to Fail.
1825
+ """
1826
+ match_conditions: NotRequired[pulumi.Input[Sequence[pulumi.Input['MatchConditionPatchArgsDict']]]]
1827
+ """
1828
+ matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
1829
+
1830
+ If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
1831
+
1832
+ The exact matching logic is (in order):
1833
+ 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
1834
+ 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
1835
+ 3. If any matchCondition evaluates to an error (but none are FALSE):
1836
+ - If failurePolicy=Fail, reject the request
1837
+ - If failurePolicy=Ignore, the policy is skipped
1838
+ """
1839
+ match_constraints: NotRequired[pulumi.Input['MatchResourcesPatchArgsDict']]
1840
+ """
1841
+ matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
1842
+ """
1843
+ mutations: NotRequired[pulumi.Input[Sequence[pulumi.Input['MutationPatchArgsDict']]]]
1844
+ """
1845
+ mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
1846
+ """
1847
+ param_kind: NotRequired[pulumi.Input['ParamKindPatchArgsDict']]
1848
+ """
1849
+ paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
1850
+ """
1851
+ reinvocation_policy: NotRequired[pulumi.Input[str]]
1852
+ """
1853
+ reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
1854
+
1855
+ Never: These mutations will not be called more than once per binding in a single admission evaluation.
1856
+
1857
+ IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
1858
+ """
1859
+ variables: NotRequired[pulumi.Input[Sequence[pulumi.Input['VariablePatchArgsDict']]]]
1860
+ """
1861
+ variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
1862
+
1863
+ The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
1864
+ """
1865
+ elif False:
1866
+ MutatingAdmissionPolicySpecPatchArgsDict: TypeAlias = Mapping[str, Any]
1867
+
1868
+ @pulumi.input_type
1869
+ class MutatingAdmissionPolicySpecPatchArgs:
1870
+ def __init__(__self__, *,
1871
+ failure_policy: Optional[pulumi.Input[str]] = None,
1872
+ match_conditions: Optional[pulumi.Input[Sequence[pulumi.Input['MatchConditionPatchArgs']]]] = None,
1873
+ match_constraints: Optional[pulumi.Input['MatchResourcesPatchArgs']] = None,
1874
+ mutations: Optional[pulumi.Input[Sequence[pulumi.Input['MutationPatchArgs']]]] = None,
1875
+ param_kind: Optional[pulumi.Input['ParamKindPatchArgs']] = None,
1876
+ reinvocation_policy: Optional[pulumi.Input[str]] = None,
1877
+ variables: Optional[pulumi.Input[Sequence[pulumi.Input['VariablePatchArgs']]]] = None):
1878
+ """
1879
+ MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
1880
+ :param pulumi.Input[str] failure_policy: failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
1881
+
1882
+ A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
1883
+
1884
+ failurePolicy does not define how validations that evaluate to false are handled.
1885
+
1886
+ Allowed values are Ignore or Fail. Defaults to Fail.
1887
+ :param pulumi.Input[Sequence[pulumi.Input['MatchConditionPatchArgs']]] match_conditions: matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
1888
+
1889
+ If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
1890
+
1891
+ The exact matching logic is (in order):
1892
+ 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
1893
+ 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
1894
+ 3. If any matchCondition evaluates to an error (but none are FALSE):
1895
+ - If failurePolicy=Fail, reject the request
1896
+ - If failurePolicy=Ignore, the policy is skipped
1897
+ :param pulumi.Input['MatchResourcesPatchArgs'] match_constraints: matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
1898
+ :param pulumi.Input[Sequence[pulumi.Input['MutationPatchArgs']]] mutations: mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
1899
+ :param pulumi.Input['ParamKindPatchArgs'] param_kind: paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
1900
+ :param pulumi.Input[str] reinvocation_policy: reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
1901
+
1902
+ Never: These mutations will not be called more than once per binding in a single admission evaluation.
1903
+
1904
+ IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
1905
+ :param pulumi.Input[Sequence[pulumi.Input['VariablePatchArgs']]] variables: variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
1906
+
1907
+ The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
1908
+ """
1909
+ if failure_policy is not None:
1910
+ pulumi.set(__self__, "failure_policy", failure_policy)
1911
+ if match_conditions is not None:
1912
+ pulumi.set(__self__, "match_conditions", match_conditions)
1913
+ if match_constraints is not None:
1914
+ pulumi.set(__self__, "match_constraints", match_constraints)
1915
+ if mutations is not None:
1916
+ pulumi.set(__self__, "mutations", mutations)
1917
+ if param_kind is not None:
1918
+ pulumi.set(__self__, "param_kind", param_kind)
1919
+ if reinvocation_policy is not None:
1920
+ pulumi.set(__self__, "reinvocation_policy", reinvocation_policy)
1921
+ if variables is not None:
1922
+ pulumi.set(__self__, "variables", variables)
1923
+
1924
+ @property
1925
+ @pulumi.getter(name="failurePolicy")
1926
+ def failure_policy(self) -> Optional[pulumi.Input[str]]:
1927
+ """
1928
+ failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
1929
+
1930
+ A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
1931
+
1932
+ failurePolicy does not define how validations that evaluate to false are handled.
1933
+
1934
+ Allowed values are Ignore or Fail. Defaults to Fail.
1935
+ """
1936
+ return pulumi.get(self, "failure_policy")
1937
+
1938
+ @failure_policy.setter
1939
+ def failure_policy(self, value: Optional[pulumi.Input[str]]):
1940
+ pulumi.set(self, "failure_policy", value)
1941
+
1942
+ @property
1943
+ @pulumi.getter(name="matchConditions")
1944
+ def match_conditions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['MatchConditionPatchArgs']]]]:
1945
+ """
1946
+ matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
1947
+
1948
+ If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
1949
+
1950
+ The exact matching logic is (in order):
1951
+ 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
1952
+ 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
1953
+ 3. If any matchCondition evaluates to an error (but none are FALSE):
1954
+ - If failurePolicy=Fail, reject the request
1955
+ - If failurePolicy=Ignore, the policy is skipped
1956
+ """
1957
+ return pulumi.get(self, "match_conditions")
1958
+
1959
+ @match_conditions.setter
1960
+ def match_conditions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['MatchConditionPatchArgs']]]]):
1961
+ pulumi.set(self, "match_conditions", value)
1962
+
1963
+ @property
1964
+ @pulumi.getter(name="matchConstraints")
1965
+ def match_constraints(self) -> Optional[pulumi.Input['MatchResourcesPatchArgs']]:
1966
+ """
1967
+ matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
1968
+ """
1969
+ return pulumi.get(self, "match_constraints")
1970
+
1971
+ @match_constraints.setter
1972
+ def match_constraints(self, value: Optional[pulumi.Input['MatchResourcesPatchArgs']]):
1973
+ pulumi.set(self, "match_constraints", value)
1974
+
1975
+ @property
1976
+ @pulumi.getter
1977
+ def mutations(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['MutationPatchArgs']]]]:
1978
+ """
1979
+ mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
1980
+ """
1981
+ return pulumi.get(self, "mutations")
1982
+
1983
+ @mutations.setter
1984
+ def mutations(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['MutationPatchArgs']]]]):
1985
+ pulumi.set(self, "mutations", value)
1986
+
1987
+ @property
1988
+ @pulumi.getter(name="paramKind")
1989
+ def param_kind(self) -> Optional[pulumi.Input['ParamKindPatchArgs']]:
1990
+ """
1991
+ paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
1992
+ """
1993
+ return pulumi.get(self, "param_kind")
1994
+
1995
+ @param_kind.setter
1996
+ def param_kind(self, value: Optional[pulumi.Input['ParamKindPatchArgs']]):
1997
+ pulumi.set(self, "param_kind", value)
1998
+
1999
+ @property
2000
+ @pulumi.getter(name="reinvocationPolicy")
2001
+ def reinvocation_policy(self) -> Optional[pulumi.Input[str]]:
2002
+ """
2003
+ reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
2004
+
2005
+ Never: These mutations will not be called more than once per binding in a single admission evaluation.
2006
+
2007
+ IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
2008
+ """
2009
+ return pulumi.get(self, "reinvocation_policy")
2010
+
2011
+ @reinvocation_policy.setter
2012
+ def reinvocation_policy(self, value: Optional[pulumi.Input[str]]):
2013
+ pulumi.set(self, "reinvocation_policy", value)
2014
+
2015
+ @property
2016
+ @pulumi.getter
2017
+ def variables(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['VariablePatchArgs']]]]:
2018
+ """
2019
+ variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
2020
+
2021
+ The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
2022
+ """
2023
+ return pulumi.get(self, "variables")
2024
+
2025
+ @variables.setter
2026
+ def variables(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['VariablePatchArgs']]]]):
2027
+ pulumi.set(self, "variables", value)
2028
+
2029
+
2030
+ if not MYPY:
2031
+ class MutatingAdmissionPolicySpecArgsDict(TypedDict):
2032
+ """
2033
+ MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
2034
+ """
2035
+ failure_policy: NotRequired[pulumi.Input[str]]
2036
+ """
2037
+ failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2038
+
2039
+ A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
2040
+
2041
+ failurePolicy does not define how validations that evaluate to false are handled.
2042
+
2043
+ Allowed values are Ignore or Fail. Defaults to Fail.
2044
+ """
2045
+ match_conditions: NotRequired[pulumi.Input[Sequence[pulumi.Input['MatchConditionArgsDict']]]]
2046
+ """
2047
+ matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
2048
+
2049
+ If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
2050
+
2051
+ The exact matching logic is (in order):
2052
+ 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
2053
+ 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
2054
+ 3. If any matchCondition evaluates to an error (but none are FALSE):
2055
+ - If failurePolicy=Fail, reject the request
2056
+ - If failurePolicy=Ignore, the policy is skipped
2057
+ """
2058
+ match_constraints: NotRequired[pulumi.Input['MatchResourcesArgsDict']]
2059
+ """
2060
+ matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
2061
+ """
2062
+ mutations: NotRequired[pulumi.Input[Sequence[pulumi.Input['MutationArgsDict']]]]
2063
+ """
2064
+ mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
2065
+ """
2066
+ param_kind: NotRequired[pulumi.Input['ParamKindArgsDict']]
2067
+ """
2068
+ paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
2069
+ """
2070
+ reinvocation_policy: NotRequired[pulumi.Input[str]]
2071
+ """
2072
+ reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
2073
+
2074
+ Never: These mutations will not be called more than once per binding in a single admission evaluation.
2075
+
2076
+ IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
2077
+ """
2078
+ variables: NotRequired[pulumi.Input[Sequence[pulumi.Input['VariableArgsDict']]]]
2079
+ """
2080
+ variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
2081
+
2082
+ The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
2083
+ """
2084
+ elif False:
2085
+ MutatingAdmissionPolicySpecArgsDict: TypeAlias = Mapping[str, Any]
2086
+
2087
+ @pulumi.input_type
2088
+ class MutatingAdmissionPolicySpecArgs:
2089
+ def __init__(__self__, *,
2090
+ failure_policy: Optional[pulumi.Input[str]] = None,
2091
+ match_conditions: Optional[pulumi.Input[Sequence[pulumi.Input['MatchConditionArgs']]]] = None,
2092
+ match_constraints: Optional[pulumi.Input['MatchResourcesArgs']] = None,
2093
+ mutations: Optional[pulumi.Input[Sequence[pulumi.Input['MutationArgs']]]] = None,
2094
+ param_kind: Optional[pulumi.Input['ParamKindArgs']] = None,
2095
+ reinvocation_policy: Optional[pulumi.Input[str]] = None,
2096
+ variables: Optional[pulumi.Input[Sequence[pulumi.Input['VariableArgs']]]] = None):
2097
+ """
2098
+ MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
2099
+ :param pulumi.Input[str] failure_policy: failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2100
+
2101
+ A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
2102
+
2103
+ failurePolicy does not define how validations that evaluate to false are handled.
2104
+
2105
+ Allowed values are Ignore or Fail. Defaults to Fail.
2106
+ :param pulumi.Input[Sequence[pulumi.Input['MatchConditionArgs']]] match_conditions: matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
2107
+
2108
+ If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
2109
+
2110
+ The exact matching logic is (in order):
2111
+ 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
2112
+ 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
2113
+ 3. If any matchCondition evaluates to an error (but none are FALSE):
2114
+ - If failurePolicy=Fail, reject the request
2115
+ - If failurePolicy=Ignore, the policy is skipped
2116
+ :param pulumi.Input['MatchResourcesArgs'] match_constraints: matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
2117
+ :param pulumi.Input[Sequence[pulumi.Input['MutationArgs']]] mutations: mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
2118
+ :param pulumi.Input['ParamKindArgs'] param_kind: paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
2119
+ :param pulumi.Input[str] reinvocation_policy: reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
2120
+
2121
+ Never: These mutations will not be called more than once per binding in a single admission evaluation.
2122
+
2123
+ IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
2124
+ :param pulumi.Input[Sequence[pulumi.Input['VariableArgs']]] variables: variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
2125
+
2126
+ The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
2127
+ """
2128
+ if failure_policy is not None:
2129
+ pulumi.set(__self__, "failure_policy", failure_policy)
2130
+ if match_conditions is not None:
2131
+ pulumi.set(__self__, "match_conditions", match_conditions)
2132
+ if match_constraints is not None:
2133
+ pulumi.set(__self__, "match_constraints", match_constraints)
2134
+ if mutations is not None:
2135
+ pulumi.set(__self__, "mutations", mutations)
2136
+ if param_kind is not None:
2137
+ pulumi.set(__self__, "param_kind", param_kind)
2138
+ if reinvocation_policy is not None:
2139
+ pulumi.set(__self__, "reinvocation_policy", reinvocation_policy)
2140
+ if variables is not None:
2141
+ pulumi.set(__self__, "variables", variables)
2142
+
2143
+ @property
2144
+ @pulumi.getter(name="failurePolicy")
2145
+ def failure_policy(self) -> Optional[pulumi.Input[str]]:
2146
+ """
2147
+ failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2148
+
2149
+ A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
2150
+
2151
+ failurePolicy does not define how validations that evaluate to false are handled.
2152
+
2153
+ Allowed values are Ignore or Fail. Defaults to Fail.
2154
+ """
2155
+ return pulumi.get(self, "failure_policy")
2156
+
2157
+ @failure_policy.setter
2158
+ def failure_policy(self, value: Optional[pulumi.Input[str]]):
2159
+ pulumi.set(self, "failure_policy", value)
2160
+
2161
+ @property
2162
+ @pulumi.getter(name="matchConditions")
2163
+ def match_conditions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['MatchConditionArgs']]]]:
2164
+ """
2165
+ matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
2166
+
2167
+ If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
2168
+
2169
+ The exact matching logic is (in order):
2170
+ 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
2171
+ 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
2172
+ 3. If any matchCondition evaluates to an error (but none are FALSE):
2173
+ - If failurePolicy=Fail, reject the request
2174
+ - If failurePolicy=Ignore, the policy is skipped
2175
+ """
2176
+ return pulumi.get(self, "match_conditions")
2177
+
2178
+ @match_conditions.setter
2179
+ def match_conditions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['MatchConditionArgs']]]]):
2180
+ pulumi.set(self, "match_conditions", value)
2181
+
2182
+ @property
2183
+ @pulumi.getter(name="matchConstraints")
2184
+ def match_constraints(self) -> Optional[pulumi.Input['MatchResourcesArgs']]:
2185
+ """
2186
+ matchConstraints specifies what resources this policy is designed to validate. The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding. The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched. '*' matches CREATE, UPDATE and CONNECT. Required.
2187
+ """
2188
+ return pulumi.get(self, "match_constraints")
2189
+
2190
+ @match_constraints.setter
2191
+ def match_constraints(self, value: Optional[pulumi.Input['MatchResourcesArgs']]):
2192
+ pulumi.set(self, "match_constraints", value)
2193
+
2194
+ @property
2195
+ @pulumi.getter
2196
+ def mutations(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['MutationArgs']]]]:
2197
+ """
2198
+ mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
2199
+ """
2200
+ return pulumi.get(self, "mutations")
2201
+
2202
+ @mutations.setter
2203
+ def mutations(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['MutationArgs']]]]):
2204
+ pulumi.set(self, "mutations", value)
2205
+
2206
+ @property
2207
+ @pulumi.getter(name="paramKind")
2208
+ def param_kind(self) -> Optional[pulumi.Input['ParamKindArgs']]:
2209
+ """
2210
+ paramKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
2211
+ """
2212
+ return pulumi.get(self, "param_kind")
2213
+
2214
+ @param_kind.setter
2215
+ def param_kind(self, value: Optional[pulumi.Input['ParamKindArgs']]):
2216
+ pulumi.set(self, "param_kind", value)
2217
+
2218
+ @property
2219
+ @pulumi.getter(name="reinvocationPolicy")
2220
+ def reinvocation_policy(self) -> Optional[pulumi.Input[str]]:
2221
+ """
2222
+ reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
2223
+
2224
+ Never: These mutations will not be called more than once per binding in a single admission evaluation.
2225
+
2226
+ IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
2227
+ """
2228
+ return pulumi.get(self, "reinvocation_policy")
2229
+
2230
+ @reinvocation_policy.setter
2231
+ def reinvocation_policy(self, value: Optional[pulumi.Input[str]]):
2232
+ pulumi.set(self, "reinvocation_policy", value)
2233
+
2234
+ @property
2235
+ @pulumi.getter
2236
+ def variables(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['VariableArgs']]]]:
2237
+ """
2238
+ variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.
2239
+
2240
+ The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
2241
+ """
2242
+ return pulumi.get(self, "variables")
2243
+
2244
+ @variables.setter
2245
+ def variables(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['VariableArgs']]]]):
2246
+ pulumi.set(self, "variables", value)
2247
+
2248
+
2249
+ if not MYPY:
2250
+ class MutatingAdmissionPolicyArgsDict(TypedDict):
2251
+ """
2252
+ MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
2253
+ """
2254
+ api_version: NotRequired[pulumi.Input[str]]
2255
+ """
2256
+ 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
2257
+ """
2258
+ kind: NotRequired[pulumi.Input[str]]
2259
+ """
2260
+ 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
2261
+ """
2262
+ metadata: NotRequired[pulumi.Input['_meta.v1.ObjectMetaArgsDict']]
2263
+ """
2264
+ Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
2265
+ """
2266
+ spec: NotRequired[pulumi.Input['MutatingAdmissionPolicySpecArgsDict']]
2267
+ """
2268
+ Specification of the desired behavior of the MutatingAdmissionPolicy.
2269
+ """
2270
+ elif False:
2271
+ MutatingAdmissionPolicyArgsDict: TypeAlias = Mapping[str, Any]
2272
+
2273
+ @pulumi.input_type
2274
+ class MutatingAdmissionPolicyArgs:
2275
+ def __init__(__self__, *,
2276
+ api_version: Optional[pulumi.Input[str]] = None,
2277
+ kind: Optional[pulumi.Input[str]] = None,
2278
+ metadata: Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']] = None,
2279
+ spec: Optional[pulumi.Input['MutatingAdmissionPolicySpecArgs']] = None):
2280
+ """
2281
+ MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
2282
+ :param pulumi.Input[str] api_version: 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
2283
+ :param pulumi.Input[str] kind: 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
2284
+ :param pulumi.Input['_meta.v1.ObjectMetaArgs'] metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
2285
+ :param pulumi.Input['MutatingAdmissionPolicySpecArgs'] spec: Specification of the desired behavior of the MutatingAdmissionPolicy.
2286
+ """
2287
+ if api_version is not None:
2288
+ pulumi.set(__self__, "api_version", 'admissionregistration.k8s.io/v1alpha1')
2289
+ if kind is not None:
2290
+ pulumi.set(__self__, "kind", 'MutatingAdmissionPolicy')
2291
+ if metadata is not None:
2292
+ pulumi.set(__self__, "metadata", metadata)
2293
+ if spec is not None:
2294
+ pulumi.set(__self__, "spec", spec)
2295
+
2296
+ @property
2297
+ @pulumi.getter(name="apiVersion")
2298
+ def api_version(self) -> Optional[pulumi.Input[str]]:
2299
+ """
2300
+ 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
2301
+ """
2302
+ return pulumi.get(self, "api_version")
2303
+
2304
+ @api_version.setter
2305
+ def api_version(self, value: Optional[pulumi.Input[str]]):
2306
+ pulumi.set(self, "api_version", value)
2307
+
2308
+ @property
2309
+ @pulumi.getter
2310
+ def kind(self) -> Optional[pulumi.Input[str]]:
2311
+ """
2312
+ 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
2313
+ """
2314
+ return pulumi.get(self, "kind")
2315
+
2316
+ @kind.setter
2317
+ def kind(self, value: Optional[pulumi.Input[str]]):
2318
+ pulumi.set(self, "kind", value)
2319
+
2320
+ @property
2321
+ @pulumi.getter
2322
+ def metadata(self) -> Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]:
2323
+ """
2324
+ Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
2325
+ """
2326
+ return pulumi.get(self, "metadata")
2327
+
2328
+ @metadata.setter
2329
+ def metadata(self, value: Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]):
2330
+ pulumi.set(self, "metadata", value)
2331
+
2332
+ @property
2333
+ @pulumi.getter
2334
+ def spec(self) -> Optional[pulumi.Input['MutatingAdmissionPolicySpecArgs']]:
2335
+ """
2336
+ Specification of the desired behavior of the MutatingAdmissionPolicy.
2337
+ """
2338
+ return pulumi.get(self, "spec")
731
2339
 
732
- See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
2340
+ @spec.setter
2341
+ def spec(self, value: Optional[pulumi.Input['MutatingAdmissionPolicySpecArgs']]):
2342
+ pulumi.set(self, "spec", value)
733
2343
 
734
- Default to the empty LabelSelector, which matches everything.
2344
+
2345
+ if not MYPY:
2346
+ class MutationPatchArgsDict(TypedDict):
735
2347
  """
736
- object_selector: NotRequired[pulumi.Input['_meta.v1.LabelSelectorArgsDict']]
2348
+ Mutation specifies the CEL expression which is used to apply the Mutation.
737
2349
  """
738
- ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
2350
+ apply_configuration: NotRequired[pulumi.Input['ApplyConfigurationPatchArgsDict']]
739
2351
  """
740
- resource_rules: NotRequired[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgsDict']]]]
2352
+ applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
741
2353
  """
742
- ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
2354
+ json_patch: NotRequired[pulumi.Input['JSONPatchPatchArgsDict']]
2355
+ """
2356
+ jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
2357
+ """
2358
+ patch_type: NotRequired[pulumi.Input[str]]
2359
+ """
2360
+ patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
743
2361
  """
744
2362
  elif False:
745
- MatchResourcesArgsDict: TypeAlias = Mapping[str, Any]
2363
+ MutationPatchArgsDict: TypeAlias = Mapping[str, Any]
746
2364
 
747
2365
  @pulumi.input_type
748
- class MatchResourcesArgs:
2366
+ class MutationPatchArgs:
749
2367
  def __init__(__self__, *,
750
- exclude_resource_rules: Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]] = None,
751
- match_policy: Optional[pulumi.Input[str]] = None,
752
- namespace_selector: Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']] = None,
753
- object_selector: Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']] = None,
754
- resource_rules: Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]] = None):
2368
+ apply_configuration: Optional[pulumi.Input['ApplyConfigurationPatchArgs']] = None,
2369
+ json_patch: Optional[pulumi.Input['JSONPatchPatchArgs']] = None,
2370
+ patch_type: Optional[pulumi.Input[str]] = None):
2371
+ """
2372
+ Mutation specifies the CEL expression which is used to apply the Mutation.
2373
+ :param pulumi.Input['ApplyConfigurationPatchArgs'] apply_configuration: applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
2374
+ :param pulumi.Input['JSONPatchPatchArgs'] json_patch: jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
2375
+ :param pulumi.Input[str] patch_type: patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
2376
+ """
2377
+ if apply_configuration is not None:
2378
+ pulumi.set(__self__, "apply_configuration", apply_configuration)
2379
+ if json_patch is not None:
2380
+ pulumi.set(__self__, "json_patch", json_patch)
2381
+ if patch_type is not None:
2382
+ pulumi.set(__self__, "patch_type", patch_type)
2383
+
2384
+ @property
2385
+ @pulumi.getter(name="applyConfiguration")
2386
+ def apply_configuration(self) -> Optional[pulumi.Input['ApplyConfigurationPatchArgs']]:
755
2387
  """
756
- MatchResources decides whether to run the admission control policy on an object based on whether it meets the match criteria. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
757
- :param pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]] exclude_resource_rules: ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
758
- :param pulumi.Input[str] match_policy: matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
759
-
760
- - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
761
-
762
- - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
763
-
764
- Defaults to "Equivalent"
765
- :param pulumi.Input['_meta.v1.LabelSelectorArgs'] namespace_selector: NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
766
-
767
- For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
768
- "matchExpressions": [
769
- {
770
- "key": "runlevel",
771
- "operator": "NotIn",
772
- "values": [
773
- "0",
774
- "1"
775
- ]
776
- }
777
- ]
778
- }
779
-
780
- If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
781
- "matchExpressions": [
782
- {
783
- "key": "environment",
784
- "operator": "In",
785
- "values": [
786
- "prod",
787
- "staging"
788
- ]
789
- }
790
- ]
791
- }
792
-
793
- See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
794
-
795
- Default to the empty LabelSelector, which matches everything.
796
- :param pulumi.Input['_meta.v1.LabelSelectorArgs'] object_selector: ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
797
- :param pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]] resource_rules: ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
2388
+ applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
798
2389
  """
799
- if exclude_resource_rules is not None:
800
- pulumi.set(__self__, "exclude_resource_rules", exclude_resource_rules)
801
- if match_policy is not None:
802
- pulumi.set(__self__, "match_policy", match_policy)
803
- if namespace_selector is not None:
804
- pulumi.set(__self__, "namespace_selector", namespace_selector)
805
- if object_selector is not None:
806
- pulumi.set(__self__, "object_selector", object_selector)
807
- if resource_rules is not None:
808
- pulumi.set(__self__, "resource_rules", resource_rules)
2390
+ return pulumi.get(self, "apply_configuration")
2391
+
2392
+ @apply_configuration.setter
2393
+ def apply_configuration(self, value: Optional[pulumi.Input['ApplyConfigurationPatchArgs']]):
2394
+ pulumi.set(self, "apply_configuration", value)
809
2395
 
810
2396
  @property
811
- @pulumi.getter(name="excludeResourceRules")
812
- def exclude_resource_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]]:
2397
+ @pulumi.getter(name="jsonPatch")
2398
+ def json_patch(self) -> Optional[pulumi.Input['JSONPatchPatchArgs']]:
813
2399
  """
814
- ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
2400
+ jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
815
2401
  """
816
- return pulumi.get(self, "exclude_resource_rules")
2402
+ return pulumi.get(self, "json_patch")
817
2403
 
818
- @exclude_resource_rules.setter
819
- def exclude_resource_rules(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]]):
820
- pulumi.set(self, "exclude_resource_rules", value)
2404
+ @json_patch.setter
2405
+ def json_patch(self, value: Optional[pulumi.Input['JSONPatchPatchArgs']]):
2406
+ pulumi.set(self, "json_patch", value)
821
2407
 
822
2408
  @property
823
- @pulumi.getter(name="matchPolicy")
824
- def match_policy(self) -> Optional[pulumi.Input[str]]:
2409
+ @pulumi.getter(name="patchType")
2410
+ def patch_type(self) -> Optional[pulumi.Input[str]]:
825
2411
  """
826
- matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
2412
+ patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
2413
+ """
2414
+ return pulumi.get(self, "patch_type")
827
2415
 
828
- - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
2416
+ @patch_type.setter
2417
+ def patch_type(self, value: Optional[pulumi.Input[str]]):
2418
+ pulumi.set(self, "patch_type", value)
829
2419
 
830
- - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
831
2420
 
832
- Defaults to "Equivalent"
2421
+ if not MYPY:
2422
+ class MutationArgsDict(TypedDict):
833
2423
  """
834
- return pulumi.get(self, "match_policy")
2424
+ Mutation specifies the CEL expression which is used to apply the Mutation.
2425
+ """
2426
+ patch_type: pulumi.Input[str]
2427
+ """
2428
+ patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
2429
+ """
2430
+ apply_configuration: NotRequired[pulumi.Input['ApplyConfigurationArgsDict']]
2431
+ """
2432
+ applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
2433
+ """
2434
+ json_patch: NotRequired[pulumi.Input['JSONPatchArgsDict']]
2435
+ """
2436
+ jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
2437
+ """
2438
+ elif False:
2439
+ MutationArgsDict: TypeAlias = Mapping[str, Any]
835
2440
 
836
- @match_policy.setter
837
- def match_policy(self, value: Optional[pulumi.Input[str]]):
838
- pulumi.set(self, "match_policy", value)
2441
+ @pulumi.input_type
2442
+ class MutationArgs:
2443
+ def __init__(__self__, *,
2444
+ patch_type: pulumi.Input[str],
2445
+ apply_configuration: Optional[pulumi.Input['ApplyConfigurationArgs']] = None,
2446
+ json_patch: Optional[pulumi.Input['JSONPatchArgs']] = None):
2447
+ """
2448
+ Mutation specifies the CEL expression which is used to apply the Mutation.
2449
+ :param pulumi.Input[str] patch_type: patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
2450
+ :param pulumi.Input['ApplyConfigurationArgs'] apply_configuration: applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
2451
+ :param pulumi.Input['JSONPatchArgs'] json_patch: jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
2452
+ """
2453
+ pulumi.set(__self__, "patch_type", patch_type)
2454
+ if apply_configuration is not None:
2455
+ pulumi.set(__self__, "apply_configuration", apply_configuration)
2456
+ if json_patch is not None:
2457
+ pulumi.set(__self__, "json_patch", json_patch)
839
2458
 
840
2459
  @property
841
- @pulumi.getter(name="namespaceSelector")
842
- def namespace_selector(self) -> Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]:
2460
+ @pulumi.getter(name="patchType")
2461
+ def patch_type(self) -> pulumi.Input[str]:
843
2462
  """
844
- NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
845
-
846
- For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
847
- "matchExpressions": [
848
- {
849
- "key": "runlevel",
850
- "operator": "NotIn",
851
- "values": [
852
- "0",
853
- "1"
854
- ]
855
- }
856
- ]
857
- }
858
-
859
- If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
860
- "matchExpressions": [
861
- {
862
- "key": "environment",
863
- "operator": "In",
864
- "values": [
865
- "prod",
866
- "staging"
867
- ]
868
- }
869
- ]
870
- }
871
-
872
- See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
873
-
874
- Default to the empty LabelSelector, which matches everything.
2463
+ patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
875
2464
  """
876
- return pulumi.get(self, "namespace_selector")
2465
+ return pulumi.get(self, "patch_type")
877
2466
 
878
- @namespace_selector.setter
879
- def namespace_selector(self, value: Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]):
880
- pulumi.set(self, "namespace_selector", value)
2467
+ @patch_type.setter
2468
+ def patch_type(self, value: pulumi.Input[str]):
2469
+ pulumi.set(self, "patch_type", value)
881
2470
 
882
2471
  @property
883
- @pulumi.getter(name="objectSelector")
884
- def object_selector(self) -> Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]:
2472
+ @pulumi.getter(name="applyConfiguration")
2473
+ def apply_configuration(self) -> Optional[pulumi.Input['ApplyConfigurationArgs']]:
885
2474
  """
886
- ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
2475
+ applyConfiguration defines the desired configuration values of an object. The configuration is applied to the admission object using [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff). A CEL expression is used to create apply configuration.
887
2476
  """
888
- return pulumi.get(self, "object_selector")
2477
+ return pulumi.get(self, "apply_configuration")
889
2478
 
890
- @object_selector.setter
891
- def object_selector(self, value: Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]):
892
- pulumi.set(self, "object_selector", value)
2479
+ @apply_configuration.setter
2480
+ def apply_configuration(self, value: Optional[pulumi.Input['ApplyConfigurationArgs']]):
2481
+ pulumi.set(self, "apply_configuration", value)
893
2482
 
894
2483
  @property
895
- @pulumi.getter(name="resourceRules")
896
- def resource_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]]:
2484
+ @pulumi.getter(name="jsonPatch")
2485
+ def json_patch(self) -> Optional[pulumi.Input['JSONPatchArgs']]:
897
2486
  """
898
- ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
2487
+ jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object. A CEL expression is used to create the JSON patch.
899
2488
  """
900
- return pulumi.get(self, "resource_rules")
2489
+ return pulumi.get(self, "json_patch")
901
2490
 
902
- @resource_rules.setter
903
- def resource_rules(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['NamedRuleWithOperationsArgs']]]]):
904
- pulumi.set(self, "resource_rules", value)
2491
+ @json_patch.setter
2492
+ def json_patch(self, value: Optional[pulumi.Input['JSONPatchArgs']]):
2493
+ pulumi.set(self, "json_patch", value)
905
2494
 
906
2495
 
907
2496
  if not MYPY:
@@ -1647,7 +3236,7 @@ if not MYPY:
1647
3236
  """
1648
3237
  param_ref: NotRequired[pulumi.Input['ParamRefPatchArgsDict']]
1649
3238
  """
1650
- paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
3239
+ ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
1651
3240
  """
1652
3241
  policy_name: NotRequired[pulumi.Input[str]]
1653
3242
  """
@@ -1688,7 +3277,7 @@ class ValidatingAdmissionPolicyBindingSpecPatchArgs:
1688
3277
  """
1689
3278
  ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
1690
3279
  :param pulumi.Input['MatchResourcesPatchArgs'] match_resources: MatchResources declares what resources match this binding and will be validated by it. Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this. If this is unset, all resources matched by the policy are validated by this binding When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated. Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required.
1691
- :param pulumi.Input['ParamRefPatchArgs'] param_ref: paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
3280
+ :param pulumi.Input['ParamRefPatchArgs'] param_ref: ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
1692
3281
  :param pulumi.Input[str] policy_name: PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
1693
3282
  :param pulumi.Input[Sequence[pulumi.Input[str]]] validation_actions: validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions.
1694
3283
 
@@ -1735,7 +3324,7 @@ class ValidatingAdmissionPolicyBindingSpecPatchArgs:
1735
3324
  @pulumi.getter(name="paramRef")
1736
3325
  def param_ref(self) -> Optional[pulumi.Input['ParamRefPatchArgs']]:
1737
3326
  """
1738
- paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
3327
+ ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
1739
3328
  """
1740
3329
  return pulumi.get(self, "param_ref")
1741
3330
 
@@ -1797,7 +3386,7 @@ if not MYPY:
1797
3386
  """
1798
3387
  param_ref: NotRequired[pulumi.Input['ParamRefArgsDict']]
1799
3388
  """
1800
- paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
3389
+ ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
1801
3390
  """
1802
3391
  policy_name: NotRequired[pulumi.Input[str]]
1803
3392
  """
@@ -1838,7 +3427,7 @@ class ValidatingAdmissionPolicyBindingSpecArgs:
1838
3427
  """
1839
3428
  ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
1840
3429
  :param pulumi.Input['MatchResourcesArgs'] match_resources: MatchResources declares what resources match this binding and will be validated by it. Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this. If this is unset, all resources matched by the policy are validated by this binding When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated. Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required.
1841
- :param pulumi.Input['ParamRefArgs'] param_ref: paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
3430
+ :param pulumi.Input['ParamRefArgs'] param_ref: ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
1842
3431
  :param pulumi.Input[str] policy_name: PolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be ignored Required.
1843
3432
  :param pulumi.Input[Sequence[pulumi.Input[str]]] validation_actions: validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions.
1844
3433
 
@@ -1885,7 +3474,7 @@ class ValidatingAdmissionPolicyBindingSpecArgs:
1885
3474
  @pulumi.getter(name="paramRef")
1886
3475
  def param_ref(self) -> Optional[pulumi.Input['ParamRefArgs']]:
1887
3476
  """
1888
- paramRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied. If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
3477
+ ParamRef specifies the parameter resource used to configure the admission control policy. It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy. If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
1889
3478
  """
1890
3479
  return pulumi.get(self, "param_ref")
1891
3480
 
@@ -1940,10 +3529,6 @@ if not MYPY:
1940
3529
  class ValidatingAdmissionPolicyBindingArgsDict(TypedDict):
1941
3530
  """
1942
3531
  ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
1943
-
1944
- For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding.
1945
-
1946
- The CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
1947
3532
  """
1948
3533
  api_version: NotRequired[pulumi.Input[str]]
1949
3534
  """
@@ -1973,10 +3558,6 @@ class ValidatingAdmissionPolicyBindingArgs:
1973
3558
  spec: Optional[pulumi.Input['ValidatingAdmissionPolicyBindingSpecArgs']] = None):
1974
3559
  """
1975
3560
  ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
1976
-
1977
- For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding.
1978
-
1979
- The CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
1980
3561
  :param pulumi.Input[str] api_version: 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
1981
3562
  :param pulumi.Input[str] kind: 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
1982
3563
  :param pulumi.Input['_meta.v1.ObjectMetaArgs'] metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
@@ -2051,15 +3632,7 @@ if not MYPY:
2051
3632
  """
2052
3633
  failure_policy: NotRequired[pulumi.Input[str]]
2053
3634
  """
2054
- failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2055
-
2056
- A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
2057
-
2058
- failurePolicy does not define how validations that evaluate to false are handled.
2059
-
2060
- When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
2061
-
2062
- Allowed values are Ignore or Fail. Defaults to Fail.
3635
+ FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
2063
3636
  """
2064
3637
  match_conditions: NotRequired[pulumi.Input[Sequence[pulumi.Input['MatchConditionPatchArgsDict']]]]
2065
3638
  """
@@ -2084,7 +3657,7 @@ if not MYPY:
2084
3657
  """
2085
3658
  validations: NotRequired[pulumi.Input[Sequence[pulumi.Input['ValidationPatchArgsDict']]]]
2086
3659
  """
2087
- Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
3660
+ Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
2088
3661
  """
2089
3662
  variables: NotRequired[pulumi.Input[Sequence[pulumi.Input['VariablePatchArgsDict']]]]
2090
3663
  """
@@ -2108,15 +3681,7 @@ class ValidatingAdmissionPolicySpecPatchArgs:
2108
3681
  """
2109
3682
  ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
2110
3683
  :param pulumi.Input[Sequence[pulumi.Input['AuditAnnotationPatchArgs']]] audit_annotations: auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
2111
- :param pulumi.Input[str] failure_policy: failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2112
-
2113
- A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
2114
-
2115
- failurePolicy does not define how validations that evaluate to false are handled.
2116
-
2117
- When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
2118
-
2119
- Allowed values are Ignore or Fail. Defaults to Fail.
3684
+ :param pulumi.Input[str] failure_policy: FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
2120
3685
  :param pulumi.Input[Sequence[pulumi.Input['MatchConditionPatchArgs']]] match_conditions: MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
2121
3686
 
2122
3687
  If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
@@ -2129,7 +3694,7 @@ class ValidatingAdmissionPolicySpecPatchArgs:
2129
3694
  - If failurePolicy=Ignore, the policy is skipped
2130
3695
  :param pulumi.Input['MatchResourcesPatchArgs'] match_constraints: MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding. Required.
2131
3696
  :param pulumi.Input['ParamKindPatchArgs'] param_kind: ParamKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
2132
- :param pulumi.Input[Sequence[pulumi.Input['ValidationPatchArgs']]] validations: Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
3697
+ :param pulumi.Input[Sequence[pulumi.Input['ValidationPatchArgs']]] validations: Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
2133
3698
  :param pulumi.Input[Sequence[pulumi.Input['VariablePatchArgs']]] variables: Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
2134
3699
 
2135
3700
  The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
@@ -2165,15 +3730,7 @@ class ValidatingAdmissionPolicySpecPatchArgs:
2165
3730
  @pulumi.getter(name="failurePolicy")
2166
3731
  def failure_policy(self) -> Optional[pulumi.Input[str]]:
2167
3732
  """
2168
- failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2169
-
2170
- A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
2171
-
2172
- failurePolicy does not define how validations that evaluate to false are handled.
2173
-
2174
- When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
2175
-
2176
- Allowed values are Ignore or Fail. Defaults to Fail.
3733
+ FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
2177
3734
  """
2178
3735
  return pulumi.get(self, "failure_policy")
2179
3736
 
@@ -2230,7 +3787,7 @@ class ValidatingAdmissionPolicySpecPatchArgs:
2230
3787
  @pulumi.getter
2231
3788
  def validations(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ValidationPatchArgs']]]]:
2232
3789
  """
2233
- Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
3790
+ Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
2234
3791
  """
2235
3792
  return pulumi.get(self, "validations")
2236
3793
 
@@ -2260,7 +3817,7 @@ if not MYPY:
2260
3817
  """
2261
3818
  validations: pulumi.Input[Sequence[pulumi.Input['ValidationArgsDict']]]
2262
3819
  """
2263
- Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
3820
+ Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
2264
3821
  """
2265
3822
  audit_annotations: NotRequired[pulumi.Input[Sequence[pulumi.Input['AuditAnnotationArgsDict']]]]
2266
3823
  """
@@ -2268,15 +3825,7 @@ if not MYPY:
2268
3825
  """
2269
3826
  failure_policy: NotRequired[pulumi.Input[str]]
2270
3827
  """
2271
- failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2272
-
2273
- A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
2274
-
2275
- failurePolicy does not define how validations that evaluate to false are handled.
2276
-
2277
- When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
2278
-
2279
- Allowed values are Ignore or Fail. Defaults to Fail.
3828
+ FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
2280
3829
  """
2281
3830
  match_conditions: NotRequired[pulumi.Input[Sequence[pulumi.Input['MatchConditionArgsDict']]]]
2282
3831
  """
@@ -2320,17 +3869,9 @@ class ValidatingAdmissionPolicySpecArgs:
2320
3869
  variables: Optional[pulumi.Input[Sequence[pulumi.Input['VariableArgs']]]] = None):
2321
3870
  """
2322
3871
  ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
2323
- :param pulumi.Input[Sequence[pulumi.Input['ValidationArgs']]] validations: Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
3872
+ :param pulumi.Input[Sequence[pulumi.Input['ValidationArgs']]] validations: Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
2324
3873
  :param pulumi.Input[Sequence[pulumi.Input['AuditAnnotationArgs']]] audit_annotations: auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
2325
- :param pulumi.Input[str] failure_policy: failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2326
-
2327
- A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
2328
-
2329
- failurePolicy does not define how validations that evaluate to false are handled.
2330
-
2331
- When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
2332
-
2333
- Allowed values are Ignore or Fail. Defaults to Fail.
3874
+ :param pulumi.Input[str] failure_policy: FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
2334
3875
  :param pulumi.Input[Sequence[pulumi.Input['MatchConditionArgs']]] match_conditions: MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
2335
3876
 
2336
3877
  If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
@@ -2365,7 +3906,7 @@ class ValidatingAdmissionPolicySpecArgs:
2365
3906
  @pulumi.getter
2366
3907
  def validations(self) -> pulumi.Input[Sequence[pulumi.Input['ValidationArgs']]]:
2367
3908
  """
2368
- Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
3909
+ Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
2369
3910
  """
2370
3911
  return pulumi.get(self, "validations")
2371
3912
 
@@ -2389,15 +3930,7 @@ class ValidatingAdmissionPolicySpecArgs:
2389
3930
  @pulumi.getter(name="failurePolicy")
2390
3931
  def failure_policy(self) -> Optional[pulumi.Input[str]]:
2391
3932
  """
2392
- failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
2393
-
2394
- A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
2395
-
2396
- failurePolicy does not define how validations that evaluate to false are handled.
2397
-
2398
- When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
2399
-
2400
- Allowed values are Ignore or Fail. Defaults to Fail.
3933
+ FailurePolicy defines how to handle failures for the admission policy. Failures can occur from invalid or mis-configured policy definitions or bindings. A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource. Allowed values are Ignore or Fail. Defaults to Fail.
2401
3934
  """
2402
3935
  return pulumi.get(self, "failure_policy")
2403
3936
 
@@ -2664,14 +4197,9 @@ if not MYPY:
2664
4197
  """
2665
4198
  expression: NotRequired[pulumi.Input[str]]
2666
4199
  """
2667
- Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
4200
+ Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
2668
4201
 
2669
- - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
2670
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
2671
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2672
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2673
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2674
- request resource.
4202
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
2675
4203
 
2676
4204
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
2677
4205
 
@@ -2715,14 +4243,9 @@ class ValidationPatchArgs:
2715
4243
  reason: Optional[pulumi.Input[str]] = None):
2716
4244
  """
2717
4245
  Validation specifies the CEL expression which is used to apply the validation.
2718
- :param pulumi.Input[str] expression: Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
4246
+ :param pulumi.Input[str] expression: Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
2719
4247
 
2720
- - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
2721
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
2722
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2723
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2724
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2725
- request resource.
4248
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
2726
4249
 
2727
4250
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
2728
4251
 
@@ -2758,14 +4281,9 @@ class ValidationPatchArgs:
2758
4281
  @pulumi.getter
2759
4282
  def expression(self) -> Optional[pulumi.Input[str]]:
2760
4283
  """
2761
- Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
4284
+ Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
2762
4285
 
2763
- - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
2764
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
2765
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2766
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2767
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2768
- request resource.
4286
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
2769
4287
 
2770
4288
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
2771
4289
 
@@ -2835,14 +4353,9 @@ if not MYPY:
2835
4353
  """
2836
4354
  expression: pulumi.Input[str]
2837
4355
  """
2838
- Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
4356
+ Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
2839
4357
 
2840
- - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
2841
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
2842
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2843
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2844
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2845
- request resource.
4358
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
2846
4359
 
2847
4360
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
2848
4361
 
@@ -2886,14 +4399,9 @@ class ValidationArgs:
2886
4399
  reason: Optional[pulumi.Input[str]] = None):
2887
4400
  """
2888
4401
  Validation specifies the CEL expression which is used to apply the validation.
2889
- :param pulumi.Input[str] expression: Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
4402
+ :param pulumi.Input[str] expression: Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
2890
4403
 
2891
- - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
2892
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
2893
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2894
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2895
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2896
- request resource.
4404
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
2897
4405
 
2898
4406
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
2899
4407
 
@@ -2928,14 +4436,9 @@ class ValidationArgs:
2928
4436
  @pulumi.getter
2929
4437
  def expression(self) -> pulumi.Input[str]:
2930
4438
  """
2931
- Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
4439
+ Expression represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to the contents of the Admission request/response, organized into CEL variables as well as some other useful variables:
2932
4440
 
2933
- - 'object' - The object from the incoming request. The value is null for DELETE requests. - 'oldObject' - The existing object. The value is null for CREATE requests. - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind. - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources. - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
2934
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
2935
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2936
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2937
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2938
- request resource.
4441
+ 'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request([ref](/pkg/apis/admission/types.go#AdmissionRequest)). 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
2939
4442
 
2940
4443
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
2941
4444