Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No dates for Cloudformation stacks #82

Closed
andreamaruccia opened this issue Feb 26, 2020 · 3 comments
Closed

No dates for Cloudformation stacks #82

andreamaruccia opened this issue Feb 26, 2020 · 3 comments

Comments

@andreamaruccia
Copy link

andreamaruccia commented Feb 26, 2020

my config:

aws_cloudformation_stack:
  - id: NOT(mystackname1|mystackname2)
    created:
      after: 2020-01-01

my command: ./awsweeper --profile my-sandbox --region eu-west-1 --dry-run --output string ./config.yml

gives an empty result (so nothing to be deleted)

INFO[0000] using region: eu-west-1                      
INFO[0001] This is a test run, nothing will be deleted! 

If I check the json by removing the date filter I will see an object like this one:

[
  {
    "Type": "aws_cloudformation_stack",
    "ID": "arn:aws:cloudformation:eu-west-1:*****:stack/*****/****-****-****-***-****",
    "Tags": {
      "***": "****"
    },
    "Created": null,
    "Attrs": null
  },
... <redacted>

You can see here that the date field is null

Update 1: To be noted that i'm using version v0.4.1 because of #81
Update 2: I've cloned the project and compiled it, same result

@andreamaruccia
Copy link
Author

I've checked the codebase in case to make a MR, weired thing is that it just calls the aws go sdk which should have that field. I don't understand why it should not work, maybe the dependency is just outdated?

@jckuester
Copy link
Owner

Hi @andreamaruccia 👋 Thanks for opening this issue. I provided a fix (#83). The creation date field is named differently across resource types (sometimes CreatedTime, CreationTime, etc.), and I keep a lookup-list with the different names to look for with reflection.

@andreamaruccia
Copy link
Author

amazing i confirm it works over here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants