aws:ebsvolumes
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aws:ebsvolumes [03/01/2025 16:27] – created andrew | aws:ebsvolumes [03/01/2025 16:29] (current) – andrew | ||
---|---|---|---|
Line 9: | Line 9: | ||
Best practice is for EBS volumes to be encrypted. This script will show the volume status for each volume in the account and what it is attached to (if any). It is possible to have a volume attached to multiple ec2 instances but EBS does not handle file locking etc, so this is unusual. | Best practice is for EBS volumes to be encrypted. This script will show the volume status for each volume in the account and what it is attached to (if any). It is possible to have a volume attached to multiple ec2 instances but EBS does not handle file locking etc, so this is unusual. | ||
- | <script | + | <code python> |
# | # | ||
import boto3 | import boto3 | ||
ec2_client = boto3.client(' | ec2_client = boto3.client(' | ||
- | |||
response = ec2_client.describe_volumes() | response = ec2_client.describe_volumes() | ||
for vol in range(len(response[' | for vol in range(len(response[' | ||
- | |||
if len(response[' | if len(response[' | ||
# print(" | # print(" | ||
- | print(response[' | + | print(response[' |
+ | | ||
+ | | ||
continue | continue | ||
else: | else: | ||
- | print(response[' | + | print(response[' |
- | + | | |
- | </script> | + | |
+ | | ||
+ | </code> | ||
aws/ebsvolumes.1735921624.txt.gz · Last modified: by andrew