in functions/source/c1c_controltower_lifecycle.py [0:0]
def remove_account_config(aws_account_id):
try:
c1c_connector = c1cconnectorapi.CloudOneConformityConnector(
c1cresources.get_api_key()
)
logger.info(f"Removing account from conformity")
c1c_connector.remove_account(aws_account_id)
logger.info("Removing role from target account")
delete_cross_account_role(aws_account_id)
except Exception as e:
logger.error(
f"Failed to remove account {aws_account_id} config with exception: {e}"
)