From af0bf1f1a566a5980db793386ea376f4db31201a Mon Sep 17 00:00:00 2001 From: Benjamin Weimer Date: Wed, 15 May 2024 11:27:08 +0200 Subject: [PATCH] fix: add CreateTime property to EC2NATGateway and EC2Volume resources --- resources/ec2-nat-gateways.go | 2 ++ resources/ec2-volume.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/resources/ec2-nat-gateways.go b/resources/ec2-nat-gateways.go index 31274802..5d259cf1 100644 --- a/resources/ec2-nat-gateways.go +++ b/resources/ec2-nat-gateways.go @@ -3,6 +3,7 @@ package resources import ( "context" "fmt" + "time" "github.com/gotidy/ptr" @@ -79,6 +80,7 @@ func (n *EC2NATGateway) Remove(_ context.Context) error { func (n *EC2NATGateway) Properties() types.Properties { properties := types.NewProperties() + properties.Set("CreateTime", n.natgw.CreateTime.Format(time.RFC3339)) for _, tagValue := range n.natgw.Tags { properties.SetTag(tagValue.Key, tagValue.Value) } diff --git a/resources/ec2-volume.go b/resources/ec2-volume.go index 038c4928..c4e71285 100644 --- a/resources/ec2-volume.go +++ b/resources/ec2-volume.go @@ -2,6 +2,7 @@ package resources import ( "context" + "time" "github.com/aws/aws-sdk-go/service/ec2" @@ -60,6 +61,7 @@ func (e *EC2Volume) Remove(_ context.Context) error { func (e *EC2Volume) Properties() types.Properties { properties := types.NewProperties() properties.Set("State", e.volume.State) + properties.Set("CreateTime", e.volume.CreateTime.Format(time.RFC3339)) for _, tagValue := range e.volume.Tags { properties.SetTag(tagValue.Key, tagValue.Value) }