Skip to content

scalr-eap/scalr-install-rds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scalr-install

Install and configure Scalr with Terraform on AWS

This template will install Scalr on multiple servers. Currently it sets up 6 servers

  • Mysql Master and Slave with replication enabled
  • influxDB
  • Worker
  • Proxy/App x 2
  • AWS ELB created for the Proxies.

This template is configured as follows.

  1. Built for AWS
  2. Auto selects latest Canonical Ubuntu 18.04 LTS AMI for the chosen region
  3. Requires user to define VPC and Subnet mappings either in terraform.tfvars(.json) or via policy bindings in scalr-module.hcl (Scalr Next-gen, see https://scalr-athena.readthedocs-hosted.com/en/latest/details/variables.html#binding-to-policy)
  4. Scalr requires 4GB minimum of Ram. Instance type must be set in terraform.tfvars(.json) or via policy binding.

Below are descriptions on how to use this template in 3 possible modes.

  • Locally
  • Scalr Next-gen as the remote backend
  • Scalr Next-Gen Service Catalog Offering

Using Locally

  1. Pull the repo.
  2. Upload your public key to AWS.
  3. Copy your Scalr license to ./license/license.json in the repo
  4. Copy your private ssh key to ./ssh/id_rsa in the repo
  5. Set values for the following variables in terraform.tfvars(.json) or provide values on the command line at runtime
  6. region - AWS Region to use.
  7. key_name - Key in AWS.
  8. token - Your packagecloud.io download token supplied with the license.
  9. vpc - VPC to be used.
  10. subnet - Subnet to be used.
  11. instance_type - Must be 4GB ram. t3.medium recommended.
  12. name_prefix - 1-3 character prefix to be added to all instance names.
  13. Adjust scalr.ui.login_warning in scalr_install_set_config.sh to suit your needs.
  14. Comment out the remote backend config block in scalr-prod.tf (terraform {......).
  15. Add your AWS access and secret keys to terraform.tfvars(.json), or enter them at the run time prompts. (scalr_aws_access_key, scalr_aws_secret_key)
  16. Run terraform init;terraform apply and watch the magic happen.

Using with Scalr Next-Gen as Remote Backend

NOTE: SSH Key and Scalr license can either be provided via Files in the repo or through Variables in Scalr Next-Gen

  1. Pull the repo.
  2. Upload the public key to AWS.
  3. To provide the Scalr license via a file copy it to ./license/license.json in the repo
  4. To provide the SSH private key via a file copy it to ./shh/id_rsa in the repo
  5. Create a CLI workspace in Scalr Next-Gen and configure the backend to match in scalr-prod.tf.
  6. Create an TF API token in Scalr Next-Gen and add it to ~/.terraformrc.
  7. In Scalr Workspace add Terraform variables and values as follows (note that terraform.tfvars(.json) in the template is not used with a remote backend).
  8. region - AWS Region to use.
  9. key_name - Key in AWS.
  10. token - Your packagecloud.io download token supplied with the license. Mark as "SENSITIVE".
  11. To provide the license via variable: license - The full text of your Scalr license file. Mark as "SENSITIVE".
  12. To provide the SSH private key via variable: ssh_private_key - The full text of you private key file in either PEM or PPK format. Mark as "SENSITIVE".
  13. vpc - VPC to be used.
  14. subnet - Subnet to be used.
  15. instance_type - Must be 4GB ram. t3.medium recommended.
  16. name_prefix - 1-3 character prefix to be added to all instance names.
  17. Adjust scalr.ui.login_warning in scalr_install_set_config.sh to suit your needs.
  18. Run terraform init;terraform apply and watch the magic happen.

Using with Scalr Next-Gen Service Catalog Offering.

In general follow the example here https://scalr-athena.readthedocs-hosted.com/en/latest/next-gen/service_catalog.html#service-catalog

For this specific template you need to do the following in Scalr

  1. Create Policies (scalr-module.hcl shows the policy bindings that are required)
  2. cloud.locations - Policy to limit the cloud locations (note this can be all locations but the policy must exist)
  3. cloud.networks - Create a policy for every location allowed in the cloud.locations policy.
  4. cloud.subnets - Create a policy for every location/network (vpc) combination that is allowed.
  5. cloud.instance_types - Restrict the instance types that are allowed. Minimum 4GB of ram.
  6. Create a Global Variable called name_prefix_fmt of type text with the REGEX ^[A-Z0-9]{1,3}$.
  7. Fork or clone the Source repo (https://github.com/scalr-eap/scalr-install)
  8. Create the Service Catalog offering pointing to your copy repo
  9. Adjust scalr.ui.login_warning in scalr_install_set_config.sh to suit your needs.
  10. Request the offering.

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published