Skip to content

Commit

Permalink
Feature 771 S3 CreationDate property (#772)
Browse files Browse the repository at this point in the history
* Add CreationDate property
Add CreationDate to properties so that S3 can be filtered based on when the resource was created.

* correct syntax
add . to the end of previous line to follow existing syntax.

* correct syntax
remove unnecessary brackets
  • Loading branch information
jamesgeddes committed Apr 8, 2022
1 parent a8679f5 commit 8c88262
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion resources/s3-buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ func (e *S3Bucket) RemoveAllObjects() error {

func (e *S3Bucket) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("Name", e.name)
properties.Set("Name", e.name).
properties.Set("CreationDate", e.CreationDate)

for _, tag := range e.tags {
properties.SetTag(tag.Key, tag.Value)
Expand Down
3 changes: 2 additions & 1 deletion resources/s3-objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ func (e *S3Object) Properties() types.Properties {
Set("Bucket", e.bucket).
Set("Key", e.key).
Set("VersionID", e.versionID).
Set("IsLatest", e.latest)
Set("IsLatest", e.latest).
Set("CreationDate", e.CreationDate)
}

func (e *S3Object) String() string {
Expand Down

3 comments on commit 8c88262

@jamesgeddes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@svenwltr Looks like this is returning some errors, what did I miss?

@svenwltr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it in #773

@jamesgeddes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Please sign in to comment.