3

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

  • Get-EBEnvironment -ApplicationName evcfacade
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (Amazon.PowerShe...vironmentCmdlet:GetEBEnvironmentCmdlet) [Get-EBEnvironment], InvalidOperationException
    • FullyQualifiedErrorId : InvalidOperationException,Amazon.PowerShell.Cmdlets.EB.GetEBEnvironmentCmdlet

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)

2 Answers 2

7

The error mentions the following:

No region specified or obtained from persisted/shell defaults.

So, you have 2 possible resolutions:

  1. Include the -Region parameter, such as -Region us-east-1. See Get-EBEnvironment Cmdlet. Or
  2. Use the Set-DefaultAWSRegion cmdlet to set the default region. See Set-DefaultAWSRegion Cmdlet
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you! That's exactly the problem! I didn't think region really met setting the default region. I thought something was wrong with the command.
Your second link goes to the wrong location. It goes to New-EBApplicationVersion.
Thanks. It should be fixed now.
4

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.