Generate Comprehensive VPC Reports for AWS Using PowerShell Script

Creating an AWS VPC network inventory report using PowerShell can be a powerful way to manage and audit your AWS infrastructure. In this blog I am sharing a sample code of PowerShell that can be used to get the VPC inventory report from AWS.

Logic is to assume role, go thru each region and account to find the VPC across whole AWS organization.

This solution is another addition to the scripts that I have already shared for different AWS products:

AWS | Search Results | Tech Wizard

Prerequisites for this Solution:

Download the script from Git or PowerShell gallery from below links:

Git:https://github.com/VikasSukhija/Downloads

AWSVPCInventory.ps1PowerShell Gallery:https://www.powershellgallery.com/packages/AWSVPCInventory

Install-Script -Name AWSVPCInventoryUpdate the below section of the script with your own parameters:

This script needs access and secret key of the account that can assume a role that has access to read the VPC networks information across the whole organization.

Please secure the access key and secret key as encrypted if you will schedule this script in production.

Script will fetch below details for each VPC subnets.

Update the Tag code as per Your environment.

Here is the Email that email address mentioned in variable will receive.

Here is the CSV report that your will get:

Note: modify the AccountID for authentication as per your organization at line 68, Line 106, Line 110, Line115, Line 117.

I believe this PowerShell script will aid you in generating the VPC report for your AWS instance.

Thanks for reading and downloading…Tech Wizardhttps://techwizard.cloud

PowerShell Fast Track