1

I'm trying to create an ELB using powershell using the script below, but it's failing with "New-ELBLoadBalancer : A WebException with status NameResolutionFailure was thrown." I'm not sure where to start, any hints?

$HTTPListener = New-Object -TypeName ‘Amazon.ElasticLoadBalancing.Model.Listener’
$HTTPListener.Protocol = ‘http’
$HTTPListener.InstancePort = 80
$HTTPListener.LoadBalancerPort = 80

New-ELBLoadBalancer -LoadBalancerName 'my-elb' -Listener $HTTPListener -Scheme 'internet-facing' -SecurityGroup 'sg-74d60410' -Subnet 'subnet-efc9b8d5' -AccessKey x -SecretKey x -Region us-west1 
Anthony Neace
  • 25,013
  • 7
  • 114
  • 129
webber
  • 1,834
  • 5
  • 24
  • 56

2 Answers2

0

My bad, the region name had a typo should have been us-west-1

webber
  • 1,834
  • 5
  • 24
  • 56
0

Some more background on the error:

A WebException with status NameResolutionFailure was thrown.

When you specify a region for a given AWS cmdlet, you're calling out to a specific service for that region. So when you call New-ELBLoadBalancer in us-west-1, behind-the-scenes an API call is being made to elasticloadbalancing.us-west-1.amazonaws.com. So this WebException is common to the AWS cmdlets, and any AWS cmdlet made with a malformed region will throw this.

Documentation:

Anthony Neace
  • 25,013
  • 7
  • 114
  • 129