Trying to determine how to pass proxy authentication credentials via Powershell. I’m using the following code, which works for non-proxy connections:
$AmazonS3 = [Amazon.AWSClientFactory]::CreateAmazonS3Client($S3AccessKeyID, $S3SecretKeyID)
$S3PutRequest = New-Object Amazon.S3.Model.PutObjectRequest
$S3PutRequest.BucketName = $S3BucketName
$S3PutRequest.Key = $S3ObjectKey
$S3Response = $AmazonS3.PutObject($S3PutRequest)
The Amazon AWS SDK documentation mentions using the CreateAmazonS3Client object using this method: CreateAmazonS3Client(String, String, AmazonS3Config). AmazonS3Config appears to be an XML file with information containing the proxy settings but I have not discovered the proper syntax for it or where the file should be located.
I would appreciate any suggestions or examples of how to configure this properly to authenticate to a proxy.
I don’t think that it’s an XML object, just a new S3Config object.
Create a config object:
Here’s some documentation on what to include in the config:
http://docs.amazonwebservices.com/sdkfornet/latest/apidocs/html/T_Amazon_S3_AmazonS3Config.htm
Then, use that config when creating your connection.