Exemple #1
0
        public AWSS3API(BasicAWSCredentials basicAWSCredentials, RegionEndpoint regionEndpoint)
        {
            //Console.WriteLine("AWSS3API by AWSS3Options");
            var credentials = basicAWSCredentials.GetCredentials();

            this.awsS3Options = new AWSS3Options()
            {
                Key    = credentials.AccessKey,
                Secret = credentials.SecretKey,
                Region = regionEndpoint.SystemName
            };
        }
Exemple #2
0
        private static AmazonDynamoDBClient CreateClient()
        {
            // First, set up a DynamoDB client for DynamoDB Local
            AmazonDynamoDBConfig clientConfig = new AmazonDynamoDBConfig();

            // This client will access the US East 1 region.

            clientConfig.AuthenticationRegion = "us-east-1";// RegionEndpoint.USEast1.ToString().Trim();
            clientConfig.ServiceURL           = "http://localhost:4059/";
            BasicAWSCredentials awsCredentials = new BasicAWSCredentials(ConfigurationManager.AppSettings["accesskey"], ConfigurationManager.AppSettings["secretkey"]);
            var t = awsCredentials.GetCredentials();

            clientConfig.RegionEndpoint = RegionEndpoint.USEast1;

            try
            {
                return(new AmazonDynamoDBClient(awsCredentials, clientConfig));
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n Error: failed to create a DynamoDB client; " + ex.Message);
                return(null);
            }
        }