def __init__(self, instance, vpc=None): """Composted ec2.Instance(boto3.resources.base.ServiceResource) class""" if vpc is not None: self.vpc = vpc self.instance = instance # reflect all attributes of ec2.Instance into self. reflect_attrs(self, self.instance)
def reflect_attrs(self): """reflect all attributes of boto3's vpc resource object into self.""" reflect_attrs(self, self.vpc, skip_attrs=self.self_attrs)
def reflect_attrs(self): """reflect all attributes of ec2_object into self.""" reflect_attrs(self, self.ec2_object, skip_attrs=self.self_attrs)
def reflect_attrs(self): """reflect all attributes of ec2.Instance into self.""" reflect_attrs(self, self.instance, skip_attrs=self.self_attrs)
def connect(self, vpc_name): """connect to VPC and reflect all attributes into self.""" self.vpc = self.get_vpc_by_name_tag(vpc_name) # reflect all attributes of boto3's vpc resource object into self. reflect_attrs(self, self.vpc)