github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/serviceAccountPatch.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 v1 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 // ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets 21 type ServiceAccountPatch 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 // AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level. 27 AutomountServiceAccountToken pulumi.BoolPtrOutput `pulumi:"automountServiceAccountToken"` 28 // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod 29 ImagePullSecrets LocalObjectReferencePatchArrayOutput `pulumi:"imagePullSecrets"` 30 // 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 31 Kind pulumi.StringPtrOutput `pulumi:"kind"` 32 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 33 Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"` 34 // Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a "kubernetes.io/enforce-mountable-secrets" annotation set to "true". This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret 35 Secrets ObjectReferencePatchArrayOutput `pulumi:"secrets"` 36 } 37 38 // NewServiceAccountPatch registers a new resource with the given unique name, arguments, and options. 39 func NewServiceAccountPatch(ctx *pulumi.Context, 40 name string, args *ServiceAccountPatchArgs, opts ...pulumi.ResourceOption) (*ServiceAccountPatch, error) { 41 if args == nil { 42 args = &ServiceAccountPatchArgs{} 43 } 44 45 args.ApiVersion = pulumi.StringPtr("v1") 46 args.Kind = pulumi.StringPtr("ServiceAccount") 47 var resource ServiceAccountPatch 48 err := ctx.RegisterResource("kubernetes:core/v1:ServiceAccountPatch", name, args, &resource, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &resource, nil 53 } 54 55 // GetServiceAccountPatch gets an existing ServiceAccountPatch resource's state with the given name, ID, and optional 56 // state properties that are used to uniquely qualify the lookup (nil if not required). 57 func GetServiceAccountPatch(ctx *pulumi.Context, 58 name string, id pulumi.IDInput, state *ServiceAccountPatchState, opts ...pulumi.ResourceOption) (*ServiceAccountPatch, error) { 59 var resource ServiceAccountPatch 60 err := ctx.ReadResource("kubernetes:core/v1:ServiceAccountPatch", name, id, state, &resource, opts...) 61 if err != nil { 62 return nil, err 63 } 64 return &resource, nil 65 } 66 67 // Input properties used for looking up and filtering ServiceAccountPatch resources. 68 type serviceAccountPatchState struct { 69 } 70 71 type ServiceAccountPatchState struct { 72 } 73 74 func (ServiceAccountPatchState) ElementType() reflect.Type { 75 return reflect.TypeOf((*serviceAccountPatchState)(nil)).Elem() 76 } 77 78 type serviceAccountPatchArgs struct { 79 // 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 80 ApiVersion *string `pulumi:"apiVersion"` 81 // AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level. 82 AutomountServiceAccountToken *bool `pulumi:"automountServiceAccountToken"` 83 // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod 84 ImagePullSecrets []LocalObjectReferencePatch `pulumi:"imagePullSecrets"` 85 // 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 86 Kind *string `pulumi:"kind"` 87 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 88 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 89 // Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a "kubernetes.io/enforce-mountable-secrets" annotation set to "true". This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret 90 Secrets []ObjectReferencePatch `pulumi:"secrets"` 91 } 92 93 // The set of arguments for constructing a ServiceAccountPatch resource. 94 type ServiceAccountPatchArgs struct { 95 // 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 96 ApiVersion pulumi.StringPtrInput 97 // AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level. 98 AutomountServiceAccountToken pulumi.BoolPtrInput 99 // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod 100 ImagePullSecrets LocalObjectReferencePatchArrayInput 101 // 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 102 Kind pulumi.StringPtrInput 103 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 104 Metadata metav1.ObjectMetaPatchPtrInput 105 // Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a "kubernetes.io/enforce-mountable-secrets" annotation set to "true". This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret 106 Secrets ObjectReferencePatchArrayInput 107 } 108 109 func (ServiceAccountPatchArgs) ElementType() reflect.Type { 110 return reflect.TypeOf((*serviceAccountPatchArgs)(nil)).Elem() 111 } 112 113 type ServiceAccountPatchInput interface { 114 pulumi.Input 115 116 ToServiceAccountPatchOutput() ServiceAccountPatchOutput 117 ToServiceAccountPatchOutputWithContext(ctx context.Context) ServiceAccountPatchOutput 118 } 119 120 func (*ServiceAccountPatch) ElementType() reflect.Type { 121 return reflect.TypeOf((**ServiceAccountPatch)(nil)).Elem() 122 } 123 124 func (i *ServiceAccountPatch) ToServiceAccountPatchOutput() ServiceAccountPatchOutput { 125 return i.ToServiceAccountPatchOutputWithContext(context.Background()) 126 } 127 128 func (i *ServiceAccountPatch) ToServiceAccountPatchOutputWithContext(ctx context.Context) ServiceAccountPatchOutput { 129 return pulumi.ToOutputWithContext(ctx, i).(ServiceAccountPatchOutput) 130 } 131 132 // ServiceAccountPatchArrayInput is an input type that accepts ServiceAccountPatchArray and ServiceAccountPatchArrayOutput values. 133 // You can construct a concrete instance of `ServiceAccountPatchArrayInput` via: 134 // 135 // ServiceAccountPatchArray{ ServiceAccountPatchArgs{...} } 136 type ServiceAccountPatchArrayInput interface { 137 pulumi.Input 138 139 ToServiceAccountPatchArrayOutput() ServiceAccountPatchArrayOutput 140 ToServiceAccountPatchArrayOutputWithContext(context.Context) ServiceAccountPatchArrayOutput 141 } 142 143 type ServiceAccountPatchArray []ServiceAccountPatchInput 144 145 func (ServiceAccountPatchArray) ElementType() reflect.Type { 146 return reflect.TypeOf((*[]*ServiceAccountPatch)(nil)).Elem() 147 } 148 149 func (i ServiceAccountPatchArray) ToServiceAccountPatchArrayOutput() ServiceAccountPatchArrayOutput { 150 return i.ToServiceAccountPatchArrayOutputWithContext(context.Background()) 151 } 152 153 func (i ServiceAccountPatchArray) ToServiceAccountPatchArrayOutputWithContext(ctx context.Context) ServiceAccountPatchArrayOutput { 154 return pulumi.ToOutputWithContext(ctx, i).(ServiceAccountPatchArrayOutput) 155 } 156 157 // ServiceAccountPatchMapInput is an input type that accepts ServiceAccountPatchMap and ServiceAccountPatchMapOutput values. 158 // You can construct a concrete instance of `ServiceAccountPatchMapInput` via: 159 // 160 // ServiceAccountPatchMap{ "key": ServiceAccountPatchArgs{...} } 161 type ServiceAccountPatchMapInput interface { 162 pulumi.Input 163 164 ToServiceAccountPatchMapOutput() ServiceAccountPatchMapOutput 165 ToServiceAccountPatchMapOutputWithContext(context.Context) ServiceAccountPatchMapOutput 166 } 167 168 type ServiceAccountPatchMap map[string]ServiceAccountPatchInput 169 170 func (ServiceAccountPatchMap) ElementType() reflect.Type { 171 return reflect.TypeOf((*map[string]*ServiceAccountPatch)(nil)).Elem() 172 } 173 174 func (i ServiceAccountPatchMap) ToServiceAccountPatchMapOutput() ServiceAccountPatchMapOutput { 175 return i.ToServiceAccountPatchMapOutputWithContext(context.Background()) 176 } 177 178 func (i ServiceAccountPatchMap) ToServiceAccountPatchMapOutputWithContext(ctx context.Context) ServiceAccountPatchMapOutput { 179 return pulumi.ToOutputWithContext(ctx, i).(ServiceAccountPatchMapOutput) 180 } 181 182 type ServiceAccountPatchOutput struct{ *pulumi.OutputState } 183 184 func (ServiceAccountPatchOutput) ElementType() reflect.Type { 185 return reflect.TypeOf((**ServiceAccountPatch)(nil)).Elem() 186 } 187 188 func (o ServiceAccountPatchOutput) ToServiceAccountPatchOutput() ServiceAccountPatchOutput { 189 return o 190 } 191 192 func (o ServiceAccountPatchOutput) ToServiceAccountPatchOutputWithContext(ctx context.Context) ServiceAccountPatchOutput { 193 return o 194 } 195 196 // 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 197 func (o ServiceAccountPatchOutput) ApiVersion() pulumi.StringPtrOutput { 198 return o.ApplyT(func(v *ServiceAccountPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 199 } 200 201 // AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level. 202 func (o ServiceAccountPatchOutput) AutomountServiceAccountToken() pulumi.BoolPtrOutput { 203 return o.ApplyT(func(v *ServiceAccountPatch) pulumi.BoolPtrOutput { return v.AutomountServiceAccountToken }).(pulumi.BoolPtrOutput) 204 } 205 206 // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod 207 func (o ServiceAccountPatchOutput) ImagePullSecrets() LocalObjectReferencePatchArrayOutput { 208 return o.ApplyT(func(v *ServiceAccountPatch) LocalObjectReferencePatchArrayOutput { return v.ImagePullSecrets }).(LocalObjectReferencePatchArrayOutput) 209 } 210 211 // 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 212 func (o ServiceAccountPatchOutput) Kind() pulumi.StringPtrOutput { 213 return o.ApplyT(func(v *ServiceAccountPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 214 } 215 216 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 217 func (o ServiceAccountPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 218 return o.ApplyT(func(v *ServiceAccountPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 219 } 220 221 // Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a "kubernetes.io/enforce-mountable-secrets" annotation set to "true". This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret 222 func (o ServiceAccountPatchOutput) Secrets() ObjectReferencePatchArrayOutput { 223 return o.ApplyT(func(v *ServiceAccountPatch) ObjectReferencePatchArrayOutput { return v.Secrets }).(ObjectReferencePatchArrayOutput) 224 } 225 226 type ServiceAccountPatchArrayOutput struct{ *pulumi.OutputState } 227 228 func (ServiceAccountPatchArrayOutput) ElementType() reflect.Type { 229 return reflect.TypeOf((*[]*ServiceAccountPatch)(nil)).Elem() 230 } 231 232 func (o ServiceAccountPatchArrayOutput) ToServiceAccountPatchArrayOutput() ServiceAccountPatchArrayOutput { 233 return o 234 } 235 236 func (o ServiceAccountPatchArrayOutput) ToServiceAccountPatchArrayOutputWithContext(ctx context.Context) ServiceAccountPatchArrayOutput { 237 return o 238 } 239 240 func (o ServiceAccountPatchArrayOutput) Index(i pulumi.IntInput) ServiceAccountPatchOutput { 241 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceAccountPatch { 242 return vs[0].([]*ServiceAccountPatch)[vs[1].(int)] 243 }).(ServiceAccountPatchOutput) 244 } 245 246 type ServiceAccountPatchMapOutput struct{ *pulumi.OutputState } 247 248 func (ServiceAccountPatchMapOutput) ElementType() reflect.Type { 249 return reflect.TypeOf((*map[string]*ServiceAccountPatch)(nil)).Elem() 250 } 251 252 func (o ServiceAccountPatchMapOutput) ToServiceAccountPatchMapOutput() ServiceAccountPatchMapOutput { 253 return o 254 } 255 256 func (o ServiceAccountPatchMapOutput) ToServiceAccountPatchMapOutputWithContext(ctx context.Context) ServiceAccountPatchMapOutput { 257 return o 258 } 259 260 func (o ServiceAccountPatchMapOutput) MapIndex(k pulumi.StringInput) ServiceAccountPatchOutput { 261 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceAccountPatch { 262 return vs[0].(map[string]*ServiceAccountPatch)[vs[1].(string)] 263 }).(ServiceAccountPatchOutput) 264 } 265 266 func init() { 267 pulumi.RegisterInputType(reflect.TypeOf((*ServiceAccountPatchInput)(nil)).Elem(), &ServiceAccountPatch{}) 268 pulumi.RegisterInputType(reflect.TypeOf((*ServiceAccountPatchArrayInput)(nil)).Elem(), ServiceAccountPatchArray{}) 269 pulumi.RegisterInputType(reflect.TypeOf((*ServiceAccountPatchMapInput)(nil)).Elem(), ServiceAccountPatchMap{}) 270 pulumi.RegisterOutputType(ServiceAccountPatchOutput{}) 271 pulumi.RegisterOutputType(ServiceAccountPatchArrayOutput{}) 272 pulumi.RegisterOutputType(ServiceAccountPatchMapOutput{}) 273 }