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

Filter out None elasticbeanstalk envs #9453

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dmytro-afanasiev
Copy link
Collaborator

describe_environments returns terminated environments (at least those that were terminated recently) but list_tags_for_resource raises ResourceNotFoundException if we try it with terminated environment.

Image
image

So, if i try to execute the policy below over my two terminated envs,

policies:
  - name: example-policy
    resource: aws.elasticbeanstalk-environment

i'll get such a result (example-policy/resources.json):

[
  null,
  null
]

It happens because _eb_env_tags returns None in case it cannot fetch tags for an environment. I'm not sure about the fix. Maybe we should just keep the environment without fetched tags, i.e return eb_env without changes if ResourceNotFoundException?

@kapilt
Copy link
Collaborator

kapilt commented Apr 26, 2024

It feels like the fix is two fold, handle better on not getting tags, but also default to listing active/pending environments.

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

Successfully merging this pull request may close these issues.

None yet

2 participants