aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.71k stars 3.93k forks source link

(Cloudwatch LogQueryWidgetProps): (Lack of accountId filed) #26105

Open bygo7 opened 1 year ago

bygo7 commented 1 year ago

Describe the feature

We are trying to utilize the cross-account cross-region visibility through cloudwatch. I can connect logs from different account to monitoring account, but on the cloudwatch dashboard I need to put "accountId" filed on my LogQueryWidgetProps manually. Problem is that the LogQueryWidgetProps on CDK does not have "accountId" filed, so that I can not make query without manually going to AWS console and modifying dashboard body json.

Use Case

Constructing LogQueryWidget with CDK, utilizing cross-account cross-region

Proposed Solution

Adding "accountId" filed supported on LogQueryWidgetProps

Other Information

No response

Acknowledgements

CDK version used

v2

Environment details (OS name and version, etc.)

-

peterwoodworth commented 1 year ago

LogWidgets don't seem to have an accountId field according to the documentation. This looks to only be limited to metric widgets. Is the documentation inaccurate?

bygo7 commented 1 year ago

@peterwoodworth Yes, but the accountId works if I manually put it in the json dashboard body. Looks like it can query different accounts but it is not documented and not on the cdk. Can't we enable this filed?

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

JFen9 commented 10 months ago

I encountered the same issue, but I was able to hack it by providing the ARN of the log group in the source account (which has the account id in it) in place of the log group name when specifying logGroupName property of LogQueryWidgetProps

That said, there indeed is a feature gap between cloudwatch console and cloudformation LogWidget that cloudformation team need to bridge