def __init__(self, cluster_name, image_name, subnet_id=None, security_group_id=None): self.ecs = ECS() self.ec2 = EC2() self.cloud_watch_logs = Cloud_Watch_Logs() self.aws_config = AWS_Config() # load config from env variables self.account_id = self.cloud_watch_logs.account_id self.region_name = self.cloud_watch_logs.region_name self.cluster_name = cluster_name self.image_name = image_name self.subnet_id = subnet_id self.security_group_id = security_group_id self.task_family = f"family__{self.image_name}" self.task_name = f'task__{self.cluster_name}' #self.iam_execution_role = f'fargate-execution-role_{self.region_name}_{self.task_family}' #self.iam_task_role = f'fargate-task-role_{self.region_name}_{self.task_family}' self.task_arn = None
def setUp(self) -> None: self.ecs = ECS() self.ec2 = EC2()
def __init__(self): self.ec2 = EC2()
def setUp(self): self.ec2 = EC2() self.image_id = 'ami-00f8b1192da5566c5' # amazon linux 2 in eu-west-1
def setUp(self) -> None: self.ec2 = EC2()
def ec2(self): return EC2()
def __init__(self, instance_id=None, image_id=None, name=None, tags=None): self.image_id = image_id or AMI().amazon_linux_2() self.name = name or random_string(prefix='test_ec2_with_ssh_support-') self.tags = tags or {'Name': f'osbot_aws - {name}'} self.instance_id = instance_id self.ec2 = EC2()