@@ -641,14 +641,6 @@ var ManagedConfigStructFieldValidations = []*cr.StructFieldValidation{
641
641
AllowExplicitNull : true ,
642
642
},
643
643
},
644
- {
645
- StructField : "CortexPolicyARN" ,
646
- StringValidation : & cr.StringValidation {
647
- Required : false ,
648
- AllowEmpty : true ,
649
- TreatNullAsEmpty : true ,
650
- },
651
- },
652
644
{
653
645
StructField : "IAMPolicyARNs" ,
654
646
StringListValidation : & cr.StringListValidation {
@@ -771,6 +763,22 @@ var ManagedConfigStructFieldValidations = []*cr.StructFieldValidation{
771
763
Validator : validateCIDR ,
772
764
},
773
765
},
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
+ },
774
782
}
775
783
776
784
func CoreConfigValidations (allowExtraFields bool ) * cr.StructValidation {
@@ -903,6 +911,11 @@ func (cc *Config) Validate(awsClient *aws.Client) error {
903
911
return err
904
912
}
905
913
914
+ if cc .AccountID != "" {
915
+ return ErrorDisallowedField (AccountIDKey )
916
+ }
917
+ cc .AccountID = accountID
918
+
906
919
if cc .Bucket == "" {
907
920
bucketID := hash .String (accountID + cc .Region )[:8 ] // this is to "guarantee" a globally unique name
908
921
cc .Bucket = cc .ClusterName + "-" + bucketID
@@ -913,6 +926,9 @@ func (cc *Config) Validate(awsClient *aws.Client) error {
913
926
}
914
927
}
915
928
929
+ if cc .CortexPolicyARN != "" {
930
+ return ErrorDisallowedField (CortexPolicyARNKey )
931
+ }
916
932
cc .CortexPolicyARN = DefaultPolicyARN (accountID , cc .ClusterName , cc .Region )
917
933
918
934
defaultPoliciesSet := strset .New (_defaultIAMPolicies ... )
0 commit comments