Google App Engine - list of IP addresses?

前端 未结 6 1174
挽巷
挽巷 2020-12-05 06:58

I know that Google App Engine does not support an application having a static IP address, but I\'d like to know if there is a list or range of IP addresses that an app could

6条回答
  •  悲哀的现实
    2020-12-05 07:52

    I threw this together quickly, for use with the gcloud create-firewall command.

    #!/bin/bash
    
    netblocks=$(dig TXT _cloud-netblocks.googleusercontent.com @ns1.google.com +short | sed -e 's/"//g')
    
    for block in $netblocks; do
        if [[ $block == include:* ]]; then
            ipblocks=$(dig TXT ${block#include:} @ns1.google.com +short)
    
            for ipblock in $ipblocks; do
                if [[ $ipblock == ip4:* ]]; then
                    printf "${ipblock:4},"
                fi
            done
        fi
    done
    

提交回复
热议问题