aws:ebsvolumes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
aws:ebsvolumes [03/01/2025 16:28] – [Show encryption status of EBS] 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(" | ||
Line 31: | Line 29: | ||
response[' | response[' | ||
" | " | ||
- | </script> | + | </code> |
aws/ebsvolumes.1735921689.txt.gz · Last modified: by andrew