terraform-aws-clickops-notifier icon indicating copy to clipboard operation
terraform-aws-clickops-notifier copied to clipboard

Show account aliases or human-readable account names instead/alongside account ids

Open nitrocode opened this issue 1 year ago • 0 comments

It would be nice to show the human readable account name (or account alias). One way we can do it is by providing a JSON mapping of account-id to account-name.

https://github.com/cloudandthings/terraform-aws-clickops-notifier/blob/be9694cda07dbe74fad9e332723be3b38bb5267b/clickopsnotifier/app.py#L251

https://github.com/cloudandthings/terraform-aws-clickops-notifier/blob/be9694cda07dbe74fad9e332723be3b38bb5267b/clickopsnotifier/app.py#L59-L63

https://github.com/cloudandthings/terraform-aws-clickops-notifier/blob/be9694cda07dbe74fad9e332723be3b38bb5267b/clickopsnotifier/messenger.py#L100-L104

Then we can add the following (provided that there is an account name for the account id)

     {
         "type": "mrkdwn",
         "text": f"*Account Name*\n{account_names[trail_event['recipientAccountId']}",
     },

nitrocode avatar Jan 21 '24 15:01 nitrocode