Before you can deploy the architecture with Terraform you will need to set the variables that Terraform will use to generate the AWS services. First, You will need to clone and change directory to the the NervesHub Terraform repo. From there you can copy the example tfvars file:
cp terraform.tfvars.example terraform.tfvars
If you haven't done so yet, you will need to configure your AWS credentials so that the AWS CLI tool can access AWS. Please note the associated profile name. Finally, fill out the variables in the newly created terraform.tfvars
with the data that will best support your instance of NervesHub. Below is a brief description of required or important variables and suggested values:
aws_region
= the region to which you want the app deployed e.g.us-east-1
aws_profile
= the profile from your AWS credentials file that will grant Terraform access to AWSbucket
= an S3 bucket for storing the Terraform state filesdynamodb_table
= a dynamodb table for locking the Terraform statekey
= name for the Terraform state file e.g.terraform.tfstate
operators
= a list of IAM usersdb_username
= name for db userdb_password
= securely generated random string password for the DBdomain
= the domain matching the production hosted zone created in the configure DNS stepweb_secret_key_base
= securely generated random string (e.g.mix phx.gen.secret
)web_smtp_username
= the Access Key ID saved from the configure SES stepweb_smtp_password
= the Secret Access Key from the configure SES stepweb_from_email
= the email address from which email will be sent on behalf of the app. Configured in SES stepbucket_prefix
= the prefix for all S3 buckets that will be generatederl_cookie
= securely generated random string (e.g.mix phx.gen.secret
)www_live_view_signing_salt
= securely generated random string (e.g.mix phx.gen.secret 32
)ca_image
= docker repo for nerves_hub_ca e.g.nerveshub/nerves_hub_ca:latest
www_image
= docker repo for nerves_hub_www e.g.nerveshub/nerves_hub_www:latest
device_image
= docker repo for nerves_hub_device e.g.nerveshub/nerves_hub_device:latest
api_image
= docker repo for nerves_hub_api e.g.nerveshub/nerves_hub_api:latest
whitelist
= a list of IP addresses that can access the site (optional, usually used for a staging environment)