import sys import argparse from horey.aws_api.aws_clients.sns_client import SNSClient from horey.h_logger import get_logger from horey.aws_api.base_entities.aws_account import AWSAccount from horey.common_utils.actions_manager import ActionsManager from horey.common_utils.common_utils import CommonUtils logger = get_logger() action_manager = ActionsManager() # region create_key def publish_parser(): description = "Create codeartifact domain" parser = argparse.ArgumentParser(description=description) parser.add_argument("--topic_arn", required=True, type=str, help="Topic Arn") parser.add_argument("--message", required=True, type=str, help="Message") parser.add_argument("--subject", required=True, type=str, help="Message subject") parser.add_argument("--accounts_file", required=True, type=str, help="Message")
import os import pdb import base64 from horey.aws_api.aws_clients.ec2_client import EC2Client from horey.h_logger import get_logger from horey.common_utils.common_utils import CommonUtils from unittest.mock import Mock from horey.aws_api.base_entities.aws_account import AWSAccount from horey.aws_api.aws_services_entities.ec2_launch_template import EC2LaunchTemplate configuration_values_file_full_path = os.path.join( os.path.dirname(os.path.abspath(__file__)), "h_logger_configuration_values.py") logger = get_logger( configuration_values_file_full_path=configuration_values_file_full_path) accounts_file_full_path = os.path.abspath( os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "ignore", "aws_api_managed_accounts.py")) accounts = CommonUtils.load_object_from_module(accounts_file_full_path, "main") AWSAccount.set_aws_account(accounts["1111"]) AWSAccount.set_aws_region(accounts["1111"].regions['us-west-2']) mock_values_file_path = os.path.abspath( os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "ignore", "mock_values.py")) mock_values = CommonUtils.load_object_from_module(mock_values_file_path, "main")