/
api.go
10521 lines (9050 loc) · 370 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package eks
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/restjson"
)
const opAssociateEncryptionConfig = "AssociateEncryptionConfig"
// AssociateEncryptionConfigRequest generates a "aws/request.Request" representing the
// client's request for the AssociateEncryptionConfig operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AssociateEncryptionConfig for more information on using the AssociateEncryptionConfig
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AssociateEncryptionConfigRequest method.
// req, resp := client.AssociateEncryptionConfigRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/AssociateEncryptionConfig
func (c *EKS) AssociateEncryptionConfigRequest(input *AssociateEncryptionConfigInput) (req *request.Request, output *AssociateEncryptionConfigOutput) {
op := &request.Operation{
Name: opAssociateEncryptionConfig,
HTTPMethod: "POST",
HTTPPath: "/clusters/{name}/encryption-config/associate",
}
if input == nil {
input = &AssociateEncryptionConfigInput{}
}
output = &AssociateEncryptionConfigOutput{}
req = c.newRequest(op, input, output)
return
}
// AssociateEncryptionConfig API operation for Amazon Elastic Kubernetes Service.
//
// Associate encryption configuration to an existing cluster.
//
// You can use this API to enable encryption on existing clusters which do not
// have encryption already enabled. This allows you to implement a defense-in-depth
// security strategy without migrating applications to new EKS clusters.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation AssociateEncryptionConfig for usage and error information.
//
// Returned Error Types:
// * InvalidParameterException
// The specified parameter is invalid. Review the available parameters for the
// API request.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * ResourceNotFoundException
// The specified resource could not be found. You can view your available clusters
// with ListClusters. You can view your available managed node groups with ListNodegroups.
// Amazon EKS clusters and node groups are Region-specific.
//
// * InvalidRequestException
// The request is invalid given the state of the cluster. Check the state of
// the cluster and the associated operations.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/AssociateEncryptionConfig
func (c *EKS) AssociateEncryptionConfig(input *AssociateEncryptionConfigInput) (*AssociateEncryptionConfigOutput, error) {
req, out := c.AssociateEncryptionConfigRequest(input)
return out, req.Send()
}
// AssociateEncryptionConfigWithContext is the same as AssociateEncryptionConfig with the addition of
// the ability to pass a context and additional request options.
//
// See AssociateEncryptionConfig for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *EKS) AssociateEncryptionConfigWithContext(ctx aws.Context, input *AssociateEncryptionConfigInput, opts ...request.Option) (*AssociateEncryptionConfigOutput, error) {
req, out := c.AssociateEncryptionConfigRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAssociateIdentityProviderConfig = "AssociateIdentityProviderConfig"
// AssociateIdentityProviderConfigRequest generates a "aws/request.Request" representing the
// client's request for the AssociateIdentityProviderConfig operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AssociateIdentityProviderConfig for more information on using the AssociateIdentityProviderConfig
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AssociateIdentityProviderConfigRequest method.
// req, resp := client.AssociateIdentityProviderConfigRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/AssociateIdentityProviderConfig
func (c *EKS) AssociateIdentityProviderConfigRequest(input *AssociateIdentityProviderConfigInput) (req *request.Request, output *AssociateIdentityProviderConfigOutput) {
op := &request.Operation{
Name: opAssociateIdentityProviderConfig,
HTTPMethod: "POST",
HTTPPath: "/clusters/{name}/identity-provider-configs/associate",
}
if input == nil {
input = &AssociateIdentityProviderConfigInput{}
}
output = &AssociateIdentityProviderConfigOutput{}
req = c.newRequest(op, input, output)
return
}
// AssociateIdentityProviderConfig API operation for Amazon Elastic Kubernetes Service.
//
// Associate an identity provider configuration to a cluster.
//
// If you want to authenticate identities using an identity provider, you can
// create an identity provider configuration and associate it to your cluster.
// After configuring authentication to your cluster you can create Kubernetes
// roles and clusterroles to assign permissions to the roles, and then bind
// the roles to the identities using Kubernetes rolebindings and clusterrolebindings.
// For more information see Using RBAC Authorization (https://kubernetes.io/docs/reference/access-authn-authz/rbac/)
// in the Kubernetes documentation.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation AssociateIdentityProviderConfig for usage and error information.
//
// Returned Error Types:
// * InvalidParameterException
// The specified parameter is invalid. Review the available parameters for the
// API request.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * ResourceNotFoundException
// The specified resource could not be found. You can view your available clusters
// with ListClusters. You can view your available managed node groups with ListNodegroups.
// Amazon EKS clusters and node groups are Region-specific.
//
// * InvalidRequestException
// The request is invalid given the state of the cluster. Check the state of
// the cluster and the associated operations.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/AssociateIdentityProviderConfig
func (c *EKS) AssociateIdentityProviderConfig(input *AssociateIdentityProviderConfigInput) (*AssociateIdentityProviderConfigOutput, error) {
req, out := c.AssociateIdentityProviderConfigRequest(input)
return out, req.Send()
}
// AssociateIdentityProviderConfigWithContext is the same as AssociateIdentityProviderConfig with the addition of
// the ability to pass a context and additional request options.
//
// See AssociateIdentityProviderConfig for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *EKS) AssociateIdentityProviderConfigWithContext(ctx aws.Context, input *AssociateIdentityProviderConfigInput, opts ...request.Option) (*AssociateIdentityProviderConfigOutput, error) {
req, out := c.AssociateIdentityProviderConfigRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateAddon = "CreateAddon"
// CreateAddonRequest generates a "aws/request.Request" representing the
// client's request for the CreateAddon operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateAddon for more information on using the CreateAddon
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateAddonRequest method.
// req, resp := client.CreateAddonRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateAddon
func (c *EKS) CreateAddonRequest(input *CreateAddonInput) (req *request.Request, output *CreateAddonOutput) {
op := &request.Operation{
Name: opCreateAddon,
HTTPMethod: "POST",
HTTPPath: "/clusters/{name}/addons",
}
if input == nil {
input = &CreateAddonInput{}
}
output = &CreateAddonOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateAddon API operation for Amazon Elastic Kubernetes Service.
//
// Creates an Amazon EKS add-on.
//
// Amazon EKS add-ons help to automate the provisioning and lifecycle management
// of common operational software for Amazon EKS clusters. Amazon EKS add-ons
// can only be used with Amazon EKS clusters running version 1.18 with platform
// version eks.3 or later because add-ons rely on the Server-side Apply Kubernetes
// feature, which is only available in Kubernetes 1.18 and later.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation CreateAddon for usage and error information.
//
// Returned Error Types:
// * InvalidParameterException
// The specified parameter is invalid. Review the available parameters for the
// API request.
//
// * InvalidRequestException
// The request is invalid given the state of the cluster. Check the state of
// the cluster and the associated operations.
//
// * ResourceNotFoundException
// The specified resource could not be found. You can view your available clusters
// with ListClusters. You can view your available managed node groups with ListNodegroups.
// Amazon EKS clusters and node groups are Region-specific.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateAddon
func (c *EKS) CreateAddon(input *CreateAddonInput) (*CreateAddonOutput, error) {
req, out := c.CreateAddonRequest(input)
return out, req.Send()
}
// CreateAddonWithContext is the same as CreateAddon with the addition of
// the ability to pass a context and additional request options.
//
// See CreateAddon for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *EKS) CreateAddonWithContext(ctx aws.Context, input *CreateAddonInput, opts ...request.Option) (*CreateAddonOutput, error) {
req, out := c.CreateAddonRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateCluster = "CreateCluster"
// CreateClusterRequest generates a "aws/request.Request" representing the
// client's request for the CreateCluster operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateCluster for more information on using the CreateCluster
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateClusterRequest method.
// req, resp := client.CreateClusterRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateCluster
func (c *EKS) CreateClusterRequest(input *CreateClusterInput) (req *request.Request, output *CreateClusterOutput) {
op := &request.Operation{
Name: opCreateCluster,
HTTPMethod: "POST",
HTTPPath: "/clusters",
}
if input == nil {
input = &CreateClusterInput{}
}
output = &CreateClusterOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateCluster API operation for Amazon Elastic Kubernetes Service.
//
// Creates an Amazon EKS control plane.
//
// The Amazon EKS control plane consists of control plane instances that run
// the Kubernetes software, such as etcd and the API server. The control plane
// runs in an account managed by AWS, and the Kubernetes API is exposed via
// the Amazon EKS API server endpoint. Each Amazon EKS cluster control plane
// is single-tenant and unique and runs on its own set of Amazon EC2 instances.
//
// The cluster control plane is provisioned across multiple Availability Zones
// and fronted by an Elastic Load Balancing Network Load Balancer. Amazon EKS
// also provisions elastic network interfaces in your VPC subnets to provide
// connectivity from the control plane instances to the nodes (for example,
// to support kubectl exec, logs, and proxy data flows).
//
// Amazon EKS nodes run in your AWS account and connect to your cluster's control
// plane via the Kubernetes API server endpoint and a certificate file that
// is created for your cluster.
//
// Cluster creation typically takes several minutes. After you create an Amazon
// EKS cluster, you must configure your Kubernetes tooling to communicate with
// the API server and launch nodes into your cluster. For more information,
// see Managing Cluster Authentication (https://docs.aws.amazon.com/eks/latest/userguide/managing-auth.html)
// and Launching Amazon EKS nodes (https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html)
// in the Amazon EKS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation CreateCluster for usage and error information.
//
// Returned Error Types:
// * ResourceInUseException
// The specified resource is in use.
//
// * ResourceLimitExceededException
// You have encountered a service limit on the specified resource.
//
// * InvalidParameterException
// The specified parameter is invalid. Review the available parameters for the
// API request.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// * ServiceUnavailableException
// The service is unavailable. Back off and retry the operation.
//
// * UnsupportedAvailabilityZoneException
// At least one of your specified cluster subnets is in an Availability Zone
// that does not support Amazon EKS. The exception output specifies the supported
// Availability Zones for your account, from which you can choose subnets for
// your cluster.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateCluster
func (c *EKS) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) {
req, out := c.CreateClusterRequest(input)
return out, req.Send()
}
// CreateClusterWithContext is the same as CreateCluster with the addition of
// the ability to pass a context and additional request options.
//
// See CreateCluster for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *EKS) CreateClusterWithContext(ctx aws.Context, input *CreateClusterInput, opts ...request.Option) (*CreateClusterOutput, error) {
req, out := c.CreateClusterRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateFargateProfile = "CreateFargateProfile"
// CreateFargateProfileRequest generates a "aws/request.Request" representing the
// client's request for the CreateFargateProfile operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateFargateProfile for more information on using the CreateFargateProfile
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateFargateProfileRequest method.
// req, resp := client.CreateFargateProfileRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateFargateProfile
func (c *EKS) CreateFargateProfileRequest(input *CreateFargateProfileInput) (req *request.Request, output *CreateFargateProfileOutput) {
op := &request.Operation{
Name: opCreateFargateProfile,
HTTPMethod: "POST",
HTTPPath: "/clusters/{name}/fargate-profiles",
}
if input == nil {
input = &CreateFargateProfileInput{}
}
output = &CreateFargateProfileOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateFargateProfile API operation for Amazon Elastic Kubernetes Service.
//
// Creates an AWS Fargate profile for your Amazon EKS cluster. You must have
// at least one Fargate profile in a cluster to be able to run pods on Fargate.
//
// The Fargate profile allows an administrator to declare which pods run on
// Fargate and specify which pods run on which Fargate profile. This declaration
// is done through the profile’s selectors. Each profile can have up to five
// selectors that contain a namespace and labels. A namespace is required for
// every selector. The label field consists of multiple optional key-value pairs.
// Pods that match the selectors are scheduled on Fargate. If a to-be-scheduled
// pod matches any of the selectors in the Fargate profile, then that pod is
// run on Fargate.
//
// When you create a Fargate profile, you must specify a pod execution role
// to use with the pods that are scheduled with the profile. This role is added
// to the cluster's Kubernetes Role Based Access Control (https://kubernetes.io/docs/admin/authorization/rbac/)
// (RBAC) for authorization so that the kubelet that is running on the Fargate
// infrastructure can register with your Amazon EKS cluster so that it can appear
// in your cluster as a node. The pod execution role also provides IAM permissions
// to the Fargate infrastructure to allow read access to Amazon ECR image repositories.
// For more information, see Pod Execution Role (https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html)
// in the Amazon EKS User Guide.
//
// Fargate profiles are immutable. However, you can create a new updated profile
// to replace an existing profile and then delete the original after the updated
// profile has finished creating.
//
// If any Fargate profiles in a cluster are in the DELETING status, you must
// wait for that Fargate profile to finish deleting before you can create any
// other profiles in that cluster.
//
// For more information, see AWS Fargate Profile (https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html)
// in the Amazon EKS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation CreateFargateProfile for usage and error information.
//
// Returned Error Types:
// * InvalidParameterException
// The specified parameter is invalid. Review the available parameters for the
// API request.
//
// * InvalidRequestException
// The request is invalid given the state of the cluster. Check the state of
// the cluster and the associated operations.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// * ResourceLimitExceededException
// You have encountered a service limit on the specified resource.
//
// * UnsupportedAvailabilityZoneException
// At least one of your specified cluster subnets is in an Availability Zone
// that does not support Amazon EKS. The exception output specifies the supported
// Availability Zones for your account, from which you can choose subnets for
// your cluster.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateFargateProfile
func (c *EKS) CreateFargateProfile(input *CreateFargateProfileInput) (*CreateFargateProfileOutput, error) {
req, out := c.CreateFargateProfileRequest(input)
return out, req.Send()
}
// CreateFargateProfileWithContext is the same as CreateFargateProfile with the addition of
// the ability to pass a context and additional request options.
//
// See CreateFargateProfile for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *EKS) CreateFargateProfileWithContext(ctx aws.Context, input *CreateFargateProfileInput, opts ...request.Option) (*CreateFargateProfileOutput, error) {
req, out := c.CreateFargateProfileRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateNodegroup = "CreateNodegroup"
// CreateNodegroupRequest generates a "aws/request.Request" representing the
// client's request for the CreateNodegroup operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateNodegroup for more information on using the CreateNodegroup
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateNodegroupRequest method.
// req, resp := client.CreateNodegroupRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateNodegroup
func (c *EKS) CreateNodegroupRequest(input *CreateNodegroupInput) (req *request.Request, output *CreateNodegroupOutput) {
op := &request.Operation{
Name: opCreateNodegroup,
HTTPMethod: "POST",
HTTPPath: "/clusters/{name}/node-groups",
}
if input == nil {
input = &CreateNodegroupInput{}
}
output = &CreateNodegroupOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateNodegroup API operation for Amazon Elastic Kubernetes Service.
//
// Creates a managed node group for an Amazon EKS cluster. You can only create
// a node group for your cluster that is equal to the current Kubernetes version
// for the cluster. All node groups are created with the latest AMI release
// version for the respective minor Kubernetes version of the cluster, unless
// you deploy a custom AMI using a launch template. For more information about
// using launch templates, see Launch template support (https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html).
//
// An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and
// associated Amazon EC2 instances that are managed by AWS for an Amazon EKS
// cluster. Each node group uses a version of the Amazon EKS optimized Amazon
// Linux 2 AMI. For more information, see Managed Node Groups (https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html)
// in the Amazon EKS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation CreateNodegroup for usage and error information.
//
// Returned Error Types:
// * ResourceInUseException
// The specified resource is in use.
//
// * ResourceLimitExceededException
// You have encountered a service limit on the specified resource.
//
// * InvalidRequestException
// The request is invalid given the state of the cluster. Check the state of
// the cluster and the associated operations.
//
// * InvalidParameterException
// The specified parameter is invalid. Review the available parameters for the
// API request.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// * ServiceUnavailableException
// The service is unavailable. Back off and retry the operation.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateNodegroup
func (c *EKS) CreateNodegroup(input *CreateNodegroupInput) (*CreateNodegroupOutput, error) {
req, out := c.CreateNodegroupRequest(input)
return out, req.Send()
}
// CreateNodegroupWithContext is the same as CreateNodegroup with the addition of
// the ability to pass a context and additional request options.
//
// See CreateNodegroup for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *EKS) CreateNodegroupWithContext(ctx aws.Context, input *CreateNodegroupInput, opts ...request.Option) (*CreateNodegroupOutput, error) {
req, out := c.CreateNodegroupRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteAddon = "DeleteAddon"
// DeleteAddonRequest generates a "aws/request.Request" representing the
// client's request for the DeleteAddon operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteAddon for more information on using the DeleteAddon
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteAddonRequest method.
// req, resp := client.DeleteAddonRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteAddon
func (c *EKS) DeleteAddonRequest(input *DeleteAddonInput) (req *request.Request, output *DeleteAddonOutput) {
op := &request.Operation{
Name: opDeleteAddon,
HTTPMethod: "DELETE",
HTTPPath: "/clusters/{name}/addons/{addonName}",
}
if input == nil {
input = &DeleteAddonInput{}
}
output = &DeleteAddonOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteAddon API operation for Amazon Elastic Kubernetes Service.
//
// Delete an Amazon EKS add-on.
//
// When you remove the add-on, it will also be deleted from the cluster. You
// can always manually start an add-on on the cluster using the Kubernetes API.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation DeleteAddon for usage and error information.
//
// Returned Error Types:
// * InvalidParameterException
// The specified parameter is invalid. Review the available parameters for the
// API request.
//
// * InvalidRequestException
// The request is invalid given the state of the cluster. Check the state of
// the cluster and the associated operations.
//
// * ResourceNotFoundException
// The specified resource could not be found. You can view your available clusters
// with ListClusters. You can view your available managed node groups with ListNodegroups.
// Amazon EKS clusters and node groups are Region-specific.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteAddon
func (c *EKS) DeleteAddon(input *DeleteAddonInput) (*DeleteAddonOutput, error) {
req, out := c.DeleteAddonRequest(input)
return out, req.Send()
}
// DeleteAddonWithContext is the same as DeleteAddon with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteAddon for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *EKS) DeleteAddonWithContext(ctx aws.Context, input *DeleteAddonInput, opts ...request.Option) (*DeleteAddonOutput, error) {
req, out := c.DeleteAddonRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteCluster = "DeleteCluster"
// DeleteClusterRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCluster operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteCluster for more information on using the DeleteCluster
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteClusterRequest method.
// req, resp := client.DeleteClusterRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster
func (c *EKS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) {
op := &request.Operation{
Name: opDeleteCluster,
HTTPMethod: "DELETE",
HTTPPath: "/clusters/{name}",
}
if input == nil {
input = &DeleteClusterInput{}
}
output = &DeleteClusterOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteCluster API operation for Amazon Elastic Kubernetes Service.
//
// Deletes the Amazon EKS cluster control plane.
//
// If you have active services in your cluster that are associated with a load
// balancer, you must delete those services before deleting the cluster so that
// the load balancers are deleted properly. Otherwise, you can have orphaned
// resources in your VPC that prevent you from being able to delete the VPC.
// For more information, see Deleting a Cluster (https://docs.aws.amazon.com/eks/latest/userguide/delete-cluster.html)
// in the Amazon EKS User Guide.
//
// If you have managed node groups or Fargate profiles attached to the cluster,
// you must delete them first. For more information, see DeleteNodegroup and
// DeleteFargateProfile.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation DeleteCluster for usage and error information.
//
// Returned Error Types:
// * ResourceInUseException
// The specified resource is in use.
//
// * ResourceNotFoundException
// The specified resource could not be found. You can view your available clusters
// with ListClusters. You can view your available managed node groups with ListNodegroups.
// Amazon EKS clusters and node groups are Region-specific.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// * ServiceUnavailableException
// The service is unavailable. Back off and retry the operation.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster
func (c *EKS) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) {
req, out := c.DeleteClusterRequest(input)
return out, req.Send()
}
// DeleteClusterWithContext is the same as DeleteCluster with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteCluster for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *EKS) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) {
req, out := c.DeleteClusterRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteFargateProfile = "DeleteFargateProfile"
// DeleteFargateProfileRequest generates a "aws/request.Request" representing the
// client's request for the DeleteFargateProfile operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteFargateProfile for more information on using the DeleteFargateProfile
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteFargateProfileRequest method.
// req, resp := client.DeleteFargateProfileRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteFargateProfile
func (c *EKS) DeleteFargateProfileRequest(input *DeleteFargateProfileInput) (req *request.Request, output *DeleteFargateProfileOutput) {
op := &request.Operation{
Name: opDeleteFargateProfile,
HTTPMethod: "DELETE",
HTTPPath: "/clusters/{name}/fargate-profiles/{fargateProfileName}",
}
if input == nil {
input = &DeleteFargateProfileInput{}
}
output = &DeleteFargateProfileOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteFargateProfile API operation for Amazon Elastic Kubernetes Service.
//
// Deletes an AWS Fargate profile.
//
// When you delete a Fargate profile, any pods running on Fargate that were
// created with the profile are deleted. If those pods match another Fargate
// profile, then they are scheduled on Fargate with that profile. If they no
// longer match any Fargate profiles, then they are not scheduled on Fargate
// and they may remain in a pending state.
//
// Only one Fargate profile in a cluster can be in the DELETING status at a
// time. You must wait for a Fargate profile to finish deleting before you can
// delete any other profiles in that cluster.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Elastic Kubernetes Service's
// API operation DeleteFargateProfile for usage and error information.
//
// Returned Error Types:
// * InvalidParameterException
// The specified parameter is invalid. Review the available parameters for the
// API request.
//
// * ClientException
// These errors are usually caused by a client action. Actions can include using
// an action or resource on behalf of a user that doesn't have permissions to
// use the action or resource or specifying an identifier that is not valid.
//
// * ServerException
// These errors are usually caused by a server-side issue.
//
// * ResourceNotFoundException
// The specified resource could not be found. You can view your available clusters
// with ListClusters. You can view your available managed node groups with ListNodegroups.
// Amazon EKS clusters and node groups are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteFargateProfile
func (c *EKS) DeleteFargateProfile(input *DeleteFargateProfileInput) (*DeleteFargateProfileOutput, error) {
req, out := c.DeleteFargateProfileRequest(input)
return out, req.Send()
}
// DeleteFargateProfileWithContext is the same as DeleteFargateProfile with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteFargateProfile for details on how to use this API operation.