pulumi-kubernetes 4.19.0__py3-none-any.whl → 4.19.0a1726165047__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 (92) hide show
  1. pulumi_kubernetes/__init__.py +0 -36
  2. pulumi_kubernetes/_utilities.py +1 -1
  3. pulumi_kubernetes/admissionregistration/v1/_inputs.py +6 -6
  4. pulumi_kubernetes/admissionregistration/v1/outputs.py +4 -4
  5. pulumi_kubernetes/admissionregistration/v1alpha1/ValidatingAdmissionPolicyBinding.py +8 -0
  6. pulumi_kubernetes/admissionregistration/v1alpha1/ValidatingAdmissionPolicyBindingPatch.py +8 -0
  7. pulumi_kubernetes/admissionregistration/v1alpha1/__init__.py +0 -6
  8. pulumi_kubernetes/admissionregistration/v1alpha1/_inputs.py +321 -1824
  9. pulumi_kubernetes/admissionregistration/v1alpha1/outputs.py +248 -1367
  10. pulumi_kubernetes/admissionregistration/v1beta1/_inputs.py +6 -6
  11. pulumi_kubernetes/admissionregistration/v1beta1/outputs.py +4 -4
  12. pulumi_kubernetes/apiextensions/v1/_inputs.py +6 -6
  13. pulumi_kubernetes/apiextensions/v1/outputs.py +4 -4
  14. pulumi_kubernetes/apps/v1/_inputs.py +6 -6
  15. pulumi_kubernetes/apps/v1/outputs.py +4 -4
  16. pulumi_kubernetes/autoscaling/v2/_inputs.py +15 -15
  17. pulumi_kubernetes/autoscaling/v2/outputs.py +12 -12
  18. pulumi_kubernetes/batch/v1/_inputs.py +6 -6
  19. pulumi_kubernetes/batch/v1/outputs.py +4 -4
  20. pulumi_kubernetes/coordination/__init__.py +0 -3
  21. pulumi_kubernetes/coordination/v1alpha1/LeaseCandidate.py +0 -2
  22. pulumi_kubernetes/coordination/v1alpha1/LeaseCandidatePatch.py +0 -2
  23. pulumi_kubernetes/core/v1/Binding.py +2 -2
  24. pulumi_kubernetes/core/v1/BindingPatch.py +2 -2
  25. pulumi_kubernetes/core/v1/ServiceAccount.py +4 -4
  26. pulumi_kubernetes/core/v1/ServiceAccountPatch.py +4 -4
  27. pulumi_kubernetes/core/v1/_inputs.py +313 -564
  28. pulumi_kubernetes/core/v1/outputs.py +230 -418
  29. pulumi_kubernetes/flowcontrol/v1beta3/_inputs.py +12 -12
  30. pulumi_kubernetes/flowcontrol/v1beta3/outputs.py +8 -8
  31. pulumi_kubernetes/helm/v3/_inputs.py +3 -3
  32. pulumi_kubernetes/helm/v3/outputs.py +2 -2
  33. pulumi_kubernetes/helm/v4/Chart.py +0 -6
  34. pulumi_kubernetes/helm/v4/_inputs.py +3 -3
  35. pulumi_kubernetes/pulumi-plugin.json +1 -1
  36. pulumi_kubernetes/resource/__init__.py +0 -3
  37. pulumi_kubernetes/resource/v1alpha1/ResourceClaim.py +1 -1
  38. pulumi_kubernetes/resource/v1alpha1/ResourceClaimPatch.py +1 -1
  39. pulumi_kubernetes/resource/v1alpha1/ResourceClaimTemplate.py +1 -1
  40. pulumi_kubernetes/resource/v1alpha1/ResourceClaimTemplatePatch.py +1 -1
  41. pulumi_kubernetes/resource/v1alpha2/ResourceClaim.py +1 -1
  42. pulumi_kubernetes/resource/v1alpha2/ResourceClaimPatch.py +1 -1
  43. pulumi_kubernetes/resource/v1alpha2/ResourceClaimTemplate.py +1 -1
  44. pulumi_kubernetes/resource/v1alpha2/ResourceClaimTemplatePatch.py +1 -1
  45. pulumi_kubernetes/resource/v1alpha2/ResourceSlice.py +1 -1
  46. pulumi_kubernetes/resource/v1alpha2/ResourceSlicePatch.py +1 -1
  47. pulumi_kubernetes/resource/v1alpha3/DeviceClass.py +0 -2
  48. pulumi_kubernetes/resource/v1alpha3/DeviceClassPatch.py +0 -2
  49. pulumi_kubernetes/resource/v1alpha3/ResourceClaim.py +1 -1
  50. pulumi_kubernetes/resource/v1alpha3/ResourceClaimPatch.py +1 -1
  51. pulumi_kubernetes/resource/v1alpha3/ResourceClaimTemplate.py +1 -1
  52. pulumi_kubernetes/resource/v1alpha3/ResourceClaimTemplatePatch.py +1 -1
  53. pulumi_kubernetes/resource/v1alpha3/ResourceSlice.py +8 -8
  54. pulumi_kubernetes/resource/v1alpha3/ResourceSlicePatch.py +1 -1
  55. pulumi_kubernetes/resource/v1alpha3/__init__.py +0 -1
  56. pulumi_kubernetes/resource/v1alpha3/_inputs.py +7 -455
  57. pulumi_kubernetes/resource/v1alpha3/outputs.py +5 -592
  58. pulumi_kubernetes/storage/v1/_inputs.py +4 -4
  59. pulumi_kubernetes/storage/v1/outputs.py +4 -4
  60. pulumi_kubernetes/yaml/yaml.py +0 -90
  61. {pulumi_kubernetes-4.19.0.dist-info → pulumi_kubernetes-4.19.0a1726165047.dist-info}/METADATA +6 -6
  62. {pulumi_kubernetes-4.19.0.dist-info → pulumi_kubernetes-4.19.0a1726165047.dist-info}/RECORD +64 -92
  63. {pulumi_kubernetes-4.19.0.dist-info → pulumi_kubernetes-4.19.0a1726165047.dist-info}/WHEEL +1 -1
  64. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicy.py +0 -214
  65. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBinding.py +0 -222
  66. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBindingList.py +0 -215
  67. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyBindingPatch.py +0 -234
  68. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyList.py +0 -215
  69. pulumi_kubernetes/admissionregistration/v1alpha1/MutatingAdmissionPolicyPatch.py +0 -226
  70. pulumi_kubernetes/coordination/v1alpha2/LeaseCandidate.py +0 -216
  71. pulumi_kubernetes/coordination/v1alpha2/LeaseCandidateList.py +0 -215
  72. pulumi_kubernetes/coordination/v1alpha2/LeaseCandidatePatch.py +0 -228
  73. pulumi_kubernetes/coordination/v1alpha2/__init__.py +0 -12
  74. pulumi_kubernetes/coordination/v1alpha2/_inputs.py +0 -393
  75. pulumi_kubernetes/coordination/v1alpha2/outputs.py +0 -313
  76. pulumi_kubernetes/resource/v1alpha3/ResourceSliceList.py +0 -245
  77. pulumi_kubernetes/resource/v1beta1/DeviceClass.py +0 -237
  78. pulumi_kubernetes/resource/v1beta1/DeviceClassList.py +0 -215
  79. pulumi_kubernetes/resource/v1beta1/DeviceClassPatch.py +0 -248
  80. pulumi_kubernetes/resource/v1beta1/ResourceClaim.py +0 -232
  81. pulumi_kubernetes/resource/v1beta1/ResourceClaimList.py +0 -216
  82. pulumi_kubernetes/resource/v1beta1/ResourceClaimPatch.py +0 -243
  83. pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplate.py +0 -229
  84. pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplateList.py +0 -215
  85. pulumi_kubernetes/resource/v1beta1/ResourceClaimTemplatePatch.py +0 -240
  86. pulumi_kubernetes/resource/v1beta1/ResourceSlice.py +0 -246
  87. pulumi_kubernetes/resource/v1beta1/ResourceSliceList.py +0 -216
  88. pulumi_kubernetes/resource/v1beta1/ResourceSlicePatch.py +0 -257
  89. pulumi_kubernetes/resource/v1beta1/__init__.py +0 -21
  90. pulumi_kubernetes/resource/v1beta1/_inputs.py +0 -3867
  91. pulumi_kubernetes/resource/v1beta1/outputs.py +0 -3334
  92. {pulumi_kubernetes-4.19.0.dist-info → pulumi_kubernetes-4.19.0a1726165047.dist-info}/top_level.txt +0 -0
@@ -17,26 +17,14 @@ from . import outputs
17
17
  from ... import meta as _meta
18
18
 
19
19
  __all__ = [
20
- 'ApplyConfiguration',
21
- 'ApplyConfigurationPatch',
22
20
  'AuditAnnotation',
23
21
  'AuditAnnotationPatch',
24
22
  'ExpressionWarning',
25
23
  'ExpressionWarningPatch',
26
- 'JSONPatch',
27
- 'JSONPatchPatch',
28
24
  'MatchCondition',
29
25
  'MatchConditionPatch',
30
26
  'MatchResources',
31
27
  'MatchResourcesPatch',
32
- 'MutatingAdmissionPolicy',
33
- 'MutatingAdmissionPolicyBinding',
34
- 'MutatingAdmissionPolicyBindingSpec',
35
- 'MutatingAdmissionPolicyBindingSpecPatch',
36
- 'MutatingAdmissionPolicySpec',
37
- 'MutatingAdmissionPolicySpecPatch',
38
- 'Mutation',
39
- 'MutationPatch',
40
28
  'NamedRuleWithOperations',
41
29
  'NamedRuleWithOperationsPatch',
42
30
  'ParamKind',
@@ -59,160 +47,6 @@ __all__ = [
59
47
  'VariablePatch',
60
48
  ]
61
49
 
62
- @pulumi.output_type
63
- class ApplyConfiguration(dict):
64
- """
65
- ApplyConfiguration defines the desired configuration values of an object.
66
- """
67
- def __init__(__self__, *,
68
- expression: Optional[str] = None):
69
- """
70
- ApplyConfiguration defines the desired configuration values of an object.
71
- :param str expression: expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
72
-
73
- Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
74
-
75
- Object{
76
- spec: Object.spec{
77
- serviceAccountName: "example"
78
- }
79
- }
80
-
81
- 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.
82
-
83
- CEL expressions have access to the object types needed to create apply configurations:
84
-
85
- - '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')
86
-
87
- CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
88
-
89
- - '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.
90
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
91
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
92
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
93
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
94
- request resource.
95
-
96
- The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
97
-
98
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
99
- """
100
- if expression is not None:
101
- pulumi.set(__self__, "expression", expression)
102
-
103
- @property
104
- @pulumi.getter
105
- def expression(self) -> Optional[str]:
106
- """
107
- expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
108
-
109
- Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
110
-
111
- Object{
112
- spec: Object.spec{
113
- serviceAccountName: "example"
114
- }
115
- }
116
-
117
- 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.
118
-
119
- CEL expressions have access to the object types needed to create apply configurations:
120
-
121
- - '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')
122
-
123
- CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
124
-
125
- - '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.
126
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
127
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
128
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
129
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
130
- request resource.
131
-
132
- The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
133
-
134
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
135
- """
136
- return pulumi.get(self, "expression")
137
-
138
-
139
- @pulumi.output_type
140
- class ApplyConfigurationPatch(dict):
141
- """
142
- ApplyConfiguration defines the desired configuration values of an object.
143
- """
144
- def __init__(__self__, *,
145
- expression: Optional[str] = None):
146
- """
147
- ApplyConfiguration defines the desired configuration values of an object.
148
- :param str expression: expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
149
-
150
- Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
151
-
152
- Object{
153
- spec: Object.spec{
154
- serviceAccountName: "example"
155
- }
156
- }
157
-
158
- 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.
159
-
160
- CEL expressions have access to the object types needed to create apply configurations:
161
-
162
- - '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')
163
-
164
- CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
165
-
166
- - '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.
167
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
168
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
169
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
170
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
171
- request resource.
172
-
173
- The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
174
-
175
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
176
- """
177
- if expression is not None:
178
- pulumi.set(__self__, "expression", expression)
179
-
180
- @property
181
- @pulumi.getter
182
- def expression(self) -> Optional[str]:
183
- """
184
- expression will be evaluated by CEL to create an apply configuration. ref: https://github.com/google/cel-spec
185
-
186
- Apply configurations are declared in CEL using object initialization. For example, this CEL expression returns an apply configuration to set a single field:
187
-
188
- Object{
189
- spec: Object.spec{
190
- serviceAccountName: "example"
191
- }
192
- }
193
-
194
- 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.
195
-
196
- CEL expressions have access to the object types needed to create apply configurations:
197
-
198
- - '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')
199
-
200
- CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
201
-
202
- - '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.
203
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
204
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
205
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
206
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
207
- request resource.
208
-
209
- The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
210
-
211
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
212
- """
213
- return pulumi.get(self, "expression")
214
-
215
-
216
50
  @pulumi.output_type
217
51
  class AuditAnnotation(dict):
218
52
  """
@@ -457,264 +291,6 @@ class ExpressionWarningPatch(dict):
457
291
  return pulumi.get(self, "warning")
458
292
 
459
293
 
460
- @pulumi.output_type
461
- class JSONPatch(dict):
462
- """
463
- JSONPatch defines a JSON Patch.
464
- """
465
- def __init__(__self__, *,
466
- expression: Optional[str] = None):
467
- """
468
- JSONPatch defines a JSON Patch.
469
- :param str expression: expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
470
-
471
- expression must return an array of JSONPatch values.
472
-
473
- For example, this CEL expression returns a JSON patch to conditionally modify a value:
474
-
475
- [
476
- JSONPatch{op: "test", path: "/spec/example", value: "Red"},
477
- JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
478
- ]
479
-
480
- To define an object for the patch value, use Object types. For example:
481
-
482
- [
483
- JSONPatch{
484
- op: "add",
485
- path: "/spec/selector",
486
- value: Object.spec.selector{matchLabels: {"environment": "test"}}
487
- }
488
- ]
489
-
490
- To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
491
-
492
- [
493
- JSONPatch{
494
- op: "add",
495
- path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
496
- value: "test"
497
- },
498
- ]
499
-
500
- CEL expressions have access to the types needed to create JSON patches and objects:
501
-
502
- - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
503
- See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
504
- integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
505
- [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
506
- function may be used to escape path keys containing '/' and '~'.
507
- - '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')
508
-
509
- CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
510
-
511
- - '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.
512
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
513
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
514
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
515
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
516
- request resource.
517
-
518
- 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:
519
-
520
- - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
521
-
522
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
523
- """
524
- if expression is not None:
525
- pulumi.set(__self__, "expression", expression)
526
-
527
- @property
528
- @pulumi.getter
529
- def expression(self) -> Optional[str]:
530
- """
531
- expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
532
-
533
- expression must return an array of JSONPatch values.
534
-
535
- For example, this CEL expression returns a JSON patch to conditionally modify a value:
536
-
537
- [
538
- JSONPatch{op: "test", path: "/spec/example", value: "Red"},
539
- JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
540
- ]
541
-
542
- To define an object for the patch value, use Object types. For example:
543
-
544
- [
545
- JSONPatch{
546
- op: "add",
547
- path: "/spec/selector",
548
- value: Object.spec.selector{matchLabels: {"environment": "test"}}
549
- }
550
- ]
551
-
552
- To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
553
-
554
- [
555
- JSONPatch{
556
- op: "add",
557
- path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
558
- value: "test"
559
- },
560
- ]
561
-
562
- CEL expressions have access to the types needed to create JSON patches and objects:
563
-
564
- - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
565
- See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
566
- integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
567
- [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
568
- function may be used to escape path keys containing '/' and '~'.
569
- - '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')
570
-
571
- CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
572
-
573
- - '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.
574
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
575
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
576
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
577
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
578
- request resource.
579
-
580
- 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:
581
-
582
- - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
583
-
584
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
585
- """
586
- return pulumi.get(self, "expression")
587
-
588
-
589
- @pulumi.output_type
590
- class JSONPatchPatch(dict):
591
- """
592
- JSONPatch defines a JSON Patch.
593
- """
594
- def __init__(__self__, *,
595
- expression: Optional[str] = None):
596
- """
597
- JSONPatch defines a JSON Patch.
598
- :param str expression: expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
599
-
600
- expression must return an array of JSONPatch values.
601
-
602
- For example, this CEL expression returns a JSON patch to conditionally modify a value:
603
-
604
- [
605
- JSONPatch{op: "test", path: "/spec/example", value: "Red"},
606
- JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
607
- ]
608
-
609
- To define an object for the patch value, use Object types. For example:
610
-
611
- [
612
- JSONPatch{
613
- op: "add",
614
- path: "/spec/selector",
615
- value: Object.spec.selector{matchLabels: {"environment": "test"}}
616
- }
617
- ]
618
-
619
- To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
620
-
621
- [
622
- JSONPatch{
623
- op: "add",
624
- path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
625
- value: "test"
626
- },
627
- ]
628
-
629
- CEL expressions have access to the types needed to create JSON patches and objects:
630
-
631
- - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
632
- See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
633
- integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
634
- [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
635
- function may be used to escape path keys containing '/' and '~'.
636
- - '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')
637
-
638
- CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
639
-
640
- - '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.
641
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
642
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
643
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
644
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
645
- request resource.
646
-
647
- 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:
648
-
649
- - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
650
-
651
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
652
- """
653
- if expression is not None:
654
- pulumi.set(__self__, "expression", expression)
655
-
656
- @property
657
- @pulumi.getter
658
- def expression(self) -> Optional[str]:
659
- """
660
- expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/). ref: https://github.com/google/cel-spec
661
-
662
- expression must return an array of JSONPatch values.
663
-
664
- For example, this CEL expression returns a JSON patch to conditionally modify a value:
665
-
666
- [
667
- JSONPatch{op: "test", path: "/spec/example", value: "Red"},
668
- JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
669
- ]
670
-
671
- To define an object for the patch value, use Object types. For example:
672
-
673
- [
674
- JSONPatch{
675
- op: "add",
676
- path: "/spec/selector",
677
- value: Object.spec.selector{matchLabels: {"environment": "test"}}
678
- }
679
- ]
680
-
681
- To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
682
-
683
- [
684
- JSONPatch{
685
- op: "add",
686
- path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
687
- value: "test"
688
- },
689
- ]
690
-
691
- CEL expressions have access to the types needed to create JSON patches and objects:
692
-
693
- - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
694
- See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
695
- integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
696
- [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
697
- function may be used to escape path keys containing '/' and '~'.
698
- - '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')
699
-
700
- CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
701
-
702
- - '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.
703
- For example, a variable named 'foo' can be accessed as 'variables.foo'.
704
- - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
705
- See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
706
- - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
707
- request resource.
708
-
709
- 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:
710
-
711
- - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
712
-
713
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Required.
714
- """
715
- return pulumi.get(self, "expression")
716
-
717
-
718
294
  @pulumi.output_type
719
295
  class MatchCondition(dict):
720
296
  def __init__(__self__, *,
@@ -924,986 +500,231 @@ class MatchResources(dict):
924
500
 
925
501
  - 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.
926
502
 
927
- Defaults to "Equivalent"
928
- """
929
- return pulumi.get(self, "match_policy")
930
-
931
- @property
932
- @pulumi.getter(name="namespaceSelector")
933
- def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:
934
- """
935
- 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.
936
-
937
- 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": {
938
- "matchExpressions": [
939
- {
940
- "key": "runlevel",
941
- "operator": "NotIn",
942
- "values": [
943
- "0",
944
- "1"
945
- ]
946
- }
947
- ]
948
- }
949
-
950
- 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": {
951
- "matchExpressions": [
952
- {
953
- "key": "environment",
954
- "operator": "In",
955
- "values": [
956
- "prod",
957
- "staging"
958
- ]
959
- }
960
- ]
961
- }
962
-
963
- See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
964
-
965
- Default to the empty LabelSelector, which matches everything.
966
- """
967
- return pulumi.get(self, "namespace_selector")
968
-
969
- @property
970
- @pulumi.getter(name="objectSelector")
971
- def object_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:
972
- """
973
- 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.
974
- """
975
- return pulumi.get(self, "object_selector")
976
-
977
- @property
978
- @pulumi.getter(name="resourceRules")
979
- def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperations']]:
980
- """
981
- ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
982
- """
983
- return pulumi.get(self, "resource_rules")
984
-
985
-
986
- @pulumi.output_type
987
- class MatchResourcesPatch(dict):
988
- """
989
- 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)
990
- """
991
- @staticmethod
992
- def __key_warning(key: str):
993
- suggest = None
994
- if key == "excludeResourceRules":
995
- suggest = "exclude_resource_rules"
996
- elif key == "matchPolicy":
997
- suggest = "match_policy"
998
- elif key == "namespaceSelector":
999
- suggest = "namespace_selector"
1000
- elif key == "objectSelector":
1001
- suggest = "object_selector"
1002
- elif key == "resourceRules":
1003
- suggest = "resource_rules"
1004
-
1005
- if suggest:
1006
- pulumi.log.warn(f"Key '{key}' not found in MatchResourcesPatch. Access the value via the '{suggest}' property getter instead.")
1007
-
1008
- def __getitem__(self, key: str) -> Any:
1009
- MatchResourcesPatch.__key_warning(key)
1010
- return super().__getitem__(key)
1011
-
1012
- def get(self, key: str, default = None) -> Any:
1013
- MatchResourcesPatch.__key_warning(key)
1014
- return super().get(key, default)
1015
-
1016
- def __init__(__self__, *,
1017
- exclude_resource_rules: Optional[Sequence['outputs.NamedRuleWithOperationsPatch']] = None,
1018
- match_policy: Optional[str] = None,
1019
- namespace_selector: Optional['_meta.v1.outputs.LabelSelectorPatch'] = None,
1020
- object_selector: Optional['_meta.v1.outputs.LabelSelectorPatch'] = None,
1021
- resource_rules: Optional[Sequence['outputs.NamedRuleWithOperationsPatch']] = None):
1022
- """
1023
- 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)
1024
- :param Sequence['NamedRuleWithOperationsPatchArgs'] 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)
1025
- :param str match_policy: matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
1026
-
1027
- - 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.
1028
-
1029
- - 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.
1030
-
1031
- Defaults to "Equivalent"
1032
- :param '_meta.v1.LabelSelectorPatchArgs' 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.
1033
-
1034
- 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": {
1035
- "matchExpressions": [
1036
- {
1037
- "key": "runlevel",
1038
- "operator": "NotIn",
1039
- "values": [
1040
- "0",
1041
- "1"
1042
- ]
1043
- }
1044
- ]
1045
- }
1046
-
1047
- 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": {
1048
- "matchExpressions": [
1049
- {
1050
- "key": "environment",
1051
- "operator": "In",
1052
- "values": [
1053
- "prod",
1054
- "staging"
1055
- ]
1056
- }
1057
- ]
1058
- }
1059
-
1060
- See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
1061
-
1062
- Default to the empty LabelSelector, which matches everything.
1063
- :param '_meta.v1.LabelSelectorPatchArgs' 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.
1064
- :param Sequence['NamedRuleWithOperationsPatchArgs'] resource_rules: ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
1065
- """
1066
- if exclude_resource_rules is not None:
1067
- pulumi.set(__self__, "exclude_resource_rules", exclude_resource_rules)
1068
- if match_policy is not None:
1069
- pulumi.set(__self__, "match_policy", match_policy)
1070
- if namespace_selector is not None:
1071
- pulumi.set(__self__, "namespace_selector", namespace_selector)
1072
- if object_selector is not None:
1073
- pulumi.set(__self__, "object_selector", object_selector)
1074
- if resource_rules is not None:
1075
- pulumi.set(__self__, "resource_rules", resource_rules)
1076
-
1077
- @property
1078
- @pulumi.getter(name="excludeResourceRules")
1079
- def exclude_resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperationsPatch']]:
1080
- """
1081
- 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)
1082
- """
1083
- return pulumi.get(self, "exclude_resource_rules")
1084
-
1085
- @property
1086
- @pulumi.getter(name="matchPolicy")
1087
- def match_policy(self) -> Optional[str]:
1088
- """
1089
- matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
1090
-
1091
- - 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.
1092
-
1093
- - 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.
1094
-
1095
- Defaults to "Equivalent"
1096
- """
1097
- return pulumi.get(self, "match_policy")
1098
-
1099
- @property
1100
- @pulumi.getter(name="namespaceSelector")
1101
- def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:
1102
- """
1103
- 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.
1104
-
1105
- 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": {
1106
- "matchExpressions": [
1107
- {
1108
- "key": "runlevel",
1109
- "operator": "NotIn",
1110
- "values": [
1111
- "0",
1112
- "1"
1113
- ]
1114
- }
1115
- ]
1116
- }
1117
-
1118
- 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": {
1119
- "matchExpressions": [
1120
- {
1121
- "key": "environment",
1122
- "operator": "In",
1123
- "values": [
1124
- "prod",
1125
- "staging"
1126
- ]
1127
- }
1128
- ]
1129
- }
1130
-
1131
- See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
1132
-
1133
- Default to the empty LabelSelector, which matches everything.
1134
- """
1135
- return pulumi.get(self, "namespace_selector")
1136
-
1137
- @property
1138
- @pulumi.getter(name="objectSelector")
1139
- def object_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:
1140
- """
1141
- 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.
1142
- """
1143
- return pulumi.get(self, "object_selector")
1144
-
1145
- @property
1146
- @pulumi.getter(name="resourceRules")
1147
- def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperationsPatch']]:
1148
- """
1149
- ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
1150
- """
1151
- return pulumi.get(self, "resource_rules")
1152
-
1153
-
1154
- @pulumi.output_type
1155
- class MutatingAdmissionPolicy(dict):
1156
- """
1157
- MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
1158
- """
1159
- @staticmethod
1160
- def __key_warning(key: str):
1161
- suggest = None
1162
- if key == "apiVersion":
1163
- suggest = "api_version"
1164
-
1165
- if suggest:
1166
- pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicy. Access the value via the '{suggest}' property getter instead.")
1167
-
1168
- def __getitem__(self, key: str) -> Any:
1169
- MutatingAdmissionPolicy.__key_warning(key)
1170
- return super().__getitem__(key)
1171
-
1172
- def get(self, key: str, default = None) -> Any:
1173
- MutatingAdmissionPolicy.__key_warning(key)
1174
- return super().get(key, default)
1175
-
1176
- def __init__(__self__, *,
1177
- api_version: Optional[str] = None,
1178
- kind: Optional[str] = None,
1179
- metadata: Optional['_meta.v1.outputs.ObjectMeta'] = None,
1180
- spec: Optional['outputs.MutatingAdmissionPolicySpec'] = None):
1181
- """
1182
- MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
1183
- :param 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
1184
- :param 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
1185
- :param '_meta.v1.ObjectMetaArgs' metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
1186
- :param 'MutatingAdmissionPolicySpecArgs' spec: Specification of the desired behavior of the MutatingAdmissionPolicy.
1187
- """
1188
- if api_version is not None:
1189
- pulumi.set(__self__, "api_version", 'admissionregistration.k8s.io/v1alpha1')
1190
- if kind is not None:
1191
- pulumi.set(__self__, "kind", 'MutatingAdmissionPolicy')
1192
- if metadata is not None:
1193
- pulumi.set(__self__, "metadata", metadata)
1194
- if spec is not None:
1195
- pulumi.set(__self__, "spec", spec)
1196
-
1197
- @property
1198
- @pulumi.getter(name="apiVersion")
1199
- def api_version(self) -> Optional[str]:
1200
- """
1201
- 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
1202
- """
1203
- return pulumi.get(self, "api_version")
1204
-
1205
- @property
1206
- @pulumi.getter
1207
- def kind(self) -> Optional[str]:
1208
- """
1209
- 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
1210
- """
1211
- return pulumi.get(self, "kind")
1212
-
1213
- @property
1214
- @pulumi.getter
1215
- def metadata(self) -> Optional['_meta.v1.outputs.ObjectMeta']:
1216
- """
1217
- Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
1218
- """
1219
- return pulumi.get(self, "metadata")
1220
-
1221
- @property
1222
- @pulumi.getter
1223
- def spec(self) -> Optional['outputs.MutatingAdmissionPolicySpec']:
1224
- """
1225
- Specification of the desired behavior of the MutatingAdmissionPolicy.
1226
- """
1227
- return pulumi.get(self, "spec")
1228
-
1229
-
1230
- @pulumi.output_type
1231
- class MutatingAdmissionPolicyBinding(dict):
1232
- """
1233
- MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters.
1234
-
1235
- 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).
1236
-
1237
- Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
1238
- """
1239
- @staticmethod
1240
- def __key_warning(key: str):
1241
- suggest = None
1242
- if key == "apiVersion":
1243
- suggest = "api_version"
1244
-
1245
- if suggest:
1246
- pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicyBinding. Access the value via the '{suggest}' property getter instead.")
1247
-
1248
- def __getitem__(self, key: str) -> Any:
1249
- MutatingAdmissionPolicyBinding.__key_warning(key)
1250
- return super().__getitem__(key)
1251
-
1252
- def get(self, key: str, default = None) -> Any:
1253
- MutatingAdmissionPolicyBinding.__key_warning(key)
1254
- return super().get(key, default)
1255
-
1256
- def __init__(__self__, *,
1257
- api_version: Optional[str] = None,
1258
- kind: Optional[str] = None,
1259
- metadata: Optional['_meta.v1.outputs.ObjectMeta'] = None,
1260
- spec: Optional['outputs.MutatingAdmissionPolicyBindingSpec'] = None):
1261
- """
1262
- MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources. MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators configure policies for clusters.
1263
-
1264
- 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).
1265
-
1266
- Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.
1267
- :param 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
1268
- :param 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
1269
- :param '_meta.v1.ObjectMetaArgs' metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
1270
- :param 'MutatingAdmissionPolicyBindingSpecArgs' spec: Specification of the desired behavior of the MutatingAdmissionPolicyBinding.
1271
- """
1272
- if api_version is not None:
1273
- pulumi.set(__self__, "api_version", 'admissionregistration.k8s.io/v1alpha1')
1274
- if kind is not None:
1275
- pulumi.set(__self__, "kind", 'MutatingAdmissionPolicyBinding')
1276
- if metadata is not None:
1277
- pulumi.set(__self__, "metadata", metadata)
1278
- if spec is not None:
1279
- pulumi.set(__self__, "spec", spec)
1280
-
1281
- @property
1282
- @pulumi.getter(name="apiVersion")
1283
- def api_version(self) -> Optional[str]:
1284
- """
1285
- 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
1286
- """
1287
- return pulumi.get(self, "api_version")
1288
-
1289
- @property
1290
- @pulumi.getter
1291
- def kind(self) -> Optional[str]:
1292
- """
1293
- 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
1294
- """
1295
- return pulumi.get(self, "kind")
1296
-
1297
- @property
1298
- @pulumi.getter
1299
- def metadata(self) -> Optional['_meta.v1.outputs.ObjectMeta']:
1300
- """
1301
- Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
1302
- """
1303
- return pulumi.get(self, "metadata")
1304
-
1305
- @property
1306
- @pulumi.getter
1307
- def spec(self) -> Optional['outputs.MutatingAdmissionPolicyBindingSpec']:
1308
- """
1309
- Specification of the desired behavior of the MutatingAdmissionPolicyBinding.
1310
- """
1311
- return pulumi.get(self, "spec")
1312
-
1313
-
1314
- @pulumi.output_type
1315
- class MutatingAdmissionPolicyBindingSpec(dict):
1316
- """
1317
- MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
1318
- """
1319
- @staticmethod
1320
- def __key_warning(key: str):
1321
- suggest = None
1322
- if key == "matchResources":
1323
- suggest = "match_resources"
1324
- elif key == "paramRef":
1325
- suggest = "param_ref"
1326
- elif key == "policyName":
1327
- suggest = "policy_name"
1328
-
1329
- if suggest:
1330
- pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicyBindingSpec. Access the value via the '{suggest}' property getter instead.")
1331
-
1332
- def __getitem__(self, key: str) -> Any:
1333
- MutatingAdmissionPolicyBindingSpec.__key_warning(key)
1334
- return super().__getitem__(key)
1335
-
1336
- def get(self, key: str, default = None) -> Any:
1337
- MutatingAdmissionPolicyBindingSpec.__key_warning(key)
1338
- return super().get(key, default)
1339
-
1340
- def __init__(__self__, *,
1341
- match_resources: Optional['outputs.MatchResources'] = None,
1342
- param_ref: Optional['outputs.ParamRef'] = None,
1343
- policy_name: Optional[str] = None):
1344
- """
1345
- MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
1346
- :param '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.
1347
- :param '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.
1348
- :param 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.
1349
- """
1350
- if match_resources is not None:
1351
- pulumi.set(__self__, "match_resources", match_resources)
1352
- if param_ref is not None:
1353
- pulumi.set(__self__, "param_ref", param_ref)
1354
- if policy_name is not None:
1355
- pulumi.set(__self__, "policy_name", policy_name)
1356
-
1357
- @property
1358
- @pulumi.getter(name="matchResources")
1359
- def match_resources(self) -> Optional['outputs.MatchResources']:
1360
- """
1361
- 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.
1362
- """
1363
- return pulumi.get(self, "match_resources")
1364
-
1365
- @property
1366
- @pulumi.getter(name="paramRef")
1367
- def param_ref(self) -> Optional['outputs.ParamRef']:
1368
- """
1369
- 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.
1370
- """
1371
- return pulumi.get(self, "param_ref")
1372
-
1373
- @property
1374
- @pulumi.getter(name="policyName")
1375
- def policy_name(self) -> Optional[str]:
1376
- """
1377
- 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.
1378
- """
1379
- return pulumi.get(self, "policy_name")
1380
-
1381
-
1382
- @pulumi.output_type
1383
- class MutatingAdmissionPolicyBindingSpecPatch(dict):
1384
- """
1385
- MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
1386
- """
1387
- @staticmethod
1388
- def __key_warning(key: str):
1389
- suggest = None
1390
- if key == "matchResources":
1391
- suggest = "match_resources"
1392
- elif key == "paramRef":
1393
- suggest = "param_ref"
1394
- elif key == "policyName":
1395
- suggest = "policy_name"
1396
-
1397
- if suggest:
1398
- pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicyBindingSpecPatch. Access the value via the '{suggest}' property getter instead.")
1399
-
1400
- def __getitem__(self, key: str) -> Any:
1401
- MutatingAdmissionPolicyBindingSpecPatch.__key_warning(key)
1402
- return super().__getitem__(key)
1403
-
1404
- def get(self, key: str, default = None) -> Any:
1405
- MutatingAdmissionPolicyBindingSpecPatch.__key_warning(key)
1406
- return super().get(key, default)
1407
-
1408
- def __init__(__self__, *,
1409
- match_resources: Optional['outputs.MatchResourcesPatch'] = None,
1410
- param_ref: Optional['outputs.ParamRefPatch'] = None,
1411
- policy_name: Optional[str] = None):
1412
- """
1413
- MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
1414
- :param '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.
1415
- :param '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.
1416
- :param 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.
1417
- """
1418
- if match_resources is not None:
1419
- pulumi.set(__self__, "match_resources", match_resources)
1420
- if param_ref is not None:
1421
- pulumi.set(__self__, "param_ref", param_ref)
1422
- if policy_name is not None:
1423
- pulumi.set(__self__, "policy_name", policy_name)
1424
-
1425
- @property
1426
- @pulumi.getter(name="matchResources")
1427
- def match_resources(self) -> Optional['outputs.MatchResourcesPatch']:
1428
- """
1429
- 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.
1430
- """
1431
- return pulumi.get(self, "match_resources")
1432
-
1433
- @property
1434
- @pulumi.getter(name="paramRef")
1435
- def param_ref(self) -> Optional['outputs.ParamRefPatch']:
1436
- """
1437
- 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.
1438
- """
1439
- return pulumi.get(self, "param_ref")
1440
-
1441
- @property
1442
- @pulumi.getter(name="policyName")
1443
- def policy_name(self) -> Optional[str]:
1444
- """
1445
- 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.
1446
- """
1447
- return pulumi.get(self, "policy_name")
1448
-
1449
-
1450
- @pulumi.output_type
1451
- class MutatingAdmissionPolicySpec(dict):
1452
- """
1453
- MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
1454
- """
1455
- @staticmethod
1456
- def __key_warning(key: str):
1457
- suggest = None
1458
- if key == "failurePolicy":
1459
- suggest = "failure_policy"
1460
- elif key == "matchConditions":
1461
- suggest = "match_conditions"
1462
- elif key == "matchConstraints":
1463
- suggest = "match_constraints"
1464
- elif key == "paramKind":
1465
- suggest = "param_kind"
1466
- elif key == "reinvocationPolicy":
1467
- suggest = "reinvocation_policy"
1468
-
1469
- if suggest:
1470
- pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicySpec. Access the value via the '{suggest}' property getter instead.")
1471
-
1472
- def __getitem__(self, key: str) -> Any:
1473
- MutatingAdmissionPolicySpec.__key_warning(key)
1474
- return super().__getitem__(key)
1475
-
1476
- def get(self, key: str, default = None) -> Any:
1477
- MutatingAdmissionPolicySpec.__key_warning(key)
1478
- return super().get(key, default)
1479
-
1480
- def __init__(__self__, *,
1481
- failure_policy: Optional[str] = None,
1482
- match_conditions: Optional[Sequence['outputs.MatchCondition']] = None,
1483
- match_constraints: Optional['outputs.MatchResources'] = None,
1484
- mutations: Optional[Sequence['outputs.Mutation']] = None,
1485
- param_kind: Optional['outputs.ParamKind'] = None,
1486
- reinvocation_policy: Optional[str] = None,
1487
- variables: Optional[Sequence['outputs.Variable']] = None):
1488
- """
1489
- MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
1490
- :param 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.
1491
-
1492
- 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.
1493
-
1494
- failurePolicy does not define how validations that evaluate to false are handled.
1495
-
1496
- Allowed values are Ignore or Fail. Defaults to Fail.
1497
- :param Sequence['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.
1498
-
1499
- If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
1500
-
1501
- The exact matching logic is (in order):
1502
- 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
1503
- 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
1504
- 3. If any matchCondition evaluates to an error (but none are FALSE):
1505
- - If failurePolicy=Fail, reject the request
1506
- - If failurePolicy=Ignore, the policy is skipped
1507
- :param '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.
1508
- :param Sequence['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.
1509
- :param '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.
1510
- :param 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".
1511
-
1512
- Never: These mutations will not be called more than once per binding in a single admission evaluation.
1513
-
1514
- 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.
1515
- :param Sequence['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.
1516
-
1517
- 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.
1518
- """
1519
- if failure_policy is not None:
1520
- pulumi.set(__self__, "failure_policy", failure_policy)
1521
- if match_conditions is not None:
1522
- pulumi.set(__self__, "match_conditions", match_conditions)
1523
- if match_constraints is not None:
1524
- pulumi.set(__self__, "match_constraints", match_constraints)
1525
- if mutations is not None:
1526
- pulumi.set(__self__, "mutations", mutations)
1527
- if param_kind is not None:
1528
- pulumi.set(__self__, "param_kind", param_kind)
1529
- if reinvocation_policy is not None:
1530
- pulumi.set(__self__, "reinvocation_policy", reinvocation_policy)
1531
- if variables is not None:
1532
- pulumi.set(__self__, "variables", variables)
1533
-
1534
- @property
1535
- @pulumi.getter(name="failurePolicy")
1536
- def failure_policy(self) -> Optional[str]:
1537
- """
1538
- 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.
1539
-
1540
- 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.
1541
-
1542
- failurePolicy does not define how validations that evaluate to false are handled.
1543
-
1544
- Allowed values are Ignore or Fail. Defaults to Fail.
1545
- """
1546
- return pulumi.get(self, "failure_policy")
1547
-
1548
- @property
1549
- @pulumi.getter(name="matchConditions")
1550
- def match_conditions(self) -> Optional[Sequence['outputs.MatchCondition']]:
1551
- """
1552
- 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.
1553
-
1554
- If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
1555
-
1556
- The exact matching logic is (in order):
1557
- 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
1558
- 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
1559
- 3. If any matchCondition evaluates to an error (but none are FALSE):
1560
- - If failurePolicy=Fail, reject the request
1561
- - If failurePolicy=Ignore, the policy is skipped
1562
- """
1563
- return pulumi.get(self, "match_conditions")
1564
-
1565
- @property
1566
- @pulumi.getter(name="matchConstraints")
1567
- def match_constraints(self) -> Optional['outputs.MatchResources']:
1568
- """
1569
- 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.
1570
- """
1571
- return pulumi.get(self, "match_constraints")
1572
-
1573
- @property
1574
- @pulumi.getter
1575
- def mutations(self) -> Optional[Sequence['outputs.Mutation']]:
1576
- """
1577
- 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.
1578
- """
1579
- return pulumi.get(self, "mutations")
1580
-
1581
- @property
1582
- @pulumi.getter(name="paramKind")
1583
- def param_kind(self) -> Optional['outputs.ParamKind']:
1584
- """
1585
- 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.
1586
- """
1587
- return pulumi.get(self, "param_kind")
1588
-
1589
- @property
1590
- @pulumi.getter(name="reinvocationPolicy")
1591
- def reinvocation_policy(self) -> Optional[str]:
1592
- """
1593
- reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
1594
-
1595
- Never: These mutations will not be called more than once per binding in a single admission evaluation.
1596
-
1597
- 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.
1598
- """
1599
- return pulumi.get(self, "reinvocation_policy")
1600
-
1601
- @property
1602
- @pulumi.getter
1603
- def variables(self) -> Optional[Sequence['outputs.Variable']]:
1604
- """
1605
- 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.
1606
-
1607
- 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.
1608
- """
1609
- return pulumi.get(self, "variables")
1610
-
1611
-
1612
- @pulumi.output_type
1613
- class MutatingAdmissionPolicySpecPatch(dict):
1614
- """
1615
- MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
1616
- """
1617
- @staticmethod
1618
- def __key_warning(key: str):
1619
- suggest = None
1620
- if key == "failurePolicy":
1621
- suggest = "failure_policy"
1622
- elif key == "matchConditions":
1623
- suggest = "match_conditions"
1624
- elif key == "matchConstraints":
1625
- suggest = "match_constraints"
1626
- elif key == "paramKind":
1627
- suggest = "param_kind"
1628
- elif key == "reinvocationPolicy":
1629
- suggest = "reinvocation_policy"
1630
-
1631
- if suggest:
1632
- pulumi.log.warn(f"Key '{key}' not found in MutatingAdmissionPolicySpecPatch. Access the value via the '{suggest}' property getter instead.")
1633
-
1634
- def __getitem__(self, key: str) -> Any:
1635
- MutatingAdmissionPolicySpecPatch.__key_warning(key)
1636
- return super().__getitem__(key)
1637
-
1638
- def get(self, key: str, default = None) -> Any:
1639
- MutatingAdmissionPolicySpecPatch.__key_warning(key)
1640
- return super().get(key, default)
1641
-
1642
- def __init__(__self__, *,
1643
- failure_policy: Optional[str] = None,
1644
- match_conditions: Optional[Sequence['outputs.MatchConditionPatch']] = None,
1645
- match_constraints: Optional['outputs.MatchResourcesPatch'] = None,
1646
- mutations: Optional[Sequence['outputs.MutationPatch']] = None,
1647
- param_kind: Optional['outputs.ParamKindPatch'] = None,
1648
- reinvocation_policy: Optional[str] = None,
1649
- variables: Optional[Sequence['outputs.VariablePatch']] = None):
1650
- """
1651
- MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
1652
- :param 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.
1653
-
1654
- 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.
1655
-
1656
- failurePolicy does not define how validations that evaluate to false are handled.
1657
-
1658
- Allowed values are Ignore or Fail. Defaults to Fail.
1659
- :param Sequence['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.
1660
-
1661
- If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
1662
-
1663
- The exact matching logic is (in order):
1664
- 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
1665
- 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
1666
- 3. If any matchCondition evaluates to an error (but none are FALSE):
1667
- - If failurePolicy=Fail, reject the request
1668
- - If failurePolicy=Ignore, the policy is skipped
1669
- :param '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.
1670
- :param Sequence['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.
1671
- :param '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.
1672
- :param 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".
1673
-
1674
- Never: These mutations will not be called more than once per binding in a single admission evaluation.
1675
-
1676
- 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.
1677
- :param Sequence['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.
1678
-
1679
- 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.
1680
- """
1681
- if failure_policy is not None:
1682
- pulumi.set(__self__, "failure_policy", failure_policy)
1683
- if match_conditions is not None:
1684
- pulumi.set(__self__, "match_conditions", match_conditions)
1685
- if match_constraints is not None:
1686
- pulumi.set(__self__, "match_constraints", match_constraints)
1687
- if mutations is not None:
1688
- pulumi.set(__self__, "mutations", mutations)
1689
- if param_kind is not None:
1690
- pulumi.set(__self__, "param_kind", param_kind)
1691
- if reinvocation_policy is not None:
1692
- pulumi.set(__self__, "reinvocation_policy", reinvocation_policy)
1693
- if variables is not None:
1694
- pulumi.set(__self__, "variables", variables)
1695
-
1696
- @property
1697
- @pulumi.getter(name="failurePolicy")
1698
- def failure_policy(self) -> Optional[str]:
1699
- """
1700
- 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.
1701
-
1702
- 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.
1703
-
1704
- failurePolicy does not define how validations that evaluate to false are handled.
1705
-
1706
- Allowed values are Ignore or Fail. Defaults to Fail.
1707
- """
1708
- return pulumi.get(self, "failure_policy")
1709
-
1710
- @property
1711
- @pulumi.getter(name="matchConditions")
1712
- def match_conditions(self) -> Optional[Sequence['outputs.MatchConditionPatch']]:
1713
- """
1714
- 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.
1715
-
1716
- If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
1717
-
1718
- The exact matching logic is (in order):
1719
- 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
1720
- 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
1721
- 3. If any matchCondition evaluates to an error (but none are FALSE):
1722
- - If failurePolicy=Fail, reject the request
1723
- - If failurePolicy=Ignore, the policy is skipped
1724
- """
1725
- return pulumi.get(self, "match_conditions")
1726
-
1727
- @property
1728
- @pulumi.getter(name="matchConstraints")
1729
- def match_constraints(self) -> Optional['outputs.MatchResourcesPatch']:
1730
- """
1731
- 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.
1732
- """
1733
- return pulumi.get(self, "match_constraints")
1734
-
1735
- @property
1736
- @pulumi.getter
1737
- def mutations(self) -> Optional[Sequence['outputs.MutationPatch']]:
1738
- """
1739
- 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.
503
+ Defaults to "Equivalent"
1740
504
  """
1741
- return pulumi.get(self, "mutations")
505
+ return pulumi.get(self, "match_policy")
1742
506
 
1743
507
  @property
1744
- @pulumi.getter(name="paramKind")
1745
- def param_kind(self) -> Optional['outputs.ParamKindPatch']:
1746
- """
1747
- 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.
508
+ @pulumi.getter(name="namespaceSelector")
509
+ def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:
1748
510
  """
1749
- return pulumi.get(self, "param_kind")
511
+ 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.
1750
512
 
1751
- @property
1752
- @pulumi.getter(name="reinvocationPolicy")
1753
- def reinvocation_policy(self) -> Optional[str]:
1754
- """
1755
- reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
513
+ 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": {
514
+ "matchExpressions": [
515
+ {
516
+ "key": "runlevel",
517
+ "operator": "NotIn",
518
+ "values": [
519
+ "0",
520
+ "1"
521
+ ]
522
+ }
523
+ ]
524
+ }
525
+
526
+ 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": {
527
+ "matchExpressions": [
528
+ {
529
+ "key": "environment",
530
+ "operator": "In",
531
+ "values": [
532
+ "prod",
533
+ "staging"
534
+ ]
535
+ }
536
+ ]
537
+ }
1756
538
 
1757
- Never: These mutations will not be called more than once per binding in a single admission evaluation.
539
+ See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
1758
540
 
1759
- 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.
541
+ Default to the empty LabelSelector, which matches everything.
1760
542
  """
1761
- return pulumi.get(self, "reinvocation_policy")
543
+ return pulumi.get(self, "namespace_selector")
1762
544
 
1763
545
  @property
1764
- @pulumi.getter
1765
- def variables(self) -> Optional[Sequence['outputs.VariablePatch']]:
546
+ @pulumi.getter(name="objectSelector")
547
+ def object_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:
548
+ """
549
+ 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.
1766
550
  """
1767
- 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.
551
+ return pulumi.get(self, "object_selector")
1768
552
 
1769
- 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.
553
+ @property
554
+ @pulumi.getter(name="resourceRules")
555
+ def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperations']]:
1770
556
  """
1771
- return pulumi.get(self, "variables")
557
+ ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
558
+ """
559
+ return pulumi.get(self, "resource_rules")
1772
560
 
1773
561
 
1774
562
  @pulumi.output_type
1775
- class Mutation(dict):
563
+ class MatchResourcesPatch(dict):
1776
564
  """
1777
- Mutation specifies the CEL expression which is used to apply the Mutation.
565
+ 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)
1778
566
  """
1779
567
  @staticmethod
1780
568
  def __key_warning(key: str):
1781
569
  suggest = None
1782
- if key == "patchType":
1783
- suggest = "patch_type"
1784
- elif key == "applyConfiguration":
1785
- suggest = "apply_configuration"
1786
- elif key == "jsonPatch":
1787
- suggest = "json_patch"
570
+ if key == "excludeResourceRules":
571
+ suggest = "exclude_resource_rules"
572
+ elif key == "matchPolicy":
573
+ suggest = "match_policy"
574
+ elif key == "namespaceSelector":
575
+ suggest = "namespace_selector"
576
+ elif key == "objectSelector":
577
+ suggest = "object_selector"
578
+ elif key == "resourceRules":
579
+ suggest = "resource_rules"
1788
580
 
1789
581
  if suggest:
1790
- pulumi.log.warn(f"Key '{key}' not found in Mutation. Access the value via the '{suggest}' property getter instead.")
582
+ pulumi.log.warn(f"Key '{key}' not found in MatchResourcesPatch. Access the value via the '{suggest}' property getter instead.")
1791
583
 
1792
584
  def __getitem__(self, key: str) -> Any:
1793
- Mutation.__key_warning(key)
585
+ MatchResourcesPatch.__key_warning(key)
1794
586
  return super().__getitem__(key)
1795
587
 
1796
588
  def get(self, key: str, default = None) -> Any:
1797
- Mutation.__key_warning(key)
589
+ MatchResourcesPatch.__key_warning(key)
1798
590
  return super().get(key, default)
1799
591
 
1800
592
  def __init__(__self__, *,
1801
- patch_type: str,
1802
- apply_configuration: Optional['outputs.ApplyConfiguration'] = None,
1803
- json_patch: Optional['outputs.JSONPatch'] = None):
593
+ exclude_resource_rules: Optional[Sequence['outputs.NamedRuleWithOperationsPatch']] = None,
594
+ match_policy: Optional[str] = None,
595
+ namespace_selector: Optional['_meta.v1.outputs.LabelSelectorPatch'] = None,
596
+ object_selector: Optional['_meta.v1.outputs.LabelSelectorPatch'] = None,
597
+ resource_rules: Optional[Sequence['outputs.NamedRuleWithOperationsPatch']] = None):
1804
598
  """
1805
- Mutation specifies the CEL expression which is used to apply the Mutation.
1806
- :param str patch_type: patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
1807
- :param '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.
1808
- :param '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.
599
+ 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)
600
+ :param Sequence['NamedRuleWithOperationsPatchArgs'] 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)
601
+ :param str match_policy: matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
602
+
603
+ - 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.
604
+
605
+ - 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.
606
+
607
+ Defaults to "Equivalent"
608
+ :param '_meta.v1.LabelSelectorPatchArgs' 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.
609
+
610
+ 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": {
611
+ "matchExpressions": [
612
+ {
613
+ "key": "runlevel",
614
+ "operator": "NotIn",
615
+ "values": [
616
+ "0",
617
+ "1"
618
+ ]
619
+ }
620
+ ]
621
+ }
622
+
623
+ 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": {
624
+ "matchExpressions": [
625
+ {
626
+ "key": "environment",
627
+ "operator": "In",
628
+ "values": [
629
+ "prod",
630
+ "staging"
631
+ ]
632
+ }
633
+ ]
634
+ }
635
+
636
+ See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
637
+
638
+ Default to the empty LabelSelector, which matches everything.
639
+ :param '_meta.v1.LabelSelectorPatchArgs' 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.
640
+ :param Sequence['NamedRuleWithOperationsPatchArgs'] resource_rules: ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
1809
641
  """
1810
- pulumi.set(__self__, "patch_type", patch_type)
1811
- if apply_configuration is not None:
1812
- pulumi.set(__self__, "apply_configuration", apply_configuration)
1813
- if json_patch is not None:
1814
- pulumi.set(__self__, "json_patch", json_patch)
642
+ if exclude_resource_rules is not None:
643
+ pulumi.set(__self__, "exclude_resource_rules", exclude_resource_rules)
644
+ if match_policy is not None:
645
+ pulumi.set(__self__, "match_policy", match_policy)
646
+ if namespace_selector is not None:
647
+ pulumi.set(__self__, "namespace_selector", namespace_selector)
648
+ if object_selector is not None:
649
+ pulumi.set(__self__, "object_selector", object_selector)
650
+ if resource_rules is not None:
651
+ pulumi.set(__self__, "resource_rules", resource_rules)
1815
652
 
1816
653
  @property
1817
- @pulumi.getter(name="patchType")
1818
- def patch_type(self) -> str:
654
+ @pulumi.getter(name="excludeResourceRules")
655
+ def exclude_resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperationsPatch']]:
1819
656
  """
1820
- patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
657
+ 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)
1821
658
  """
1822
- return pulumi.get(self, "patch_type")
659
+ return pulumi.get(self, "exclude_resource_rules")
1823
660
 
1824
661
  @property
1825
- @pulumi.getter(name="applyConfiguration")
1826
- def apply_configuration(self) -> Optional['outputs.ApplyConfiguration']:
1827
- """
1828
- 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.
662
+ @pulumi.getter(name="matchPolicy")
663
+ def match_policy(self) -> Optional[str]:
1829
664
  """
1830
- return pulumi.get(self, "apply_configuration")
665
+ matchPolicy defines how the "MatchResources" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
1831
666
 
1832
- @property
1833
- @pulumi.getter(name="jsonPatch")
1834
- def json_patch(self) -> Optional['outputs.JSONPatch']:
1835
- """
1836
- 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.
1837
- """
1838
- return pulumi.get(self, "json_patch")
667
+ - 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.
1839
668
 
669
+ - 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.
1840
670
 
1841
- @pulumi.output_type
1842
- class MutationPatch(dict):
1843
- """
1844
- Mutation specifies the CEL expression which is used to apply the Mutation.
1845
- """
1846
- @staticmethod
1847
- def __key_warning(key: str):
1848
- suggest = None
1849
- if key == "applyConfiguration":
1850
- suggest = "apply_configuration"
1851
- elif key == "jsonPatch":
1852
- suggest = "json_patch"
1853
- elif key == "patchType":
1854
- suggest = "patch_type"
671
+ Defaults to "Equivalent"
672
+ """
673
+ return pulumi.get(self, "match_policy")
1855
674
 
1856
- if suggest:
1857
- pulumi.log.warn(f"Key '{key}' not found in MutationPatch. Access the value via the '{suggest}' property getter instead.")
675
+ @property
676
+ @pulumi.getter(name="namespaceSelector")
677
+ def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:
678
+ """
679
+ 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.
1858
680
 
1859
- def __getitem__(self, key: str) -> Any:
1860
- MutationPatch.__key_warning(key)
1861
- return super().__getitem__(key)
681
+ 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": {
682
+ "matchExpressions": [
683
+ {
684
+ "key": "runlevel",
685
+ "operator": "NotIn",
686
+ "values": [
687
+ "0",
688
+ "1"
689
+ ]
690
+ }
691
+ ]
692
+ }
1862
693
 
1863
- def get(self, key: str, default = None) -> Any:
1864
- MutationPatch.__key_warning(key)
1865
- return super().get(key, default)
694
+ 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": {
695
+ "matchExpressions": [
696
+ {
697
+ "key": "environment",
698
+ "operator": "In",
699
+ "values": [
700
+ "prod",
701
+ "staging"
702
+ ]
703
+ }
704
+ ]
705
+ }
1866
706
 
1867
- def __init__(__self__, *,
1868
- apply_configuration: Optional['outputs.ApplyConfigurationPatch'] = None,
1869
- json_patch: Optional['outputs.JSONPatchPatch'] = None,
1870
- patch_type: Optional[str] = None):
1871
- """
1872
- Mutation specifies the CEL expression which is used to apply the Mutation.
1873
- :param '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.
1874
- :param '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.
1875
- :param str patch_type: patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
1876
- """
1877
- if apply_configuration is not None:
1878
- pulumi.set(__self__, "apply_configuration", apply_configuration)
1879
- if json_patch is not None:
1880
- pulumi.set(__self__, "json_patch", json_patch)
1881
- if patch_type is not None:
1882
- pulumi.set(__self__, "patch_type", patch_type)
707
+ See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
1883
708
 
1884
- @property
1885
- @pulumi.getter(name="applyConfiguration")
1886
- def apply_configuration(self) -> Optional['outputs.ApplyConfigurationPatch']:
1887
- """
1888
- 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.
709
+ Default to the empty LabelSelector, which matches everything.
1889
710
  """
1890
- return pulumi.get(self, "apply_configuration")
711
+ return pulumi.get(self, "namespace_selector")
1891
712
 
1892
713
  @property
1893
- @pulumi.getter(name="jsonPatch")
1894
- def json_patch(self) -> Optional['outputs.JSONPatchPatch']:
714
+ @pulumi.getter(name="objectSelector")
715
+ def object_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:
1895
716
  """
1896
- 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.
717
+ 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.
1897
718
  """
1898
- return pulumi.get(self, "json_patch")
719
+ return pulumi.get(self, "object_selector")
1899
720
 
1900
721
  @property
1901
- @pulumi.getter(name="patchType")
1902
- def patch_type(self) -> Optional[str]:
722
+ @pulumi.getter(name="resourceRules")
723
+ def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperationsPatch']]:
1903
724
  """
1904
- patchType indicates the patch strategy used. Allowed values are "ApplyConfiguration" and "JSONPatch". Required.
725
+ ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
1905
726
  """
1906
- return pulumi.get(self, "patch_type")
727
+ return pulumi.get(self, "resource_rules")
1907
728
 
1908
729
 
1909
730
  @pulumi.output_type
@@ -2622,6 +1443,10 @@ class ValidatingAdmissionPolicy(dict):
2622
1443
  class ValidatingAdmissionPolicyBinding(dict):
2623
1444
  """
2624
1445
  ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
1446
+
1447
+ 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.
1448
+
1449
+ 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.
2625
1450
  """
2626
1451
  @staticmethod
2627
1452
  def __key_warning(key: str):
@@ -2647,6 +1472,10 @@ class ValidatingAdmissionPolicyBinding(dict):
2647
1472
  spec: Optional['outputs.ValidatingAdmissionPolicyBindingSpec'] = None):
2648
1473
  """
2649
1474
  ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
1475
+
1476
+ 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.
1477
+
1478
+ 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.
2650
1479
  :param 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
2651
1480
  :param 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
2652
1481
  :param '_meta.v1.ObjectMetaArgs' metadata: Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
@@ -2730,7 +1559,7 @@ class ValidatingAdmissionPolicyBindingSpec(dict):
2730
1559
  """
2731
1560
  ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
2732
1561
  :param '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.
2733
- :param '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.
1562
+ :param '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.
2734
1563
  :param 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.
2735
1564
  :param Sequence[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.
2736
1565
 
@@ -2773,7 +1602,7 @@ class ValidatingAdmissionPolicyBindingSpec(dict):
2773
1602
  @pulumi.getter(name="paramRef")
2774
1603
  def param_ref(self) -> Optional['outputs.ParamRef']:
2775
1604
  """
2776
- 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.
1605
+ 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.
2777
1606
  """
2778
1607
  return pulumi.get(self, "param_ref")
2779
1608
 
@@ -2848,7 +1677,7 @@ class ValidatingAdmissionPolicyBindingSpecPatch(dict):
2848
1677
  """
2849
1678
  ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
2850
1679
  :param '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.
2851
- :param '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.
1680
+ :param '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.
2852
1681
  :param 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.
2853
1682
  :param Sequence[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.
2854
1683
 
@@ -2891,7 +1720,7 @@ class ValidatingAdmissionPolicyBindingSpecPatch(dict):
2891
1720
  @pulumi.getter(name="paramRef")
2892
1721
  def param_ref(self) -> Optional['outputs.ParamRefPatch']:
2893
1722
  """
2894
- 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.
1723
+ 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.
2895
1724
  """
2896
1725
  return pulumi.get(self, "param_ref")
2897
1726
 
@@ -2970,9 +1799,17 @@ class ValidatingAdmissionPolicySpec(dict):
2970
1799
  variables: Optional[Sequence['outputs.Variable']] = None):
2971
1800
  """
2972
1801
  ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
2973
- :param Sequence['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.
1802
+ :param Sequence['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.
2974
1803
  :param Sequence['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.
2975
- :param 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.
1804
+ :param 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.
1805
+
1806
+ 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.
1807
+
1808
+ failurePolicy does not define how validations that evaluate to false are handled.
1809
+
1810
+ When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
1811
+
1812
+ Allowed values are Ignore or Fail. Defaults to Fail.
2976
1813
  :param Sequence['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.
2977
1814
 
2978
1815
  If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
@@ -3007,7 +1844,7 @@ class ValidatingAdmissionPolicySpec(dict):
3007
1844
  @pulumi.getter
3008
1845
  def validations(self) -> Sequence['outputs.Validation']:
3009
1846
  """
3010
- Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
1847
+ 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.
3011
1848
  """
3012
1849
  return pulumi.get(self, "validations")
3013
1850
 
@@ -3023,7 +1860,15 @@ class ValidatingAdmissionPolicySpec(dict):
3023
1860
  @pulumi.getter(name="failurePolicy")
3024
1861
  def failure_policy(self) -> Optional[str]:
3025
1862
  """
3026
- 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.
1863
+ 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.
1864
+
1865
+ 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.
1866
+
1867
+ failurePolicy does not define how validations that evaluate to false are handled.
1868
+
1869
+ When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
1870
+
1871
+ Allowed values are Ignore or Fail. Defaults to Fail.
3027
1872
  """
3028
1873
  return pulumi.get(self, "failure_policy")
3029
1874
 
@@ -3112,7 +1957,15 @@ class ValidatingAdmissionPolicySpecPatch(dict):
3112
1957
  """
3113
1958
  ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
3114
1959
  :param Sequence['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.
3115
- :param 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.
1960
+ :param 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.
1961
+
1962
+ 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.
1963
+
1964
+ failurePolicy does not define how validations that evaluate to false are handled.
1965
+
1966
+ When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
1967
+
1968
+ Allowed values are Ignore or Fail. Defaults to Fail.
3116
1969
  :param Sequence['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.
3117
1970
 
3118
1971
  If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
@@ -3125,7 +1978,7 @@ class ValidatingAdmissionPolicySpecPatch(dict):
3125
1978
  - If failurePolicy=Ignore, the policy is skipped
3126
1979
  :param '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.
3127
1980
  :param '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.
3128
- :param Sequence['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.
1981
+ :param Sequence['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.
3129
1982
  :param Sequence['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.
3130
1983
 
3131
1984
  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.
@@ -3157,7 +2010,15 @@ class ValidatingAdmissionPolicySpecPatch(dict):
3157
2010
  @pulumi.getter(name="failurePolicy")
3158
2011
  def failure_policy(self) -> Optional[str]:
3159
2012
  """
3160
- 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.
2013
+ 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.
2014
+
2015
+ 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.
2016
+
2017
+ failurePolicy does not define how validations that evaluate to false are handled.
2018
+
2019
+ When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
2020
+
2021
+ Allowed values are Ignore or Fail. Defaults to Fail.
3161
2022
  """
3162
2023
  return pulumi.get(self, "failure_policy")
3163
2024
 
@@ -3198,7 +2059,7 @@ class ValidatingAdmissionPolicySpecPatch(dict):
3198
2059
  @pulumi.getter
3199
2060
  def validations(self) -> Optional[Sequence['outputs.ValidationPatch']]:
3200
2061
  """
3201
- Validations contain CEL expressions which is used to apply the validation. A minimum of one validation is required for a policy definition. Required.
2062
+ 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.
3202
2063
  """
3203
2064
  return pulumi.get(self, "validations")
3204
2065
 
@@ -3374,9 +2235,14 @@ class Validation(dict):
3374
2235
  reason: Optional[str] = None):
3375
2236
  """
3376
2237
  Validation specifies the CEL expression which is used to apply the validation.
3377
- :param 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:
2238
+ :param 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:
3378
2239
 
3379
- '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.
2240
+ - '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.
2241
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
2242
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2243
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2244
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2245
+ request resource.
3380
2246
 
3381
2247
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
3382
2248
 
@@ -3411,9 +2277,14 @@ class Validation(dict):
3411
2277
  @pulumi.getter
3412
2278
  def expression(self) -> str:
3413
2279
  """
3414
- 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:
2280
+ 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:
3415
2281
 
3416
- '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.
2282
+ - '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.
2283
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
2284
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2285
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2286
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2287
+ request resource.
3417
2288
 
3418
2289
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
3419
2290
 
@@ -3489,9 +2360,14 @@ class ValidationPatch(dict):
3489
2360
  reason: Optional[str] = None):
3490
2361
  """
3491
2362
  Validation specifies the CEL expression which is used to apply the validation.
3492
- :param 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:
2363
+ :param 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:
3493
2364
 
3494
- '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.
2365
+ - '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.
2366
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
2367
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2368
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2369
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2370
+ request resource.
3495
2371
 
3496
2372
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
3497
2373
 
@@ -3527,9 +2403,14 @@ class ValidationPatch(dict):
3527
2403
  @pulumi.getter
3528
2404
  def expression(self) -> Optional[str]:
3529
2405
  """
3530
- 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:
2406
+ 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:
3531
2407
 
3532
- '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.
2408
+ - '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.
2409
+ For example, a variable named 'foo' can be accessed as 'variables.foo'.
2410
+ - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
2411
+ See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
2412
+ - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
2413
+ request resource.
3533
2414
 
3534
2415
  The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object. No other metadata properties are accessible.
3535
2416