-
Notifications
You must be signed in to change notification settings - Fork 0
First Run Config
The first time you set up the container you're going to need to do the following
You will need to manually setup an AWS user for Terraform, with sufficient permissions to create the necessary infrastructure. The simplest approach is to create a Terraform user who is a member of the AdministratorAccess Group, otherwise you'll need to add permissions for all services individually.
You will also need to manually create a versioned S3 bucket to maintain the terraform state. It is best practice to ensure you enable versioning on the bucket so you can revert to previous versions in DR situations.
Note S3 buckets must have a globally unique name, so you won't be able to use the same name as we setup in the workshop
You will need to create a docker.aws directory one level above where you cloned the repo. This ensures credentials don't get committed to git, but the docker-compose.yml file knows where to expect them, eg:
docker.aws
----credentials
----env_vars.ini
foss4g-serverless-ops
You should add a credentials file in the docker.aws directory with your the credentials for the Terraform user you created in Step 1, in the following format:
[foss4g_ops]
aws_access_key_id = AKIdddd
aws_secret_access_key = rf444
region = us-east-1
The region will be where Terraform will create your infrastructure. Note the ops/setenv.sh expects the creds to be tagged foss4g_ops. If you change the tag, you will have to amend the shell file too.
Finally we need to setup environment specific vars that you don't want to commit to source control. This should be in the same dir as the credentials file.
We need to set up 2 vars:
- db_appsstaging_pass - The password you want to give the pgAdmin admin user for your RDS Postgres instance
- horizon_app_bucket - The unique name for the bucket your horizon app will use to output renders to
[foss4g_ops]
db_appsstaging_pass = YourPasswordHere
horizon_app_bucket = NameOfYourUniqueBucketHere
Our terraform app ships with a small shell script to that allows you to set your local bucket and region. So open ops/setenv.sh. At the top of the script you can see the following lines, set them to bucket and region you set-up above:
REGION="your-region"
PROFILE="foss4g_ops"
BUCKET="your-bucket-name"
The rest of setenv.sh just sets up the local config read from our credentials and env_vars.ini file
Once configured you can run the container, and set the config as follows
docker-compose run foss4g-ops
cd ops
. ./setenv.sh