Skip to content

Instantly share code, notes, and snippets.

View raajheshkannaa's full-sized avatar

Raajhesh Kannaa Chidambaram raajheshkannaa

View GitHub Profile
@raajheshkannaa
raajheshkannaa / update_aws_alternate_contact.py
Created February 17, 2023 22:35
Use boto3 to automatically update `billing` and `security` alternate contacts for all AWS Accounts in an AWS Organization
"""
Automatically fetch all member accounts in an AWS Organization and
update `Billing` and `Security` Contact.
"""
import boto3
from botocore.exceptions import ClientError
def get_org_accounts(session):
org_client = session.client('organizations')