aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
241 stars 79 forks source link

Add Cmdlet to Find Other AWS.Tools.* Modules #49

Closed tommymaynard closed 4 years ago

tommymaynard commented 5 years ago

Expected Behavior

I recommend that a new cmdlet be created in the AWS.Tools.Common PowerShell module. Its purpose would be to easily determine all the other AWS.Tools.* modules. One option would essentially make it a wrapper around a modified Find-Module command.

Current Behavior

Currently there is no way to return a module list for the AWS.Tools.* modules unless you know to use PowerShellGet's Find-Module Cmdlet. Even in writing, I've yet to see a complete list. I thought this might be helpful after reading this recently, "In order to manage each AWS service, install the corresponding module (e.g. AWS.Tools.EC2, AWS.Tools.S3, etc) from ..." This isn't helpful, especially if Get-AWSPowerShellVersion -ListServiceVersionInfo might make you think CloudFormation would be AWS.Tools.CFN, and CloudFront AWS.Tools.CF -- these are not correct. They're actually AWS.Tools.CloudFormation and AWS.Tools.CloudFront.

Possible Solution

Create a new cmdlet, or function, called Find-AWSToolsModule, or whatever. In PowerShell, it might look like the below example. Instead of using Find-Module, this could be hard coded in the cmdlet/function, or a file could be sent in as a part of the *Common module, providing someone remembers to update it when you guys are moving to a new version. Better yet, make it a part of the build process/dynamic (so you don't have to remember to update it). A txt doc, or whatever, shipped with the module would be faster than relying on Find-Module, but the ultimate decision there, wouldn't be up to me.

Function Find-AWSToolsModule {
    try {
        Find-Module -Name AWS.Tools.* | Sort-Object -Property Name
    } catch {
        Write-Warning -Message 'Unable to invoke the Find-Module command.'
    }
}

Steps to Reproduce (for bugs)

N/A

Context

There should be a simple way that's dependent on Amazon/AWS to know the names of all the AWS.Tools.* PowerShell modules. Edit: I did find this listing, which is helpful.

Your Environment

jrjespersen commented 5 years ago

Additionally or alternatively, what about a cmdlet that takes a ServiceName parameter and returns the module name? I can see good use cases for both getting a list of all modules (finding new things), and getting a specific module for a service.

matteo-prosperi commented 5 years ago

Thanks for your feedback, this is currently being designed.

matteo-prosperi commented 4 years ago

A new cmdlet Get-AWSService will be included in the next release. Thanks for opening this issue.

PS> Get-AWSService

Service            : CertificateManager
CmdletNounPrefix   : ACM
ModuleName         : AWS.Tools.CertificateManager
SDKAssemblyVersion : 3.3.100.92
ServiceName        : AWS Certificate Manager

Service            : ACMPCA
CmdletNounPrefix   : PCA
ModuleName         : AWS.Tools.ACMPCA
SDKAssemblyVersion : 3.3.101.56
ServiceName        : AWS Certificate Manager Private Certificate Authority

Service            : AlexaForBusiness
CmdletNounPrefix   : ALXB
ModuleName         : AWS.Tools.AlexaForBusiness
SDKAssemblyVersion : 3.3.106.26
ServiceName        : Alexa For Business

Service            : Amplify
CmdletNounPrefix   : AMP
ModuleName         : AWS.Tools.Amplify
SDKAssemblyVersion : 3.3.102.11
ServiceName        : AWS Amplify

Service            : APIGateway
CmdletNounPrefix   : AG
ModuleName         : AWS.Tools.APIGateway
SDKAssemblyVersion : 3.3.103.15
ServiceName        : Amazon API Gateway
...

We have also added a new module AWS.Tools.Installer to simplify installation, uninstallation and update of the AWS.Tools modules.

matteo-prosperi commented 4 years ago

This feature is now available in version 4.0 of the modules. Thank you for reporting this issue.