HistoryPurge: Clearing 219 old commits

This commit is contained in:
xpk
2024-10-24 23:09:21 +08:00
commit d08b7cac59
348 changed files with 376141 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from netaddr import *
import boto3
'''
you will need the following pips:
netaddr
boto3
'''
AK=''
SK=''
inputs = [['us-west-2', 'vpc-7155ca14'],['eu-west-1','vpc-55a5a930']]
for v1 in inputs:
session = boto3.Session(
aws_access_key_id=AK,
aws_secret_access_key=SK,
region_name=v1[0]
)
ec2 = session.resource('ec2')
vpc = ec2.Vpc(v1[1])
subnets = []
for subnet in vpc.subnets.all():
subnets.append(IPNetwork(subnet.cidr_block))
lastSubnet = sorted(subnets).pop()
print (v1[0], 'next subnet:', lastSubnet.next())