Skip to content

Commit

Permalink
Add creationDate to aws.s3.bucket resource (#2005)
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Oct 1, 2023
1 parent e667e7e commit 6b1415b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion providers/aws/resources/aws.lr
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,8 @@ private aws.s3.bucket @defaults("arn") {
publicAccessBlock() dict
// False if the bucket no longer exists (stale reference)
exists bool
// Date the bucket was created
creationDate time
}

// Amazon S3 Bucket Grant
Expand Down Expand Up @@ -1229,7 +1231,6 @@ private aws.rds.dbinstance @defaults("arn") {
autoMinorVersionUpgrade bool
}


// Amazon ElastiCache
aws.elasticache {
// Deprecated. Use `cacheClusters` instead.
Expand Down
12 changes: 12 additions & 0 deletions providers/aws/resources/aws.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions providers/aws/resources/aws.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,8 @@ resources:
acl: {}
arn: {}
cors: {}
creationDate:
min_mondoo_version: 9.0.0
defaultLock: {}
encryption: {}
exists: {}
Expand Down
9 changes: 5 additions & 4 deletions providers/aws/resources/aws_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ func (a *mqlAwsS3) buckets() ([]interface{}, error) {
}
mqlS3Bucket, err := CreateResource(a.MqlRuntime, "aws.s3.bucket",
map[string]*llx.RawData{
"name": llx.StringData(convert.ToString(bucket.Name)),
"arn": llx.StringData(fmt.Sprintf(s3ArnPattern, convert.ToString(bucket.Name))),
"exists": llx.BoolData(true),
"location": llx.StringData(region),
"name": llx.StringData(convert.ToString(bucket.Name)),
"arn": llx.StringData(fmt.Sprintf(s3ArnPattern, convert.ToString(bucket.Name))),
"exists": llx.BoolData(true),
"location": llx.StringData(region),
"creationDate": llx.TimeData(toTime(bucket.CreationDate)),
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 6b1415b

Please sign in to comment.