Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

feat: Add image deprecation_time #1099

Merged
merged 2 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/tables/aws_ec2_images.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ Describes an image.
|usage_operation|text|The operation of the Amazon EC2 instance and the billing code that is associated with the AMI.|
|virtualization_type|text|The type of virtualization of the AMI.|
|last_launched_time|timestamp without time zone|The timestamp of the last time the AMI was used for an EC2 instance launch.|
|deprecation_time|timestamp without time zone|The date and time to deprecate the AMI.|
6 changes: 6 additions & 0 deletions resources/services/ec2/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ func Ec2Images() *schema.Table {
Type: schema.TypeTimestamp,
Resolver: resolveEc2ImageLastLaunchedTime,
},
{
Name: "deprecation_time",
Description: "The date and time to deprecate the AMI.",
Type: schema.TypeTimestamp,
Resolver: client.ResolveTimestampField("DeprecationTime"),
},
},
Relations: []*schema.Table{
{
Expand Down
2 changes: 2 additions & 0 deletions resources/services/ec2/images_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ func buildEc2ImagesMock(t *testing.T, ctrl *gomock.Controller) client.Services {
creationDate := "1994-11-05T08:15:30-05:00"
g.OwnerId = aws.String("testAccount")
g.CreationDate = &creationDate
deprecationTime := "2050-11-05T08:15:30-05:00"
nndegz marked this conversation as resolved.
Show resolved Hide resolved
g.DeprecationTime = &deprecationTime

m.EXPECT().DescribeImages(gomock.Any(), gomock.Any(), gomock.Any()).Return(
&ec2.DescribeImagesOutput{
Expand Down