Skip to content

Commit

Permalink
🧹 AWS: Deprecate createdTime in favor of createdAt (#4937)
Browse files Browse the repository at this point in the history
* AWS: Deprecated `createdTime` in favor of `createdAt`

We use createdAt in 35 places and createTime in 6. Add createdAt to
these resources and deprecate the existing createTime.

Signed-off-by: Tim Smith <[email protected]>

* Apply suggestions from code review

Co-authored-by: Letha <[email protected]>

---------

Signed-off-by: Tim Smith <[email protected]>
Co-authored-by: Letha <[email protected]>
  • Loading branch information
tas50 and misterpantz authored Dec 16, 2024
1 parent f3eafd0 commit f346eb9
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 6 deletions.
24 changes: 18 additions & 6 deletions providers/aws/resources/aws.lr
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,10 @@ private aws.elb.loadbalancer @defaults("name region elbType scheme vpcId dnsName
attributes() []dict
// Deprecated: Use `vpc` instead
vpcId string
// Date and time when the load balancer was created
// Deprecated (use `createdAt` instead)
createdTime time
// Date and time the load balancer was created
createdAt time
// Availability zone where the load balancer runs
availabilityZones []string
// VPC security groups for the load balancer
Expand Down Expand Up @@ -1671,8 +1673,10 @@ private aws.cloudfront.function @defaults("name status") {
arn string
// Date and time when the function was last updated
lastModifiedTime time
// Date and time when the function was created
// Deprecated (use `createdAt` instead)
createdTime time
// Date and time the function was created
createdAt time
// Stage that the function is in
stage string
// Comment to describe the function
Expand Down Expand Up @@ -1769,8 +1773,10 @@ private aws.s3.bucket @defaults("name location public") {
publicAccessBlock() dict
// Whether the bucket still exists (stale reference)
exists bool
// Date the bucket was created
// Deprecated (use `createdAt` instead)
createdTime time
// Date and time the bucket was created
createdAt time
}

// Amazon S3 bucket grant
Expand Down Expand Up @@ -1977,8 +1983,10 @@ private aws.dynamodb.table @defaults("name region") {
continuousBackups() dict
// Tags for the table
tags() map[string]string
// Creation time of the table
// Deprecated (use `createdAt` instead)
createdTime time
// Date and time the table was created
createdAt time
// Whether deletion protection is enabled
deletionProtectionEnabled bool
// Global table version
Expand Down Expand Up @@ -2095,8 +2103,10 @@ private aws.rds.dbcluster @defaults("id region") {
storageType string
// Current state of the cluster
status string
// Creation date of the RDS cluster
// Deprecated (use `createdAt` instead)
createdTime time
// Date and time the RDS cluster was created
createdAt time
// Number of days automated snapshots are retained
backupRetentionPeriod int
// Whether minor version patches are applied automatically
Expand Down Expand Up @@ -2235,8 +2245,10 @@ private aws.rds.dbinstance @defaults("id region engine engineVersion") {
status string
// Whether minor version patches are applied automatically
autoMinorVersionUpgrade bool
// Creation date of the RDS instance
// Deprecated (use `createdAt` instead)
createdTime time
// Date and time the RDS instance was created
createdAt time
// Port that the database instance listens on. If the database instance is part of a DB cluster, this can be a different port than the DB cluster port.
port int
// Connection endpoint for the database instance
Expand Down
72 changes: 72 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.

12 changes: 12 additions & 0 deletions providers/aws/resources/aws.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ resources:
fields:
arn: {}
comment: {}
createdAt:
min_mondoo_version: 9.0.0
createdTime: {}
lastModifiedTime: {}
name: {}
Expand Down Expand Up @@ -850,6 +852,8 @@ resources:
arn: {}
backups: {}
continuousBackups: {}
createdAt:
min_mondoo_version: 9.0.0
createdTime:
min_mondoo_version: 9.0.0
deletionProtectionEnabled:
Expand Down Expand Up @@ -1685,6 +1689,8 @@ resources:
attributes: {}
availabilityZones:
min_mondoo_version: 9.0.0
createdAt:
min_mondoo_version: 9.0.0
createdTime:
min_mondoo_version: 9.0.0
dnsName: {}
Expand Down Expand Up @@ -2454,6 +2460,8 @@ resources:
min_mondoo_version: latest
clusterDbInstanceClass:
min_mondoo_version: 9.0.0
createdAt:
min_mondoo_version: 9.0.0
createdTime:
min_mondoo_version: 9.0.0
deletionProtection:
Expand Down Expand Up @@ -2531,6 +2539,8 @@ resources:
min_mondoo_version: latest
certificateExpiresAt:
min_mondoo_version: latest
createdAt:
min_mondoo_version: 9.0.0
createdTime:
min_mondoo_version: 9.0.0
customIamInstanceProfile:
Expand Down Expand Up @@ -2775,6 +2785,8 @@ resources:
acl: {}
arn: {}
cors: {}
createdAt:
min_mondoo_version: 9.0.0
createdTime:
min_mondoo_version: 9.0.0
defaultLock: {}
Expand Down
1 change: 1 addition & 0 deletions providers/aws/resources/aws_cloudfront.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func (a *mqlAwsCloudfront) functions() ([]interface{}, error) {
"status": llx.StringDataPtr(funct.Status),
"lastModifiedTime": llx.TimeDataPtr(lmTime),
"createdTime": llx.TimeDataPtr(crTime),
"createdAt": llx.TimeDataPtr(crTime),
"stage": llx.StringData(stage),
"comment": llx.StringData(comment),
"runtime": llx.StringData(runtime),
Expand Down
1 change: 1 addition & 0 deletions providers/aws/resources/aws_dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ func (a *mqlAwsDynamodb) getTables(conn *connection.AwsConnection) []*jobpool.Jo
"sseDescription": llx.DictData(sseDict),
"provisionedThroughput": llx.DictData(throughputDict),
"createdTime": llx.TimeDataPtr(table.Table.CreationDateTime),
"createdAt": llx.TimeDataPtr(table.Table.CreationDateTime),
"deletionProtectionEnabled": llx.BoolDataPtr(table.Table.DeletionProtectionEnabled),
"globalTableVersion": llx.StringDataPtr(table.Table.GlobalTableVersion),
"id": llx.StringDataPtr(table.Table.TableId),
Expand Down
2 changes: 2 additions & 0 deletions providers/aws/resources/aws_elb.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (a *mqlAwsElb) getClassicLoadBalancers(conn *connection.AwsConnection) []*j
map[string]*llx.RawData{
"arn": llx.StringData(fmt.Sprintf(elbv1LbArnPattern, regionVal, conn.AccountId(), convert.ToString(lb.LoadBalancerName))),
"createdTime": llx.TimeDataPtr(lb.CreatedTime),
"createdAt": llx.TimeDataPtr(lb.CreatedTime),
"dnsName": llx.StringDataPtr(lb.DNSName),
"elbType": llx.StringData("classic"),
"listenerDescriptions": llx.AnyData(jsonListeners),
Expand Down Expand Up @@ -173,6 +174,7 @@ func (a *mqlAwsElb) getLoadBalancers(conn *connection.AwsConnection) []*jobpool.
"arn": llx.StringDataPtr(lb.LoadBalancerArn),
"availabilityZones": llx.ArrayData(availabilityZones, types.String),
"createdTime": llx.TimeDataPtr(lb.CreatedTime),
"createdAt": llx.TimeDataPtr(lb.CreatedTime),
"dnsName": llx.StringDataPtr(lb.DNSName),
"hostedZoneId": llx.StringDataPtr(lb.CanonicalHostedZoneId),
"name": llx.StringDataPtr(lb.LoadBalancerName),
Expand Down
Loading

0 comments on commit f346eb9

Please sign in to comment.