Code Monkey home page Code Monkey logo

appstream-elastic-fleets-automate-application-packaging's Introduction

Automate Elastic Fleet Application Updates with Systems Manager

This repository was created to accelerate AppStream 2.0 Elastic Fleet migrations by automating the application packaging process. The provided script in this repository goes in tandem with this blog post. The script can be ran locally or remotely via a Systems Manager Run Command against a SSM-Managed Windows EC2 instance. As provided, the script will create a virtual hard disk (VHD) meeting the specified size you pass as a parameter. It will then mount it to the machine, install Google Chrome on the VHD, detach the VHD, and then upload to a S3 bucket (if provided). For more details around the available parameters.

Script Steps

Parameters

  • installSize This is the size the VHDX should be. The size should always be larger than the install of your application.
  • vhdName This is what you would like to name your VHDX file. This name will be used as identifier.
  • vhdLocation The local path that the VHDX file will be saved. This is not a mandatory parameter. If not provided, a folder will be created under $env:TEMP that matches vhdName. If the folder path matching vhdName already exists, it will create a new random folder (vhdName + random int).
  • vhdMountLetter The drive letter you would like to mount the VHDX to. This is not a mandatory parameter. If not provided, the script will automatically find an open drive letter assuming no mount path has been provided. If both a mount letter and mount path are not provided, the mount letter will be prioritized and a random open drive letter will be found.
  • vhdMountPath Specifies the mount path you would like to mount the VHDX to. This is not a mandatory parameter. If both a mount letter and mount path are provided, the mount letter will be prioritized.
  • vhdS3Bucket Specifies the S3 location where you would like to store the VHDX file. Note, if you do not have versioning enabled on the bucket, each file named the same will be overwritten.
  • force Boolean parameter that allows your vhdMountPath to be created. If the path is not already created, the script will exit with no verified destination. If you set -force $true, the supplied path will be created.

Steps

  1. Validation - Test provided VHDLocation and if none is provided, create a folder under $env:TEMP.
  2. Validation - Test the folder paths and if there is not a folder, the script will create one. If a folder is present, it will clear out txt/VHDX files that reside there from previous invocations.
  3. Validation - Test the provided drive letter and if in use, exit with error code.
  4. Validation - Test VHDMountPath, if it was provided. If the folder is not empty or it doesn't exist, the script will exit. However, if -force $true is provided as a parameter, the mount path will be created if not found.
  5. Validation - If no drive letter or mount path is provided, the script will find an open drive letter.
  6. Build Configuration - This stage will build out the commands that will create and mount your VHDX file. The disk will be expandable up to the size you provided as a parameter and will be formatted as NTFS.
  7. Execute Configuration - Once the configuration is built out, it will be passed into DISKPART to be executed.
  8. Application Install - After DISKPART is finished, your VHD will be mounted. From here you can run logic to install your application. As provided, the script will install the latest version of Google Chrome. If you intend to use the script to install Google Chrome, ensure you follow the blog linked above.
  9. Detach VHD - After your installation is complete, the script will detach the VHD.
  10. Upload to S3 - If you provided an accessible S3 bucket, the script will upload the VHD file to the specified bucket.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

appstream-elastic-fleets-automate-application-packaging's People

Contributors

amazon-auto avatar morgnza avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.