get_available_regions() for 'guardduty' missing eu-north-1 - Python boto3

Hello, Looks like getavailableregions() call for guardduty is missing eu-north-1 (Stockholm) however GuardDuty is available in this region and also causes the multi-account enable/disable scripts to skip this region including any custom scripts using boto3.

>>> import boto3
>>> session = boto3.session.Session()
>>> session.get_available_regions('guardduty')
[u'ap-northeast-1', u'ap-northeast-2', u'ap-south-1', u'ap-southeast-1', u'ap-southeast-2', u'ca-central-1', u'eu-central-1', u'eu-west-1', u'eu-west-2', u'eu-west-3', u'sa-east-1', u'us-east-1', u'us-east-2', u'us-west-1', u'us-west-2']

Thanks, Nasir

Asked Oct 12 '21 01:10
avatar nasirvahmed
nasirvahmed

2 Answer:

@nasirvahmed - Thank you for your post. When i try your command i am getting eu-north-1 in the response. Here is my response:

session.get_available_regions('guardduty')

[u'ap-northeast-1',
 u'ap-northeast-2',
 u'ap-south-1',
 u'ap-southeast-1',
 u'ap-southeast-2',
 u'ca-central-1',
 u'eu-central-1',
 u'eu-north-1',
 u'eu-west-1',
 u'eu-west-2',
 u'eu-west-3',
 u'sa-east-1',
 u'us-east-1',
 u'us-east-2',
 u'us-west-1',
 u'us-west-2']

I am using boto3 version 1.9.168 and botocore version 1.12.168 .

Hope it helps and let me know if you have any questions.

1
Answered Jun 14 '19 at 18:24
avatar  of swetashre
swetashre

Thanks @swetashre, I guess I needed to update my boto* versions. I was running boto3 - v 1.9.145 & botocore - v 1.12.145.

1
Answered Jun 14 '19 at 18:36
avatar  of nasirvahmed
nasirvahmed