github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/policy/v1beta1/podSecurityPolicyPatch.go (about) 1 // Code generated by pulumigen DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package v1beta1 5 6 import ( 7 "context" 8 "reflect" 9 10 metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Patch resources are used to modify existing Kubernetes resources by using 15 // Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than 16 // one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource. 17 // Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the 18 // [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for 19 // additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi. 20 // PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. 21 type PodSecurityPolicyPatch struct { 22 pulumi.CustomResourceState 23 24 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 25 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 26 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 27 Kind pulumi.StringPtrOutput `pulumi:"kind"` 28 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 29 Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"` 30 // spec defines the policy enforced. 31 Spec PodSecurityPolicySpecPatchPtrOutput `pulumi:"spec"` 32 } 33 34 // NewPodSecurityPolicyPatch registers a new resource with the given unique name, arguments, and options. 35 func NewPodSecurityPolicyPatch(ctx *pulumi.Context, 36 name string, args *PodSecurityPolicyPatchArgs, opts ...pulumi.ResourceOption) (*PodSecurityPolicyPatch, error) { 37 if args == nil { 38 args = &PodSecurityPolicyPatchArgs{} 39 } 40 41 args.ApiVersion = pulumi.StringPtr("policy/v1beta1") 42 args.Kind = pulumi.StringPtr("PodSecurityPolicy") 43 aliases := pulumi.Aliases([]pulumi.Alias{ 44 { 45 Type: pulumi.String("kubernetes:extensions/v1beta1:PodSecurityPolicyPatch"), 46 }, 47 }) 48 opts = append(opts, aliases) 49 var resource PodSecurityPolicyPatch 50 err := ctx.RegisterResource("kubernetes:policy/v1beta1:PodSecurityPolicyPatch", name, args, &resource, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return &resource, nil 55 } 56 57 // GetPodSecurityPolicyPatch gets an existing PodSecurityPolicyPatch resource's state with the given name, ID, and optional 58 // state properties that are used to uniquely qualify the lookup (nil if not required). 59 func GetPodSecurityPolicyPatch(ctx *pulumi.Context, 60 name string, id pulumi.IDInput, state *PodSecurityPolicyPatchState, opts ...pulumi.ResourceOption) (*PodSecurityPolicyPatch, error) { 61 var resource PodSecurityPolicyPatch 62 err := ctx.ReadResource("kubernetes:policy/v1beta1:PodSecurityPolicyPatch", name, id, state, &resource, opts...) 63 if err != nil { 64 return nil, err 65 } 66 return &resource, nil 67 } 68 69 // Input properties used for looking up and filtering PodSecurityPolicyPatch resources. 70 type podSecurityPolicyPatchState struct { 71 } 72 73 type PodSecurityPolicyPatchState struct { 74 } 75 76 func (PodSecurityPolicyPatchState) ElementType() reflect.Type { 77 return reflect.TypeOf((*podSecurityPolicyPatchState)(nil)).Elem() 78 } 79 80 type podSecurityPolicyPatchArgs struct { 81 // 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 82 ApiVersion *string `pulumi:"apiVersion"` 83 // 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 84 Kind *string `pulumi:"kind"` 85 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 86 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 87 // spec defines the policy enforced. 88 Spec *PodSecurityPolicySpecPatch `pulumi:"spec"` 89 } 90 91 // The set of arguments for constructing a PodSecurityPolicyPatch resource. 92 type PodSecurityPolicyPatchArgs struct { 93 // 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 94 ApiVersion pulumi.StringPtrInput 95 // 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 96 Kind pulumi.StringPtrInput 97 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 98 Metadata metav1.ObjectMetaPatchPtrInput 99 // spec defines the policy enforced. 100 Spec PodSecurityPolicySpecPatchPtrInput 101 } 102 103 func (PodSecurityPolicyPatchArgs) ElementType() reflect.Type { 104 return reflect.TypeOf((*podSecurityPolicyPatchArgs)(nil)).Elem() 105 } 106 107 type PodSecurityPolicyPatchInput interface { 108 pulumi.Input 109 110 ToPodSecurityPolicyPatchOutput() PodSecurityPolicyPatchOutput 111 ToPodSecurityPolicyPatchOutputWithContext(ctx context.Context) PodSecurityPolicyPatchOutput 112 } 113 114 func (*PodSecurityPolicyPatch) ElementType() reflect.Type { 115 return reflect.TypeOf((**PodSecurityPolicyPatch)(nil)).Elem() 116 } 117 118 func (i *PodSecurityPolicyPatch) ToPodSecurityPolicyPatchOutput() PodSecurityPolicyPatchOutput { 119 return i.ToPodSecurityPolicyPatchOutputWithContext(context.Background()) 120 } 121 122 func (i *PodSecurityPolicyPatch) ToPodSecurityPolicyPatchOutputWithContext(ctx context.Context) PodSecurityPolicyPatchOutput { 123 return pulumi.ToOutputWithContext(ctx, i).(PodSecurityPolicyPatchOutput) 124 } 125 126 // PodSecurityPolicyPatchArrayInput is an input type that accepts PodSecurityPolicyPatchArray and PodSecurityPolicyPatchArrayOutput values. 127 // You can construct a concrete instance of `PodSecurityPolicyPatchArrayInput` via: 128 // 129 // PodSecurityPolicyPatchArray{ PodSecurityPolicyPatchArgs{...} } 130 type PodSecurityPolicyPatchArrayInput interface { 131 pulumi.Input 132 133 ToPodSecurityPolicyPatchArrayOutput() PodSecurityPolicyPatchArrayOutput 134 ToPodSecurityPolicyPatchArrayOutputWithContext(context.Context) PodSecurityPolicyPatchArrayOutput 135 } 136 137 type PodSecurityPolicyPatchArray []PodSecurityPolicyPatchInput 138 139 func (PodSecurityPolicyPatchArray) ElementType() reflect.Type { 140 return reflect.TypeOf((*[]*PodSecurityPolicyPatch)(nil)).Elem() 141 } 142 143 func (i PodSecurityPolicyPatchArray) ToPodSecurityPolicyPatchArrayOutput() PodSecurityPolicyPatchArrayOutput { 144 return i.ToPodSecurityPolicyPatchArrayOutputWithContext(context.Background()) 145 } 146 147 func (i PodSecurityPolicyPatchArray) ToPodSecurityPolicyPatchArrayOutputWithContext(ctx context.Context) PodSecurityPolicyPatchArrayOutput { 148 return pulumi.ToOutputWithContext(ctx, i).(PodSecurityPolicyPatchArrayOutput) 149 } 150 151 // PodSecurityPolicyPatchMapInput is an input type that accepts PodSecurityPolicyPatchMap and PodSecurityPolicyPatchMapOutput values. 152 // You can construct a concrete instance of `PodSecurityPolicyPatchMapInput` via: 153 // 154 // PodSecurityPolicyPatchMap{ "key": PodSecurityPolicyPatchArgs{...} } 155 type PodSecurityPolicyPatchMapInput interface { 156 pulumi.Input 157 158 ToPodSecurityPolicyPatchMapOutput() PodSecurityPolicyPatchMapOutput 159 ToPodSecurityPolicyPatchMapOutputWithContext(context.Context) PodSecurityPolicyPatchMapOutput 160 } 161 162 type PodSecurityPolicyPatchMap map[string]PodSecurityPolicyPatchInput 163 164 func (PodSecurityPolicyPatchMap) ElementType() reflect.Type { 165 return reflect.TypeOf((*map[string]*PodSecurityPolicyPatch)(nil)).Elem() 166 } 167 168 func (i PodSecurityPolicyPatchMap) ToPodSecurityPolicyPatchMapOutput() PodSecurityPolicyPatchMapOutput { 169 return i.ToPodSecurityPolicyPatchMapOutputWithContext(context.Background()) 170 } 171 172 func (i PodSecurityPolicyPatchMap) ToPodSecurityPolicyPatchMapOutputWithContext(ctx context.Context) PodSecurityPolicyPatchMapOutput { 173 return pulumi.ToOutputWithContext(ctx, i).(PodSecurityPolicyPatchMapOutput) 174 } 175 176 type PodSecurityPolicyPatchOutput struct{ *pulumi.OutputState } 177 178 func (PodSecurityPolicyPatchOutput) ElementType() reflect.Type { 179 return reflect.TypeOf((**PodSecurityPolicyPatch)(nil)).Elem() 180 } 181 182 func (o PodSecurityPolicyPatchOutput) ToPodSecurityPolicyPatchOutput() PodSecurityPolicyPatchOutput { 183 return o 184 } 185 186 func (o PodSecurityPolicyPatchOutput) ToPodSecurityPolicyPatchOutputWithContext(ctx context.Context) PodSecurityPolicyPatchOutput { 187 return o 188 } 189 190 // 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 191 func (o PodSecurityPolicyPatchOutput) ApiVersion() pulumi.StringPtrOutput { 192 return o.ApplyT(func(v *PodSecurityPolicyPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 193 } 194 195 // 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 196 func (o PodSecurityPolicyPatchOutput) Kind() pulumi.StringPtrOutput { 197 return o.ApplyT(func(v *PodSecurityPolicyPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 198 } 199 200 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 201 func (o PodSecurityPolicyPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 202 return o.ApplyT(func(v *PodSecurityPolicyPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 203 } 204 205 // spec defines the policy enforced. 206 func (o PodSecurityPolicyPatchOutput) Spec() PodSecurityPolicySpecPatchPtrOutput { 207 return o.ApplyT(func(v *PodSecurityPolicyPatch) PodSecurityPolicySpecPatchPtrOutput { return v.Spec }).(PodSecurityPolicySpecPatchPtrOutput) 208 } 209 210 type PodSecurityPolicyPatchArrayOutput struct{ *pulumi.OutputState } 211 212 func (PodSecurityPolicyPatchArrayOutput) ElementType() reflect.Type { 213 return reflect.TypeOf((*[]*PodSecurityPolicyPatch)(nil)).Elem() 214 } 215 216 func (o PodSecurityPolicyPatchArrayOutput) ToPodSecurityPolicyPatchArrayOutput() PodSecurityPolicyPatchArrayOutput { 217 return o 218 } 219 220 func (o PodSecurityPolicyPatchArrayOutput) ToPodSecurityPolicyPatchArrayOutputWithContext(ctx context.Context) PodSecurityPolicyPatchArrayOutput { 221 return o 222 } 223 224 func (o PodSecurityPolicyPatchArrayOutput) Index(i pulumi.IntInput) PodSecurityPolicyPatchOutput { 225 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodSecurityPolicyPatch { 226 return vs[0].([]*PodSecurityPolicyPatch)[vs[1].(int)] 227 }).(PodSecurityPolicyPatchOutput) 228 } 229 230 type PodSecurityPolicyPatchMapOutput struct{ *pulumi.OutputState } 231 232 func (PodSecurityPolicyPatchMapOutput) ElementType() reflect.Type { 233 return reflect.TypeOf((*map[string]*PodSecurityPolicyPatch)(nil)).Elem() 234 } 235 236 func (o PodSecurityPolicyPatchMapOutput) ToPodSecurityPolicyPatchMapOutput() PodSecurityPolicyPatchMapOutput { 237 return o 238 } 239 240 func (o PodSecurityPolicyPatchMapOutput) ToPodSecurityPolicyPatchMapOutputWithContext(ctx context.Context) PodSecurityPolicyPatchMapOutput { 241 return o 242 } 243 244 func (o PodSecurityPolicyPatchMapOutput) MapIndex(k pulumi.StringInput) PodSecurityPolicyPatchOutput { 245 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodSecurityPolicyPatch { 246 return vs[0].(map[string]*PodSecurityPolicyPatch)[vs[1].(string)] 247 }).(PodSecurityPolicyPatchOutput) 248 } 249 250 func init() { 251 pulumi.RegisterInputType(reflect.TypeOf((*PodSecurityPolicyPatchInput)(nil)).Elem(), &PodSecurityPolicyPatch{}) 252 pulumi.RegisterInputType(reflect.TypeOf((*PodSecurityPolicyPatchArrayInput)(nil)).Elem(), PodSecurityPolicyPatchArray{}) 253 pulumi.RegisterInputType(reflect.TypeOf((*PodSecurityPolicyPatchMapInput)(nil)).Elem(), PodSecurityPolicyPatchMap{}) 254 pulumi.RegisterOutputType(PodSecurityPolicyPatchOutput{}) 255 pulumi.RegisterOutputType(PodSecurityPolicyPatchArrayOutput{}) 256 pulumi.RegisterOutputType(PodSecurityPolicyPatchMapOutput{}) 257 }