0

This is my first foray into AWS CONFIG and I'm use the advanced query editor to first generate a full list of resources used by the account and I wanted to group by a certain field

SELECT
    accountId,
    resouceId,
    resouceType,
    arn,
    awsRegion
GROUP BY
    resourceType

but the error I'm getting is

"when a GROUP BY clause is present, selected fields(accountId, resouceId, resouceType, arn, awsRegion) must appear in the GROUP BY field list"

I read this to mean, you need to put in all these fields in the group by which does not make sense to me at all, but I tried it anyway. The it said theres a limit of 3 groups.

Am I missing something? The example query on their docs page doesnt seem so different other than having a conditional where clause.

Sample Data output without the "group by":

1- account#1, resourceId#1, AWS::KMS::KEY, arn:aws:kms:us-east-2:unique_id_data, us-east-2
2- account#1, resourceId#2, AWS::CodeBuild::Project, arn:aws:codebuild:us-east-2:unique_id_data, us-east-2
3- account#1, resourceId#3, AWS::KMS::KEY, arn:aws:kms:us-east-2:unique_id_data, us-east-2
4- account#1, resourceId#4, AWS::IAM::POLICY, arn:aws:IAM:unique_id_data, us-east-2
etc etc

But when I try and group the records by AWS::KMS::KEY or another grouping, it provides no output and just gives me the error.

0 Answers0