Skip to content

Latest commit

 

History

History
92 lines (69 loc) · 8.13 KB

README.md

File metadata and controls

92 lines (69 loc) · 8.13 KB

License pullreminders

Watchmaker AWS Terraform Module

terraform-aws-watchmaker

Overview

This repo contains a set of Terraform modules that utilizes the Cloudformation Stack data source to deploy AWS instances (Linux or Windows) configured with Watchmaker. The resources can be deployed as individual instances or in an AutoScaling Group.

For more information on installing and using Watchmaker, go to https://watchmaker.readthedocs.io.

How To Use This module

This repo is structured as follows:

  • Root: This folder contains an example of Terraform code that uses the Linux Instance module to deploy a Watchmaker Linux instance.
  • Modules: This folder contains the Terrafrom modules that are used to create the Watchmaker resources.
  • Examples: This folder contains working examples of how to use the modules. Users will need to modify the parameters for their specific AWS environment.

To use this module, create a Terraform file with the same format as main.tf in the root or example directories with variables set to your desired configuration.

In your Terraform working directory, run the following commands:

$ terraform init
$ terraform plan
$ terraform apply

Requirements

Name Version
terraform >= 0.12

Providers

No providers.

Resources

No resources.

Inputs

Name Description Type Default Required
AmiDistro (Required) Linux distro of the AMI string n/a yes
AmiId (Required) ID of the AMI to launch string n/a yes
KeyPairName (Required) Public/private key pairs allow you to securely connect to your instance after it launches string n/a yes
Name (Required) Name of CloudFormation Stack string n/a yes
SecurityGroupIds (Required) List of security groups to apply to the instance string n/a yes
SubnetId (Required) ID of the subnet to assign to the instance string n/a yes
AppScriptParams (Optional) Parameter string to pass to the application script. Ignored if AppScriptUrl is blank string null no
AppScriptShell (Optional) Shell with which to execute the application script. Ignored if AppScriptUrl is blank string "bash" no
AppScriptUrl (Optional) S3 URL to the application script in an S3 bucket (s3://). Leave blank to launch without an application script. If specified, an appropriate InstanceRole is required string null no
AppVolumeDevice (Optional) Device to mount an extra EBS volume. Leave blank to launch without an extra application volume string null no
AppVolumeMountPath (Optional) Filesystem path to mount the extra app volume. Ignored if AppVolumeDevice is blank string "/opt/data" no
AppVolumeSize (Optional) Size in GB of the EBS volume to create. Ignored if AppVolumeDevice is blank string "1" no
AppVolumeType (Optional) Type of EBS volume to create. Ignored if AppVolumeDevice is blank string "gp2" no
CfnEndpointUrl (Optional) URL to the CloudFormation Endpoint. e.g. https://cloudformation.us-east-1.amazonaws.com string "https://cloudformation.us-east-1.amazonaws.com" no
CfnGetPipUrl (Optional) URL to get-pip.py string "https://bootstrap.pypa.io/2.6/get-pip.py" no
EnableRepos (Optional) Specify repos to be enabled by yum-config-manager string null no
InstanceRole (Optional) IAM instance role to apply to the instance string null no
InstanceType (Optional) Amazon EC2 instance type string "t2.micro" no
NoPublicIp (Optional) Controls whether to assign the instance a public IP. Recommended to leave at true unless launching in a public subnet bool true no
NoReboot (Optional) Controls whether to reboot the instance as the last step of cfn-init execution bool false no
NoUpdates (Optional) Controls whether to run yum update during a stack update (On the initial instance launch, Watchmaker always installs updates) bool false no
PrivateIp (Optional) Set a static, primary private IP. Leave blank to auto-select a free IP string null no
PypiIndexUrl (Optional) URL to the PyPi Index string "https://pypi.org/simple" no
ToggleCfnInitUpdate (Optional) A/B toggle that forces a change to instance metadata, triggering the cfn-init update sequence string "A" no
WatchmakerAdminGroups (Optional) Colon-separated list of domain groups that should have admin permissions on the EC2 instance string null no
WatchmakerAdminUsers (Optional) Colon-separated list of domain users that should have admin permissions on the EC2 instance string null no
WatchmakerComputerName (Optional) Sets the hostname/computername within the OS string null no
WatchmakerConfig (Optional) URL to a Watchmaker config file string null no
WatchmakerEnvironment (Optional) Environment in which the instance is being deployed string null no
WatchmakerOuPath (Optional) DN of the OU to place the instance when joining a domain. If blank and WatchmakerEnvironment enforces a domain join, the instance will be placed in a default container. Leave blank if not joining a domain, or if WatchmakerEnvironment is false string null no
WatchmakerS3Source (Optional) Flag that tells watchmaker to use its instance role to retrieve watchmaker content from S3 bool false no

Outputs

Name Description
watchmaker-lx-instance-stack CloudFormation stack object for watchmaker-lx-instance-stack