Python Forum
AWS ELB auto tagging with Lambda and boto 3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AWS ELB auto tagging with Lambda and boto 3
#4
Can do try/except if it fail with KeyError then append something else or can also pass out error so it continue.
>>> elbv1 = []
>>> try:
...     elbv1.append(d['responseElements']['loadBalancers'])
... except KeyError:
        # pass    
...     elbv1.append(d['responseElements'])
...     
>>> elbv1
[{'dNSName': 'my-loadbalancer-1234567890.elb.amazonaws.com'}]
Reply


Messages In This Thread
RE: AWS ELB auto tagging with Lambda and boto 3 - by snippsat - Aug-13-2018, 04:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Not able to use boto library with compressed content in python3 avinash2020 1 2,001 Aug-13-2020, 09:24 PM
Last Post: avinash2020
  Boto 3 and Mongo DB zatlas1 2 3,036 May-23-2019, 07:32 PM
Last Post: zatlas1
  Text Processing and NLTK (POS tagging) TwelveMoons 2 4,998 Mar-16-2017, 02:53 AM
Last Post: TwelveMoons

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020