Пример #1
0
        public Route53(
            LookupClientProvider dnsClient,
            ILogService log,
            ISettingsService settings,
            Route53Options options)
            : base(dnsClient, log, settings)
        {
            var region = RegionEndpoint.USEast1;

            _route53Client = !string.IsNullOrWhiteSpace(options.IAMRole)
                ? new AmazonRoute53Client(new InstanceProfileAWSCredentials(options.IAMRole), region)
                : !string.IsNullOrWhiteSpace(options.AccessKeyId) && !string.IsNullOrWhiteSpace(options.SecretAccessKey.Value)
                    ? new AmazonRoute53Client(options.AccessKeyId, options.SecretAccessKey.Value, region)
                    : new AmazonRoute53Client(region);
        }
Пример #2
0
        public Route53(
            LookupClientProvider dnsClient,
            ILogService log,
            ProxyService proxy,
            ISettingsService settings,
            Route53Options options) : base(dnsClient, log, settings)
        {
            var region = RegionEndpoint.USEast1;
            var config = new AmazonRoute53Config()
            {
                RegionEndpoint = region
            };

            config.SetWebProxy(proxy.GetWebProxy());
            _route53Client = !string.IsNullOrWhiteSpace(options.IAMRole)
                ? new AmazonRoute53Client(new InstanceProfileAWSCredentials(options.IAMRole), config)
                : !string.IsNullOrWhiteSpace(options.AccessKeyId) && !string.IsNullOrWhiteSpace(options.SecretAccessKey.Value)
                    ? new AmazonRoute53Client(options.AccessKeyId, options.SecretAccessKey.Value, config)
                    : new AmazonRoute53Client(config);
        }