How to list all VPC's in GCP that has default firewall rules?

Viewed 28

I want to list vpc's that has default firewall rules configured in each project within an organization. Is there a gcloud command, that I can use to get the vpc's list ??

1 Answers

Here's the gcloud command to list all firewall rules in a project:

gcloud compute firewall-rules list --format="table(
        name,
        network,
        direction,
        priority,
        sourceRanges.list():label=SRC_RANGES,
        destinationRanges.list():label=DEST_RANGES,
        allowed[].map().firewall_rule().list():label=ALLOW,
        denied[].map().firewall_rule().list():label=DENY,
        sourceTags.list():label=SRC_TAGS,
        sourceServiceAccounts.list():label=SRC_SVC_ACCT,
        targetTags.list():label=TARGET_TAGS,
        targetServiceAccounts.list():label=TARGET_SVC_ACCT,
        disabled
    )"
Related