Skip to content

Commit 5623288

Browse files
committed
fix(aws): Remove account validation
1 parent e993c03 commit 5623288

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

plugins/source/aws/client/spec.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ func (s *Spec) Validate() error {
6363
if s.Organization.ChildAccountRoleName == "" {
6464
return fmt.Errorf("member_role_name is required when using org configuration")
6565
}
66-
if err := validateAccounts(s.Organization.SkipMemberAccounts); err != nil {
67-
return fmt.Errorf("invalid skip_member_accounts: %w", err)
68-
}
6966
if err := validateOUs(s.Organization.OrganizationUnits); err != nil {
7067
return fmt.Errorf("invalid organization_units: %w", err)
7168
}
@@ -77,16 +74,6 @@ func (s *Spec) Validate() error {
7774
return nil
7875
}
7976

80-
func validateAccounts(accounts []string) error {
81-
r := regexp.MustCompile(`^(\d{12})$`)
82-
for _, account := range accounts {
83-
if !r.MatchString(account) {
84-
return fmt.Errorf("invalid account id: %s (should be 12 digits)", account)
85-
}
86-
}
87-
return nil
88-
}
89-
9077
func validateOUs(ous []string) error {
9178
r := regexp.MustCompile(`^((ou\-[0-9a-z]{4,32}\-[a-z0-9]{8,32})|(r\-[0-9a-z]{4,32}))$`)
9279
for _, ou := range ous {

plugins/source/aws/client/spec_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ func TestSpecValidate(t *testing.T) {
99
wantErr bool
1010
}{
1111
{
12-
name: "valid account",
12+
name: "valid accounts",
1313
spec: &Spec{
1414
Accounts: []Account{
1515
{ID: "123456789012"},
16+
{ID: "cq-playground"},
1617
},
1718
},
1819
wantErr: false,

0 commit comments

Comments
 (0)