zebrunner / e3s-terraform-deploy

1 stars 1 forks source link

E3S deploy by terraform

Feel free to support the development with a donation for the next improvements.

Zebrunner

Prerequisites

AWS Marketplace subscriptions

Zebrunner Selenium Grid Agent

Linux based ECS optimized instance with embedded Zebrunner tuning for scalable and reliable browser images usage

Zebrunner Selenium Grid Agent - Windows

Windows based ECS optimized instance with embedded Zebrunner tuning for scalable and reliable browser images usage

Software

Permissions

Configured aws profile with the following policies:

  1. In terraform-policy.json should be replaced the next placeholders:

    • {env} - Prefix for almost all e3s aws resources
    • {region} - Aws region in which all e3s resources will be deployed
    • {account} - Aws account id
    • {bucket_name} - Name of a bucket that would be used by e3s
    • {state_bucket_name} - Bucket to save current state of terraform
    • {state_bucket_key} - State file path in bucket
    • {dynamodb_table} - Dynamodb table name, which will support terraform's lock mechanism
    • {dynamodb_region} - Region of dynamodb table
  2. In terraform-ec2-view-policy.json should be replaced the next placeholders:

    • {env} - Prefix for almost all e3s aws resources
    • {region} - Aws region in which all e3s resources will be deployed
    • {account} - Aws account id
  3. In terraform-ec2-deploy-policy.json should be replaced the next placeholders:

    • {env} - Prefix for almost all e3s aws resources
    • {region} - Aws region in which all e3s resources will be deployed
    • {account} - Aws account id
    • {e3s-key-name} - Key name to attach to e3s-server instance

Deploy steps

  1. Clone repository and get to deploy folder
git clone https://github.com/zebrunner/e3s-terraform-deploy.git && cd ./e3s-terraform-deploy/deploy
  1. Create and configure terraform.tfvars file

Mandatory vars:

Optional vars:

  1. Create and configure config.{service}.tfbackend file.

Example of s3 backend state configure (config.s3.tfbackend file):

bucket         = "{state_bucket_name}"
key            = "{state_bucket_key}"
region         = "{state_bucket_region}"
dynamodb_table = "{state_dynamodb_table}"
encrypt        = true
  1. Init terraform providers
terraform init -backend-config=config.{service}.tfbackend
  1. Deploy
terraform apply
  1. [Optional] User policices.

For user's use could be created e3s-manage and e3s-monitor policies.