示例#1
0
        public AWSClientsService(IConfiguration config)
        {
            _config = config;
            var awsCredentials = new BasicAWSCredentials(_config["AWS:ApiAccessKey"], _config["AWS:ApiSecretKey"]);

            IoTClient     = new AmazonIoTClient(awsCredentials, RegionEndpoint.GetBySystemName(_config["AWS:Region"]));
            IoTDataClient = new AmazonIotDataClient("https://" + _config["AWS:IoTEndpoint"], awsCredentials);
            IoTJobClient  = new AmazonIoTJobsDataPlaneClient("https://" + _config["AWS:IoTEndpoint"], awsCredentials);
            S3Client      = new AmazonS3Client(awsCredentials, RegionEndpoint.GetBySystemName(_config["AWS:Region"]));
        }
        protected IAmazonIoTJobsDataPlane CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonIoTJobsDataPlaneConfig {
                RegionEndpoint = region
            };

            Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
            this.CustomizeClientConfig(config);
            var client = new AmazonIoTJobsDataPlaneClient(credentials, config);

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }