Execution containers AWS Powershell version

Further to the topic I previously raised

I’ve attempted to use an execution container. The container works, but I don’t see the expected version of tools.
I tried using the image “octopusdeploy/worker-tools:windows.ltsc2019:3.0.0”, which according to dockerhub was created with this Dockerfile which specifies the AWS PowerShell version as 4.1.2.

But when I run the PowerShell command Get-AWSPowerShellVersion

It reports as 3.3.390

AWS Tools for Windows PowerShell 
Version 3.3.390.0 
Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 
Amazon Web Services SDK for .NET 
Core Runtime Version 3.3.28.0 
Copyright 2009-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 
Release notes: https://aws.amazon.com/releasenotes/PowerShell 
This software includes third party software subject to the following copyrights: 
- Logging from log4net, Apache License 
[http://logging.apache.org/log4net/license.html]

How do I get the container to use the newer version?

Hi @simon.williams ,

Thanks for getting in touch with us and I apologize for the slow response.

I wanted to let you know I’m currently looking into this with a few other colleagues and will keep you posted with any updates, or any potential workarounds.

Best,
Patrick

Hi @simon.williams,

It looks like this is currently undesired behavior with execution containers, but the good news is this will be fixed in our upcoming 2021.2 release.

In the meantime, there are two quick workarounds we’ve found that should allow you to move forward.

The first option is to change the step Container Image section to ‘Run directly on a worker’, and from there you should see a section ‘AWS Tools’ appear below it. Select ‘Use AWS Tools pre-installed on worker’, then change the Container Image back to ‘Runs inside a container, on a worker’ and save.

The other option is to use a project variable OctopusUseBundledAwsPowerShellModules and set it to ‘False’. Note this will show a warning as this will soon be deprecated, but we’ve tested it, and it should work currently.

Either of these options should modify the step to use the more up-to-date (4.1.2) version of AWS Powershell. Would you be able to try one of these and let us know if it works for you?

Best,
Patrick

Hi Patrick,

I’ve just tried this out, and can confirm that it’s working. I used the first option.

The output is now:

AWS Tools for PowerShell 
July 23rd 2021 09:46:36Info
Version 4.1.2.0 
July 23rd 2021 09:46:36Info
Copyright 2012-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 
July 23rd 2021 09:46:36Info
Amazon Web Services SDK for .NET 
July 23rd 2021 09:46:36Info
Core Runtime Version 3.5.1.23 
July 23rd 2021 09:46:36Info
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 
July 23rd 2021 09:46:36Info
Release notes: https://github.com/aws/aws-tools-for-powershell/blob/master/CHANGELOG.md 
July 23rd 2021 09:46:36Info
This software includes third party software subject to the following copyrights: 
July 23rd 2021 09:46:36Info
- Logging from log4net, Apache License 
July 23rd 2021 09:46:36Info
[http://logging.apache.org/log4net/license.html]

Thank you so much for your help, this really unblocks the problem I have.

Hi @simon.williams,

Thanks for confirming that worked, and I’m glad to hear it! If you need anything else feel free to reach out to us.

Best,
Patrick

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.