Skip to content

Commit 0af0ba4

Browse files
authored
Add aws.account.organization.id (#6054)
I'd like to add this to the asset overview Signed-off-by: Tim Smith <tsmith84@gmail.com>
1 parent aa114cc commit 0af0ba4

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

providers/aws/resources/aws.lr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ aws @defaults("account.id") {
1818
}
1919

2020
// AWS Account
21-
aws.account @defaults("id") {
21+
aws.account @defaults("id aliases.first organization.id") {
2222
// Account ID
2323
id string
2424
// Account aliases
@@ -66,7 +66,7 @@ private aws.account.alternateContact @defaults("contactType name emailAddress")
6666
}
6767

6868
// AWS Organization resource
69-
aws.organization @defaults("arn masterAccountEmail") {
69+
aws.organization @defaults("id masterAccountEmail") {
7070
// ARN of the organization
7171
arn string
7272
// Functionality available to org: ALL or CONSOLIDATED_BILLING
@@ -77,6 +77,8 @@ aws.organization @defaults("arn masterAccountEmail") {
7777
masterAccountEmail string
7878
// List of accounts that belong to the organization, if available to the caller
7979
accounts() []aws.account
80+
// Organization ID
81+
id string
8082
}
8183

8284
// Amazon Virtual Private Cloud (VPC)

providers/aws/resources/aws.lr.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

providers/aws/resources/aws.lr.manifest.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,6 +2604,8 @@ resources:
26042604
min_mondoo_version: 9.0.0
26052605
arn: {}
26062606
featureSet: {}
2607+
id:
2608+
min_mondoo_version: 9.0.0
26072609
masterAccountEmail: {}
26082610
masterAccountId: {}
26092611
min_mondoo_version: 6.11.0

providers/aws/resources/aws_account.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func (a *mqlAwsAccount) organization() (*mqlAwsOrganization, error) {
4747
res, err := CreateResource(a.MqlRuntime, ResourceAwsOrganization,
4848
map[string]*llx.RawData{
4949
"arn": llx.StringDataPtr(org.Organization.Arn),
50+
"id": llx.StringDataPtr(org.Organization.Id),
5051
"featureSet": llx.StringData(string(org.Organization.FeatureSet)),
5152
"masterAccountId": llx.StringDataPtr(org.Organization.MasterAccountId),
5253
"masterAccountEmail": llx.StringDataPtr(org.Organization.MasterAccountEmail),

0 commit comments

Comments
 (0)