-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-EC2Region : No difference between -Region and -RegionName parameters #46
Comments
Additonally, I think this issue exists in the PowerShell implementation because I can execute the following snippet and get the expected results: import-module awspowershell.netcore |
Hello, thank you for reporting this.
solves your problem? The Get-EC2Region cmdlets has two parameters (see here):
All the Common Credential and Region Parameters are dynamic parameters. |
Yes, this does provide an adequate solution for scripting. It's an annoyance for interactive use/development since it breaks splatting to this cmdlet using the same collection that I splat to every other cmdlet. I support the change for AWS.Tools - I came across this issue in converting/updating/testing scripts in preparation for migration from AWSPowerShell/NetCore to AWS.Tools, so I'm less concerned with getting it fixed in AWSPowerShell/NetCore. |
Hello, as announced in #61, we will change all parameters to static in the upcoming major version (v4). This change is already available in preview in the latest release of AWS.Tools. |
Get-EC2Region appears to have no different functionality between the -Region and -RegionName parameters.
Expected Behavior
-Region should declare which region to execute the API call against, but not filter the output (consistent with how the AWS CLI works for this command)
-RegionName should filter the output of the API to the list of regions provided.
Current Behavior
Both -Region and -RegionName parameters filter the output.
Steps to Reproduce (for bugs)
Import-Module AWSPowerShell.NetCore
Set-DefaultAWSRegion us-east-1
Get-EC2Region -Region us-east-1 -ProfileName "AWS CORP LAB" #returns only us-east-1
Get-EC2Region -RegionName us-east-1 -ProfileName "AWS CORP LAB" #returns only us-east-1
aws ec2 describe-regions --region us-east-1 --profile "AWS CORP LAB" #returns all enabled regions
Context
We use Get-EC2Region because we do not enable all regions in all of our accounts, so for scripts which iterate over multiple accounts and regions, we must obtain which regions are active to avoid time-outs when attempting to make an API call to a disabled region.
Your Environment
Include as many relevant details about the environment where the bug was discovered.
$PSVersionTable.OS
: Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64$PSVersionTable.PSEdition
: Core (6.2.1)The text was updated successfully, but these errors were encountered: