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

Actions.py check_alarm_tag error in call ec2_client.describe_instances #35

Closed
mpechner-akasa opened this issue Apr 6, 2023 · 2 comments

Comments

@mpechner-akasa
Copy link

You are missing the "tag:" as part of the filer name.
instance = ec2_client.describe_instances(
Filters=[
{
'Name': '**tag:**tag-key',
'Values': [
tag_key
]
}
],
InstanceIds=[
instance_id
]

    )
@knizami
Copy link
Contributor

knizami commented Apr 10, 2023

Hi Michael, thanks for opening this issue. However I believe this code is correct. This code is using the 'tag-key' search where we are only verifying that that Create_Auto_Alarms. tag is present and the value isn't important. In order to activate the solution, you only need to have this tag key present. You can change the default activation tag key by setting the ALARM_TAG environment variable.

Per boto3 documentation for describe_instances:

tag-key - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.

@mpechner-akasa
Copy link
Author

yes, sorry about that. Closed my PR

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