Reputation: 43
Hi I am trying to deploy onto Elastic Beanstalk using AWS Powershell.
Currently I am just trying to get the EB environment using the following cmdlet: + Get-EBEnvironment -ApplicationName -EnvironmentId -VersionLabel -EnvironmentName -IncludedDeletedBackTo -IncludeDeleted
This is the cmdlet I used: Get-EBEnvironment -ApplicationName appName
However, I am getting the following error:
Get-EBEnvironment : No region specified or obtained from persisted/shell defaults. At C:\Users\lowong\Desktop\script.ps1:22 char:1
Am I missing other fields I have to put onto the cmdlet? or what's the problem?
(Here's the link to the documentation of the cmdlet: http://docs.aws.amazon.com/powershell/latest/reference/index.html?page=New-EBApplicationVersion.html&tocid=New-EBApplicationVersion)
Upvotes: 3
Views: 3420
Reputation: 36053
The error mentions the following:
No region specified or obtained from persisted/shell defaults.
So, you have 2 possible resolutions:
-Region
parameter, such as -Region us-east-1
. See Get-EBEnvironment Cmdlet. OrSet-DefaultAWSRegion
cmdlet to set the default region. See Set-DefaultAWSRegion CmdletUpvotes: 7
Reputation: 41
Note that Set-DefaultAWSRegion
is not persisted (you have to specify it for every powershell session).
If you want to persist region, it can be done as part of setting up your credentials with:
Initialize-AWSDefaults -ProfileName {profileName} -Region {region}
For more information see: Specifying Credentials
Upvotes: 4