Filter Aws accounts in Organizations based on tags


I want to get the list of AWS Organizations Accounts based on Tags. For example, Need to retrieve all the Production Accounts (Tagged as Prod) in AWS .I am not finding the datasource config for the same.Please advise


data “aws_organizations_account” “account” {

filter {
name = “tag:Name”
values = [“Prod”]


That data source does not exist.

Could you put your production accounts in a dedicated OU, and then look them up that way?

Assuming the API call exists you can make a request on the provider’s github. nvm I see you did that already :slight_smile: