troubleshooting Question

Count indexes using "for" in Python

Avatar of Kevin
Kevin asked on
PythonAWSSecurity
7 Comments1 Solution270 ViewsLast Modified:
I am trying to write a python script to verify whether or not a proper security constraint was applied in AWS. The script seems to be working, however, it is returning a duplicate output (code is attached)

Here is a sample log output when it is run in AWS Lambda:

START RequestId: 8edc3e6d-c727-11e7-ad8e-07aa7f7d4c10 Version: $LATEST
port-7dheonjnhtxci

Listing constraints.........
Checking for valid SG template constraint....
['port-7dheonjnhtxci'] Contains a valid SG template constraint....
Listing constraints.........
Checking for valid SG template constraint....
['port-7dheonjnhtxci'] Contains a valid SG template constraint....

END RequestId: 8edc3e6d-c727-11e7-ad8e-07aa7f7d4c10

As you can see, it is returning the same information twice.  I am relatively new to Python so I am sure it is just a simple oversight on my part. Any assistance would be greatly appreciated.
Code.txt
ASKER CERTIFIED SOLUTION
aikimark
Get vaccinated; Social distance; Wear a mask
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros