Skip To Content

Automate CloudFormation stack creation using Python or Windows PowerShell Tools for AWS

There are multiple ways to automate CloudFormation stack creation. This topic describes how to use a AWS SDK for Python or AWS Tools for Windows PowerShell and provides sample scripts.

See Tools for Amazon Web Services in the AWS help for information on other automation options.

Use AWS SDK for Python

Follow these steps to download and use sample Python scripts with CloudFormation templates to deploy ArcGIS Enterprise or ArcGIS Server sites.

  1. Make sure you have Python installed on the machine where you will run the Python script. The minimum supported Python version is 2.6.

    Tip:

    Supported Python versions are installed with ArcGIS Server and ArcGIS Desktop.

  2. Download and install AWS SDK for Python (Boto) on the same machine where you installed Python.
  3. Download the sample Python script and parameters files.
  4. Edit the parameters file for the CloudFormation template you want to use with the Python script so the parameter file includes the settings you need.

    For example, to create a single-machine base ArcGIS Enterprise deployment on a Windows machine on AWS, open the cf_parameters_win_allinone_webgisstack.json parameters file in a text editor and update the parameter values to reflect what you need for your deployment.

  5. Save and close the parameters file.
  6. Open a Command Window or Python client and change directories to the one that contains the Python script and updated parameters file.
  7. Run the Python script.

    For example, to run the sample script with the arcgis-allinone-windows template, type python cloudformation_stack_creation_<version>.py <AWS_Access_Key> <AWS_Secret_Access_Key> cf_parameters_win_allinone_webgisstack.json, but replace the following with the information specific to your deployment:

    • <version>—The software version in the script name
    • <AWS_Access_Key_ID>—The Access Key ID for your AWS account.
    • <AWS_Secret_Access_Key>—The Secret Access Key for your AWS account

    As the script runs, progress status displays in the Python client window.

Use AWS Tools for Windows PowerShell

Follow these steps to download and use sample PowerShell scripts to create a highly available ArcGIS Enterprise deployment or ArcGIS Server site.

  1. Manually complete the prerequisite steps needed for the CloudFormation template you want to use, such as creating an Amazon Simple Storage Service (S3) deployment bucket, uploading license files and your SSL certificate to the deployment bucket, and creating a VPC.
  2. Download and install AWS Tools for Windows PowerShell.
  3. Download sample PowerShell scripts.
  4. In a text editor, open the sample script you want to use.
  5. Provide information specific to your deployment and save and close the script.
  6. Open a PowerShell Console.
  7. Change directories to the folder where you saved the script and run the script.

    For example, to run the arcgis-enterprise-ha.ps1 script, type arcgis-enterprise-ha.ps1 at the PowerShell prompt.