0

I am working on a project in which through the boto3 SDK I need to obtain the information from Alternate Contacts and Contact Information.

Is there a method that do this with boto3? Thanks!

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 22 '21 at 10:13

3 Answers3

1

To fetch account data you can use describe_account function.

If the contact information are not in the response of describe account then i dont think is possible to fetch those info via SDK.

import boto3

client = boto3.client('organizations')

response = client.describe_account(
    AccountId='string'
)
bembas
  • 762
  • 8
  • 20
0

Yeah I've run into that problem many times before. When dealing with large scale organizations this is kindof a bottleneck sometimes. It's currently not possible to automate easily.

Some corporates I've seen get around this by tagging account's with a 'BillingContact' and 'Technical Contact's etc. and build their own logic around those tags using lambda's. This doesn't help in letting account's owners receive messages from AWS directly, but it gives some possibilities to email account owners using your own logic to have some form of governance.

LRutten
  • 1,634
  • 7
  • 17
0

The current version of boto provides an method for requesting the Alternate Contact information:

import boto3

CONTACT_TYPES = ['BILLING','OPERATIONS','SECURITY']
        
client = boto.client('account')
        
alternate_contact = client.get_alternate_contact(
    AccountId=event['AccountId'],
    AlternateContactType=CONTACT_TYPES[0])