@@ -641,14 +641,6 @@ var ManagedConfigStructFieldValidations = []*cr.StructFieldValidation{
641641 AllowExplicitNull : true ,
642642 },
643643 },
644- {
645- StructField : "CortexPolicyARN" ,
646- StringValidation : & cr.StringValidation {
647- Required : false ,
648- AllowEmpty : true ,
649- TreatNullAsEmpty : true ,
650- },
651- },
652644 {
653645 StructField : "IAMPolicyARNs" ,
654646 StringListValidation : & cr.StringListValidation {
@@ -771,6 +763,22 @@ var ManagedConfigStructFieldValidations = []*cr.StructFieldValidation{
771763 Validator : validateCIDR ,
772764 },
773765 },
766+ {
767+ StructField : "CortexPolicyARN" ,
768+ StringValidation : & cr.StringValidation {
769+ Required : false ,
770+ AllowEmpty : true ,
771+ TreatNullAsEmpty : true ,
772+ },
773+ },
774+ {
775+ StructField : "AccountID" ,
776+ StringValidation : & cr.StringValidation {
777+ Required : false ,
778+ AllowEmpty : true ,
779+ TreatNullAsEmpty : true ,
780+ },
781+ },
774782}
775783
776784func CoreConfigValidations (allowExtraFields bool ) * cr.StructValidation {
@@ -903,6 +911,11 @@ func (cc *Config) Validate(awsClient *aws.Client) error {
903911 return err
904912 }
905913
914+ if cc .AccountID != "" {
915+ return ErrorDisallowedField (AccountIDKey )
916+ }
917+ cc .AccountID = accountID
918+
906919 if cc .Bucket == "" {
907920 bucketID := hash .String (accountID + cc .Region )[:8 ] // this is to "guarantee" a globally unique name
908921 cc .Bucket = cc .ClusterName + "-" + bucketID
@@ -913,6 +926,9 @@ func (cc *Config) Validate(awsClient *aws.Client) error {
913926 }
914927 }
915928
929+ if cc .CortexPolicyARN != "" {
930+ return ErrorDisallowedField (CortexPolicyARNKey )
931+ }
916932 cc .CortexPolicyARN = DefaultPolicyARN (accountID , cc .ClusterName , cc .Region )
917933
918934 defaultPoliciesSet := strset .New (_defaultIAMPolicies ... )
0 commit comments