BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Amazon Releases a Preview of the New AWS Tools for PowerShell

Amazon Releases a Preview of the New AWS Tools for PowerShell

This item in japanese

In a recent blog post, Amazon announced it would release a preview of refactored AWS Tools for PowerShell allowing developers and administrators to manage their AWS services from the PowerShell scripting environment. The preview provides developers and administrators faster startup time by allowing them to choose which module to install. This release also includes a mandatory parameters feature, and has removed some old and obsolete "cmdlets".

Since the first release of AWS for PowerShell back in 2012, Amazon has expanded the cmdlets for the toolkit until it almost reached 6000, spanning over 160 services. Next, to these cmdlets, Amazon also added a module for users of PowerShell 6 or higher, capable of being run cross-platform. As all of these cmdlets were located in a single module, this meant that the time to import significantly increased.

Now, Amazon has tackled the problem of the load time by releasing a new set of modules to the PowerShell Gallery. Users can now get a preview release of a PowerShell module for each AWS Service. Furthermore, each of these preview PowerShell modules depends on a universal shared module named AWS.Tools.Common – a similar approach Amazon took with the AWS SDK for .NET on NuGet. 


According to the announcement blog post, Steve Roberts, senior technical evangelist at Amazon, explains the implication of this approach: 

  • Instead of downloading and installing a single large module for all services, developers and administrators can now install only the modules for services they need. By installing a service-specific module, the universal module will install automatically in the background.
  • Developers and administrators no longer need to explicitly import any of the preview modules before use, as the CmdletsToExport manifest property for each module is now correctly specified. 
  • The versioning strategy for the new modules currently follows the AWSPowerShell and AWSPowerShell.NetCore modules. The AWS team responsible for the PowerShell has detailed this strategy in their GitHub repository notice for the preview.

With the refactoring, the team also made several other changes. For example, they removed some old and obsolete cmdlets like CloudWatchEvents, and ElasticLoadBalacing, in favour of newer modules. Furthermore, it added mandatory parameters as a feature – allowing developers and administrators to mark parameters as necessary.

When writing PowerShell functions, developers and administrators need to create or update their scripts using the #Requires statement to use the new modules. Furthermore, they also need to add this statement for the universal module AWS.Tools.Common. For instance, if a developer creates a Lambda function in PowerShell that uses Amazon Simple Storage Service (S3), then he or she needs to add the following two statements to their function’s script file:

#Requires -Modules @{ModuleName='AWS.Tools.Common';ModuleVersion='3.3.563.0'}
#Requires -Modules @{ModuleName='AWS.Tools.S3';ModuleVersion='3.3.563.0'}

Developers and administrators can access the new modules from the PowerShell Gallery. Furthermore, they can submit any feedback, thoughts or compatibility issues on the GitHub issues repository of the AWS team responsible for the PowerShell modules.

Rate this Article

Adoption
Style

BT