question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

c7n-org: notifications are missing account name

See original GitHub issue

Describe the bug I’m trying to use c7n-org to run custodian against numerous accounts. I’m also using c7n-mailer to delivery notifications to slack. The messages come through with a blank Account section.

My c7n-org config looks roughly like this:

accounts:
- account_id: '123456789012'
  name: my-account
  regions:
  - all
  role: arn:aws:iam::123456789012:role/my-role

The messages being published to SQS looks like this:

{
  "account_id": "123456789012",
  "account": "",
  ...
}

I’d expect "my-account" to show up in the account field.

To Reproduce

  1. setup c7n-org and c7n-mailer
  2. configure c7n-org as above
  3. run a policy that sends a notification

Expected behavior The account name should be passed through from the c7n-org config.

Background (please complete the following information): I’m using the docker image cloudcustodian/c7n:0.9.11.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rvandegriftcommented, May 21, 2021

ohh, sorry - I’ve confused the account name and the account alias. It’d be nice for c7n-org to pull the name from organizations, but that’s obviously not a bug.

Thanks for your help!

0reactions
kapiltcommented, May 21, 2021

account name is pulled fromthe iam alias for the account, name in organizations api should be related, account name in the config file is mostly for targeting, you can use it in the accounts variables and then have it rendered in your policy ala subject on notify.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c7n-mailer not showing Account number (AWS) #4887 - GitHub
Using both Slack and email notifications with c7n-mailer and c7n-org and I am unable to see the Account field getting populated.
Read more >
c7n-org: Multi Account Custodian Execution
Selecting accounts, regions, policies for execution¶. You can filter the accounts to be run against by either passing the account name or id...
Read more >
cloud-custodian/cloud-custodian - Gitter
Is it possible for a lambda policy in another account that's been run by c7n-org send notifications using the sqs queue in another...
Read more >
Recently Active 'cloudcustodian' Questions - Stack Overflow
I have multiple c7n-org policies to be run in all regions in a list of accounts. Locally I can do this easily with...
Read more >
Cloud Custodian — Overview and deployment of ... - Medium
Verify that no new connections has been made to the database and send ... nb: if you only have one AWS account, all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found