Difference between revisions of "Aws organizations list-accounts"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 18: Line 18:
 
== Examples ==
 
== Examples ==
  
One account example:
+
=== One account example ===
 
  aws organizations list-accounts
 
  aws organizations list-accounts
 
  {
 
  {
Line 24: Line 24:
 
         {
 
         {
 
             "Id": "1111111111111111",
 
             "Id": "1111111111111111",
             "Arn": "arn:aws:organizations::1111111111111111:account/o-xubwf8seml/1111111111111111",
+
             "Arn": "[[arn:aws:organizations]]::1111111111111111:account/o-xubwf8seml/1111111111111111",
 
             "Email": "[email protected]",
 
             "Email": "[email protected]",
 
             "Name": "your_name",
 
             "Name": "your_name",
Line 34: Line 34:
 
  }
 
  }
  
 +
=== Multiple account example ===
 +
aws organizations list-accounts
 +
{
 +
    "Accounts": [
 +
        {
 +
            "Id": "11111111111",
 +
            "Arn": "arn:aws:organizations::11111111111:account/o-xubwf8seml/11111111111",
 +
            "Email": "[email protected]",
 +
            "Name": "yourlab",
 +
            "Status": "ACTIVE",
 +
            "JoinedMethod": "INVITED",
 +
            "JoinedTimestamp": "2021-08-17T09:29:07.741000+02:00"
 +
        },
 +
        {
 +
            "Id": "2222222222222",
 +
            "Arn": "arn:aws:organizations::11111111111:account/o-xubwf8seml/2222222222222",
 +
            "Email": "[email protected]",
 +
            "Name": "test",
 +
            "Status": "ACTIVE",
 +
            "[[JoinedMethod]]": "CREATED",
 +
            "JoinedTimestamp": "2024-02-20T16:35:44.825000+01:00"
 +
        }
 +
    ]
 +
}
  
 +
=== Output text ===
 
  aws organizations list-accounts --output=text
 
  aws organizations list-accounts --output=text
 
  ACCOUNTS        arn:aws:organizations::764058868389:account/o-pkdpvy9r36/764058868389  [email protected]    764058868389  INVITED 2019- 01-22T13:31:41.574000+04:00 YOUR-NAME ACTIVE
 
  ACCOUNTS        arn:aws:organizations::764058868389:account/o-pkdpvy9r36/764058868389  [email protected]    764058868389  INVITED 2019- 01-22T13:31:41.574000+04:00 YOUR-NAME ACTIVE

Latest revision as of 08:28, 11 July 2024

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/organizations/list-accounts.html

aws organizations list-accounts | grep Name
           "Name": "your_first_member_account_name",
           "Name": "your_second_member_account_name",
           "Name": "you_can_have_as_many_members_account_as_you_wish",

Errors[edit]

aws organizations list-accounts
An error occurred (AWSOrganizationsNotInUseException) when calling the ListAccounts operation: Your account is not a member of an organization.
aws organizations list-accounts
An error occurred (AccessDeniedException) when calling the ListAccounts operation: You don't have permissions to access this resource.

Examples[edit]

One account example[edit]

aws organizations list-accounts
{
    "Accounts": [
        {
            "Id": "1111111111111111",
            "Arn": "arn:aws:organizations::1111111111111111:account/o-xubwf8seml/1111111111111111",
            "Email": "[email protected]",
            "Name": "your_name",
            "Status": "ACTIVE",
            "JoinedMethod": "INVITED",
            "JoinedTimestamp": "2021-07-17T11:29:07.741000+04:00"
        }
    ]
}

Multiple account example[edit]

aws organizations list-accounts
{
   "Accounts": [
       {
           "Id": "11111111111",
           "Arn": "arn:aws:organizations::11111111111:account/o-xubwf8seml/11111111111",
           "Email": "[email protected]",
           "Name": "yourlab",
           "Status": "ACTIVE",
           "JoinedMethod": "INVITED",
           "JoinedTimestamp": "2021-08-17T09:29:07.741000+02:00"
       },
       {
           "Id": "2222222222222",
           "Arn": "arn:aws:organizations::11111111111:account/o-xubwf8seml/2222222222222",
           "Email": "[email protected]",
           "Name": "test",
           "Status": "ACTIVE",
           "JoinedMethod": "CREATED",
           "JoinedTimestamp": "2024-02-20T16:35:44.825000+01:00"
       }
   ]
}

Output text[edit]

aws organizations list-accounts --output=text
ACCOUNTS        arn:aws:organizations::764058868389:account/o-pkdpvy9r36/764058868389   [email protected]     764058868389  INVITED 2019- 01-22T13:31:41.574000+04:00 YOUR-NAME ACTIVE
ACCOUNTS        arn:aws:organizations::764058868389:account/o-pkdpvy9r36/671701696290   [email protected]   671701696290    
CREATED 2020-01-07T19:52:39.959000+04:00       YOUR-SECOND_ORG ACTIVE
ACCOUNTS        arn:aws:organizations::764058868389:account/o-pkdpvy9r36/512075028180   [email protected] 512075028180    CREATED 2019- 02-14T17:53:49.477000+04:00 YOUR-THIRD_ORG     ACTIVE

Related terms[edit]

See also[edit]

Advertising: