2

I am attempting to connect to AWS s3 with Powershell but have hit this error when I run Get-S3Bucket and any PS scripts i want to run

"GET-S3BucketL Name resolution failure attempting to reach service in region eu-west-1 (as supplied to the -Region parameter or from the configured shell default))

My config:

  1. Powershell Toolket: AWSToolsAndSDKForNet_sdk-3.3.211.0_ps-3.3.210.0_tk-1.13.0.4.msi

  2. Set-AWSCredential -AccessKey ABC -SecretKey 123 -StoreAs aws-access

  3. Initialize-AWSDefaultConfiguration -ProfileName aws-access -Region eu-west-1 added to Powershell Profile

  4. Import-Module "C:\Program Files (x86)\AWSTools\PowerShell\AWSPowerShell\AWSPowerShell.psd1" Added to Powershell profile

  5. All on a Windows 2008 R2 Datacenter

Check: C:\Users\xxxxx\AppData\Local\AWSToolkit\RegisteredAccounts.json is correct

Testing: - The connection works through a third party backup software which does use the same AWS credentials above. I can browse to the buckets no problem. ~This is whats so annoying - also all of the above allows connection/scripting form my own Desktop ~Win10

I am not able to ask for AWS Support due to costs

Anthony Neace
  • 25,013
  • 7
  • 114
  • 129
amartinez
  • 169
  • 2
  • 14
  • Did you ever get to the bottom of this issue? I'm also receiving the error "Name resolution failure attempting to reach service in region eu-west-1 (as supplied to the -Region parameter or from configured shell default)." although for me, it's on an API gateway call. – Lee Oades Apr 16 '18 at 13:02
  • Sorry We never did... our upgraded thrird party app for AWS uploads has been doing a better job but still some snafoos – amartinez May 01 '18 at 11:42

1 Answers1

0

This error is also encountered if you are running this command from an AWS instance with IAM role attached to it with access to s3 buckets (which makes you reach aws services without configuring credentials). In this case you need create an S3 Endpoint in that VPC to connect to S3 internally via powershell. It can still be done by configuring credentials on the shell but that defeats the purpose of an IAM role.

Hope this helps someone.

tarvinder91
  • 96
  • 1
  • 4