I have a python lambda function which needs to get the account number that it is running out of. When I had no details of the 'Network' tab set in the AWS console for Lambda it could get the account okay doing this:
AccountNumber = boto3.client('sts').get_caller_identity()['Account']
Now that I have configured a VPC, subnets, and a security group under the Network tab, this specific boto call for sts loops indefinitely. After some time I get an error from Lambda that the function timed out.
Is there a setting in a security group which can cause a boto3 call to loop like this?