Sorry for not starting a discussion but the change is quite small so here goes.
I had a case where the master account ID started with a 0 (zero) and since the argument expected an int during the assignment the leading zero was removed and the account ID validation failed.
EXAMPLE:
[amazon-guardduty-multiaccount-scripts] (master)$ python enableguardduty.py --master_account 012345678901 --assume_role DummyRoleName accounts.csv
Traceback (most recent call last):
File "enableguardduty.py", line 128, in
raise ValueError("Master AccountId is not valid")
ValueError: Master AccountId is not valid
After the change I was able to execute the script successfully.
Description of changes:
I changed the argument to expect type string;
Removed unnecessary cast to string in the regex validation since it's already a string.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: Hello,
Sorry for not starting a discussion but the change is quite small so here goes. I had a case where the master account ID started with a 0 (zero) and since the argument expected an int during the assignment the leading zero was removed and the account ID validation failed. EXAMPLE:
[amazon-guardduty-multiaccount-scripts] (master)$ python enableguardduty.py --master_account 012345678901 --assume_role DummyRoleName accounts.csv Traceback (most recent call last): File "enableguardduty.py", line 128, in
raise ValueError("Master AccountId is not valid")
ValueError: Master AccountId is not valid
After the change I was able to execute the script successfully.
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.