예제 #1
0
        private void Setup()
        {
            var config   = SetupConfiguration();
            var services = new ServiceCollection();

            services.AddLogging(logging => SetupLogging(logging, config));
            services.AddSingleton <IAmazonEC2>(_ec2);
            services.AddSingleton <IAmazonRoute53>(_r53);
            services.AddSingleton <IAmazonS3>(_s3);
            services.AddSingleton <EC2Evaluator>();
            services.AddSingleton <R53Trigger>();


            _services = services.BuildServiceProvider();
            _logger   = _services.GetRequiredService <ILogger <Function> >();

            _r53Trigger = _services.GetRequiredService <R53Trigger>();

            var asm = System.Reflection.Assembly.GetExecutingAssembly();
            var ver = asm.GetName().Version;

            _logger.LogInformation($"*************************************************************");
            _logger.LogInformation($"** VMBot v{ver} - Starting Up...");
            _logger.LogInformation($"*************************************************************");
        }
예제 #2
0
        private void Setup()
        {
            var config   = SetupConfiguration();
            var services = new ServiceCollection();

            services.AddLogging(logging => SetupLogging(logging, config));
            services.AddSingleton <IAmazonEC2>(_ec2);
            services.AddSingleton <IAmazonRoute53>(_r53);
            services.AddSingleton <IAmazonS3>(_s3);
            services.AddSingleton <EC2Evaluator>();
            services.AddSingleton <R53Trigger>();


            _services = services.BuildServiceProvider();
            _logger   = _services.GetRequiredService <ILogger <Function> >();

            _r53Trigger = _services.GetRequiredService <R53Trigger>();
        }