From 6b6578dd7206213aad99999919e4c72fb13ef297 Mon Sep 17 00:00:00 2001 From: Aditya Putta Date: Thu, 12 Oct 2023 10:14:44 -0500 Subject: [PATCH] Filter Volumes by State Filter volumes based on their state, such as "in-use" or "available," using the status flag. --- plugins/modules/ec2_vol_info.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/modules/ec2_vol_info.py b/plugins/modules/ec2_vol_info.py index c72fb5da25a..bfe2e74fd84 100644 --- a/plugins/modules/ec2_vol_info.py +++ b/plugins/modules/ec2_vol_info.py @@ -45,6 +45,11 @@ - amazon.aws.ec2_vol_info: filters: attachment.status: attached + +# Gather information about volumes that are "in-use" + amazon.aws.ec2_vol_info: + filters: + status: in-use # Gather information about all volumes related to an EC2 Instance # register information to `volumes` variable