This repository was archived by the owner on Jun 12, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 55# Author(s):
66# - Paul Allen ([email protected] ) 77import boto
8+ import boto3
89import boto .ec2
910import boto .ec2 .autoscale
1011from boto .exception import EC2ResponseError
@@ -111,8 +112,11 @@ def getMyASGSubnets():
111112 global MY_ASG_SUBNETS
112113 if MY_ASG_SUBNETS == None :
113114 MY_ASG_SUBNETS = []
114- log ("AUTOSCALE.get_all_groups -> %s" % AUTOSCALE .get_all_groups ())
115- for subnetId in AUTOSCALE .get_all_groups ([getMyAsgName ()])[0 ].vpc_zone_identifier .split ("," ):
115+ log (AUTOSCALE .describe_auto_scaling_groups (AutoScalingGroupNames = [getMyAsgName ()]))
116+ myGroup = AUTOSCALE .describe_auto_scaling_groups (AutoScalingGroupNames = [getMyAsgName ()])['AutoScalingGroups' ][0 ]
117+ log ("myGroup: %s" % myGroup ['VPCZoneIdentifier' ])
118+ for subnetId in myGroup ['VPCZoneIdentifier' ].split ("," ):
119+
116120 log (" subnetId: %s" % subnetId )
117121 MY_ASG_SUBNETS .append (getSubnetById (subnetId ))
118122 return MY_ASG_SUBNETS
@@ -161,7 +165,7 @@ def main():
161165
162166EC2 = boto .ec2 .connect_to_region (getRegion ())
163167VPC = boto .vpc .connect_to_region (getRegion ())
164- AUTOSCALE = boto . ec2 . autoscale . connect_to_region ( getRegion ())
168+ AUTOSCALE = boto3 . client ( 'autoscale' , region_name = getRegion ())
165169
166170disableSourceDestChecks ()
167171main ()
You can’t perform that action at this time.
0 commit comments