Skip to content

AWS Service Catalog list products per accounts cli command

0

Hi,

I have one root account and several child account that are using SC products from shared portfolio from root. But I can find any cli command to run on root to see the statistics like how many products were deployed and on what accounts?

There is only CW metric available, but it's per child account. I need a general view.

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/servicecatalog/index.html

Also related to this: https://github.com/aws/aws-sdk/issues/147

1 Answer
0

Hi,

I'm not quite sure if there's a way to get this statistics on number of products provisioned in all child accounts from the management account by default.

These are CloudWatch metrics that are available per AWS account: https://docs.aws.amazon.com/servicecatalog/latest/adminguide/cloudwatch-metrics.html

Alternate way would be something like this below:

  1. Use the aws sts assume-role command to assume a role in each child account that has access to Service Catalog resources.

aws sts assume-role --role-arn arn:aws:iam::CHILD_ACCOUNT_ID:role/ROLE_NAME --role-session-name session-name

  1. Once you have assumed the role in the child account, you can use the list-record-history command to list the history of provisioned products.

aws servicecatalog list-record-history --access-level-filter '{"Key":"Account","Value":"self"}'

EXPERT
answered 2 years ago
  • It's still not convenient. I am looking for something else that should be done from a root. Without assuming roles per accounts.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.