AWS PowerShell CLI

The AWS Tools for Windows PowerShell enable developers and administrators to manage their AWS services from the Windows PowerShell scripting environment. You can now manage your OUTSCALE resources with the same Windows PowerShell tools you use to manage your Windows environment.

Prerequisites

To use the AWS PowerShell SDK, ensure that you have the following elements:

  • A suitable Windows environment.

  • An OUTSCALE Cloud account and access keys. For more information, see Creating an Access Key.

  • OUTSCALE credentials (access keys) set in your environment.

In order to get a working version of AWS PowerShell SDK with 3DS OUTSCALE, you have to download a specific SDK version from the PowerShell Gallery.

Only for Windows 2012:
Installing items from the PowerShell Gallery requires the latest version of the PowerShellGet module, which is available in Windows Management Framework (WMF) 5.0, or in the MSI-based installer (for PowerShell 3 and 4). Go to https://www.powershellgallery.com and follow the instructions under "Getting Started with the Gallery".

For more information about the PowerShell Gallery, see https://www.powershellgallery.com.

Configuration

  1. Download the 3.3.29.0 SDK version from https://www.powershellgallery.com/packages/AWSPowerShell/3.3.29.0.

    Version 3.3.29.0 is the latest compatible with OUTSCALE API endpoints. You therefore need to use this one.

  2. To install the SDK version, run the following command in a PowerShell prompt:

    Install-Module -Name AWSPowerShell -RequiredVersion 3.3.29.0

Managing Your Profiles

Windows PowerShell can use either of two credentials stores:

  • The AWS SDK store, which encrypts your credentials and stores them in your home folder:

    C:\Users\{username}\AppData\Local\AWSToolkit\RegisteredAccounts.json
  • The credentials file, which is also located in your home folder, but stores credentials as plain text:

    C:\Users\{username}\.aws\<my_file>

Adding a New Profile

To add a new profile to the AWS SDK store, use Set-AWSCredentials as follows:

PS C:\> Set-AWSCredentials -AccessKey {your_access_key} -SecretKey {your_secret_key} -StoreAs {your_profile_name}

This command contains the following attributes that you need to specify:

  • AccessKey: The access key ID.

  • SecretKey: The corresponding secret key.

    To get your access key ID and your secret key to allow a connection to the APIs, see Managing Your Access Keys.

    • StoreAs: The profile name, which must be unique.

      To specify the default profile, set the profile name to default.

Examples

Scripts

To get information about the available AZs and about your running instances, run the following commands in a PowerShell Command Shell:

$region = "<REGION_NAME>"
$endpoint = "https://fcu.<REGION_NAME>.outscale.com"
Try {
    $azAvailable = Get-EC2AvailabilityZone -Region $region -EndpointUrl $endpoint -ProfileName <MY_PROFILE>
    Write-Host "You have access to" $azAvailable.Length "Availability Zones."

    $runningInstances = (Get-EC2Instance -Region <REGION_NAME> -EndpointUrl https://fcu.<REGION_NAME>.outscale.com -ProfileName <MY_PROFILE>).Instances.Count
    Write-Host "You have $runningInstances Outscale EC2 instance(s) running."

    }
Catch {
    Write-Host $_.Exception.message
}

To create a VPC, run the following command in a PowerShell Command Shell:

PS C:\Windows\system32> New-EC2Vpc -CidrBlock "10.0.0.0/16" -region <REGION_NAME> -EndpointUrl https://fcu.<REGION_NAME>.outscale.com -ProfileName <MY_PROFILE>

CidrBlock                   : 10.0.0.0/16
DhcpOptionsId               : dopt-130dd65d
InstanceTenancy             : default
Ipv6CidrBlockAssociationSet : {}
IsDefault                   : False
State                       : available
Tags                        : {}
VpcId                       : vpc-f2bfc4e4

Related Pages

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.