amazon-web-serviceseucalyptusaws-powershell

Custom endpoint in AWS powershell


I am trying to use AWS Powershell with Eucalyptus.

I can do this with AWS CLI with parameter --endpoint-url.

Is it possible to set endpoint url in AWS powershell? Can I create custom region with my own endpoint URL in AWS Powershell?


Solution

  • --UPDATE--

    The newer versions of the AWS Tools for Windows PowerShell (I'm running 3.1.66.0 according to Get-AWSPowerShellVersion), has an optional -EndpointUrl parameter for the relevant commands.

    Example:

    Get-EC2Instance -EndpointUrl https://somehostnamehere
    

    Additionally, the aforementioned bug has been fixed.

    Good stuff!


    --ORIGINAL ANSWER--

    TL;TR

    Note: there is a bug in the underlying SDK that causes endpoints that have a path component from being signed correctly. The bug affects this solution and the solution @HyperAnthony proposed.

    Additional Info

    Reading through the .NET SDK docs, I stumbled across a section that revealed that one can global set the region rules given a file: http://docs.aws.amazon.com/AWSSdkDocsNET/latest/V2/DeveloperGuide/net-dg-config-other.html#config-setting-awsendpointdefinition

    Unfortunately, I couldn't find anywhere where the format of such a file is documented.

    I then splunked through the AWSSDK.Core.dll code and found where the SDK loads the file (see LoadEndpointDefinitions() method at https://github.com/aws/aws-sdk-net/blob/master/sdk/src/Core/RegionEndpoint.cs).

    Reading through the code, if a file isn't explicitly specified on AWSConfigs.EndpointDefinition, it ultimately loads the file from an embedded resource (i.e. https://github.com/aws/aws-sdk-net/blob/master/sdk/src/Core/endpoints.json)