code: def update(self, data):
          
          # If the instance was terminated, remove it
          if data.state['Name'] == 'terminated':
              self.delete(auto_commit=False)
              return True
  
          updated = self.set_property('launch_date', to_utc_date(data.launch_time).isoformat())
          updated |= self.set_property('state', data.state['Name'])
          updated |= self.set_property('instance_type', data.instance_type)
          updated |= self.set_property('public_ip', data.public_ip_address or None)
          updated |= self.set_property('public_dns', data.public_dns_name or None)
  
          tags = {x['Key']: x['Value'] for x in data.tags or {}}
          existing_tags = {x.key: x for x in self.tags}
  
          # Check for new tags
          for key, value in list(tags.items()):
              updated |= self.set_tag(key, value)
  
          # Check for updated or removed tags
          for key in list(existing_tags.keys()):
              if key not in tags:
                  updated |= self.delete_tag(key)
  
          return updated
docs: Updates the object information based on live data, if there were any changes made. Any changes will be
          automatically applied to the object, but will not be automatically persisted. You must manually call
          `db.session.add(instance)` on the object.
  
          Args:
              data (:obj:): AWS API Resource object fetched from AWS API
  
          Returns:
              True if there were any changes to the object, else false