From fd8c5cf724637bf4291a63b7bb8343336895c184 Mon Sep 17 00:00:00 2001 From: Margarita Fedotova Date: Thu, 21 Nov 2024 20:27:47 +0300 Subject: [PATCH] eks: cluster: add legacyClusterParams.masterConfig --- models/apis/eks/2017-11-01/api-2.json | 33 ++++- service/eks/api.go | 166 ++++++++++++++++++++++++++ 2 files changed, 197 insertions(+), 2 deletions(-) diff --git a/models/apis/eks/2017-11-01/api-2.json b/models/apis/eks/2017-11-01/api-2.json index 5ed6e8f46c5..3c063f66131 100644 --- a/models/apis/eks/2017-11-01/api-2.json +++ b/models/apis/eks/2017-11-01/api-2.json @@ -788,7 +788,8 @@ "platformVersion":{"shape":"String"}, "tags":{"shape":"TagMap"}, "encryptionConfig":{"shape":"EncryptionConfigList"}, - "connectorConfig":{"shape":"ConnectorConfigResponse"} + "connectorConfig":{"shape":"ConnectorConfigResponse"}, + "legacyClusterParams":{"shape":"legacyClusterParams"} } }, "ClusterName":{ @@ -906,7 +907,8 @@ "idempotencyToken":true }, "tags":{"shape":"TagMap"}, - "encryptionConfig":{"shape":"EncryptionConfigList"} + "encryptionConfig":{"shape":"EncryptionConfigList"}, + "legacyClusterParams":{"shape":"legacyClusterParams"} } }, "CreateClusterResponse":{ @@ -1435,6 +1437,7 @@ "type":"list", "member":{"shape":"String"} }, + "Integer":{"type":"integer"}, "InvalidParameterException":{ "type":"structure", "members":{ @@ -1500,6 +1503,15 @@ "id":{"shape":"String"} } }, + "legacyClusterParams": { + "type": "structure", + "required": [ + "masterConfig" + ], + "members": { + "masterConfig": {"shape": "masterConfig"} + } + }, "ListAddonsRequest":{ "type":"structure", "required":["clusterName"], @@ -1755,6 +1767,23 @@ "clusterLogging":{"shape":"LogSetups"} } }, + "masterConfig":{ + "type":"structure", + "required":[ + "highAvailability", + "mastersInstanceType", + "mastersVolumeType", + "mastersVolumeSize" + ], + "members":{ + "highAvailability":{"shape":"Boolean"}, + "mastersInstanceType":{"shape":"String"}, + "mastersVolumeType":{"shape":"String"}, + "mastersVolumeSize":{"shape":"Integer"}, + "mastersVolumeIops":{"shape":"Integer"}, + "masterPublicIp":{"shape":"String"} + } + }, "Nodegroup":{ "type":"structure", "members":{ diff --git a/service/eks/api.go b/service/eks/api.go index fdab7b6b378..d4f23e62efb 100644 --- a/service/eks/api.go +++ b/service/eks/api.go @@ -4748,6 +4748,8 @@ type Cluster struct { // The Kubernetes network configuration for the cluster. KubernetesNetworkConfig *KubernetesNetworkConfigResponse `locationName:"kubernetesNetworkConfig" type:"structure"` + LegacyClusterParams *LegacyClusterParams `locationName:"legacyClusterParams" type:"structure"` + // The logging configuration for your cluster. Logging *Logging `locationName:"logging" type:"structure"` @@ -4856,6 +4858,12 @@ func (s *Cluster) SetKubernetesNetworkConfig(v *KubernetesNetworkConfigResponse) return s } +// SetLegacyClusterParams sets the LegacyClusterParams field's value. +func (s *Cluster) SetLegacyClusterParams(v *LegacyClusterParams) *Cluster { + s.LegacyClusterParams = v + return s +} + // SetLogging sets the Logging field's value. func (s *Cluster) SetLogging(v *Logging) *Cluster { s.Logging = v @@ -5260,6 +5268,8 @@ type CreateClusterInput struct { // The Kubernetes network configuration for the cluster. KubernetesNetworkConfig *KubernetesNetworkConfigRequest `locationName:"kubernetesNetworkConfig" type:"structure"` + LegacyClusterParams *LegacyClusterParams `locationName:"legacyClusterParams" type:"structure"` + // Enable or disable exporting the Kubernetes control plane logs for your cluster // to CloudWatch Logs. By default, cluster control plane logs aren't exported // to CloudWatch Logs. For more information, see Amazon EKS Cluster control @@ -5341,6 +5351,11 @@ func (s *CreateClusterInput) Validate() error { if s.Tags != nil && len(s.Tags) < 1 { invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) } + if s.LegacyClusterParams != nil { + if err := s.LegacyClusterParams.Validate(); err != nil { + invalidParams.AddNested("LegacyClusterParams", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -5366,6 +5381,12 @@ func (s *CreateClusterInput) SetKubernetesNetworkConfig(v *KubernetesNetworkConf return s } +// SetLegacyClusterParams sets the LegacyClusterParams field's value. +func (s *CreateClusterInput) SetLegacyClusterParams(v *LegacyClusterParams) *CreateClusterInput { + s.LegacyClusterParams = v + return s +} + // SetLogging sets the Logging field's value. func (s *CreateClusterInput) SetLogging(v *Logging) *CreateClusterInput { s.Logging = v @@ -8062,6 +8083,55 @@ func (s *LaunchTemplateSpecification) SetVersion(v string) *LaunchTemplateSpecif return s } +type LegacyClusterParams struct { + _ struct{} `type:"structure"` + + // MasterConfig is a required field + MasterConfig *MasterConfig `locationName:"masterConfig" type:"structure" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s LegacyClusterParams) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s LegacyClusterParams) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LegacyClusterParams) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LegacyClusterParams"} + if s.MasterConfig == nil { + invalidParams.Add(request.NewErrParamRequired("MasterConfig")) + } + if s.MasterConfig != nil { + if err := s.MasterConfig.Validate(); err != nil { + invalidParams.AddNested("MasterConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMasterConfig sets the MasterConfig field's value. +func (s *LegacyClusterParams) SetMasterConfig(v *MasterConfig) *LegacyClusterParams { + s.MasterConfig = v + return s +} + type ListAddonsInput struct { _ struct{} `type:"structure" nopayload:"true"` @@ -8976,6 +9046,102 @@ func (s *Logging) SetClusterLogging(v []*LogSetup) *Logging { return s } +type MasterConfig struct { + _ struct{} `type:"structure"` + + // HighAvailability is a required field + HighAvailability *bool `locationName:"highAvailability" type:"boolean" required:"true"` + + MasterPublicIp *string `locationName:"masterPublicIp" type:"string"` + + // MastersInstanceType is a required field + MastersInstanceType *string `locationName:"mastersInstanceType" type:"string" required:"true"` + + MastersVolumeIops *int64 `locationName:"mastersVolumeIops" type:"integer"` + + // MastersVolumeSize is a required field + MastersVolumeSize *int64 `locationName:"mastersVolumeSize" type:"integer" required:"true"` + + // MastersVolumeType is a required field + MastersVolumeType *string `locationName:"mastersVolumeType" type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s MasterConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s MasterConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MasterConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MasterConfig"} + if s.HighAvailability == nil { + invalidParams.Add(request.NewErrParamRequired("HighAvailability")) + } + if s.MastersInstanceType == nil { + invalidParams.Add(request.NewErrParamRequired("MastersInstanceType")) + } + if s.MastersVolumeSize == nil { + invalidParams.Add(request.NewErrParamRequired("MastersVolumeSize")) + } + if s.MastersVolumeType == nil { + invalidParams.Add(request.NewErrParamRequired("MastersVolumeType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHighAvailability sets the HighAvailability field's value. +func (s *MasterConfig) SetHighAvailability(v bool) *MasterConfig { + s.HighAvailability = &v + return s +} + +// SetMasterPublicIp sets the MasterPublicIp field's value. +func (s *MasterConfig) SetMasterPublicIp(v string) *MasterConfig { + s.MasterPublicIp = &v + return s +} + +// SetMastersInstanceType sets the MastersInstanceType field's value. +func (s *MasterConfig) SetMastersInstanceType(v string) *MasterConfig { + s.MastersInstanceType = &v + return s +} + +// SetMastersVolumeIops sets the MastersVolumeIops field's value. +func (s *MasterConfig) SetMastersVolumeIops(v int64) *MasterConfig { + s.MastersVolumeIops = &v + return s +} + +// SetMastersVolumeSize sets the MastersVolumeSize field's value. +func (s *MasterConfig) SetMastersVolumeSize(v int64) *MasterConfig { + s.MastersVolumeSize = &v + return s +} + +// SetMastersVolumeType sets the MastersVolumeType field's value. +func (s *MasterConfig) SetMastersVolumeType(v string) *MasterConfig { + s.MastersVolumeType = &v + return s +} + // An object representing an Amazon EKS managed node group. type Nodegroup struct { _ struct{} `type:"structure"`