User Tools

Site Tools


aws:orgs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
aws:orgs [11/02/2025 10:31] – [Get a list of OU's in an organisation] andrewaws:orgs [11/02/2025 10:35] (current) andrew
Line 34: Line 34:
     --parent-id $RootId \     --parent-id $RootId \
     --query 'OrganizationalUnits[?Name==`SpecificOU`].Id' --output text )     --query 'OrganizationalUnits[?Name==`SpecificOU`].Id' --output text )
 +</code>
 +
 +
 +===== Truncate account number =====
 +
 +Sometimes you may want to point to an account, but not reveal the full account number, this code will truncate your account to a specified length.
 +
 +<code python>
 +$ cat truncate.py
 +#!/usr/bin/python3
 +
 +account = '123456784321'
 +removechar = 6
 +
 +result1 = account[removechar:]
 +result2 = account[removechar:len(account)]
 +print(result1, result2)
 +
 +$ ./truncate.py
 +784321 784321
 +
 </code> </code>
  
aws/orgs.1739269885.txt.gz · Last modified: by andrew

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki