global - Modules that apply to all environments. See modules for details.
geomatch_app - Core modules. Contains modules scoped to a single environment
It is self contained and should be on a separate account. Resources from here needed by other modules should be
accessed with data blocks instead of remote state.
Should follow the Terraform best practices.
Most notably, use underscores for variable names, and use this for resource names only used
once in a module.
All variable values should be lowercase with words separated by hypens.
Additional restrictions are documented in variables.tf.
All AWS resource names should be formated as:
{project-name}-{environment}-{resource-name}
In the above example, resource-name should be descriptive of the resource, such as ecs-service-role or ecs-service-role-policy. It may also be omitted where it makes sense (e.g. log group is named {project-name}-{environment}
because there should only logically be a single log group per environment)
When referring to the GeoMatch web server, prefer the name app (i.e. app-server, app-container, app, ...).
The following tags should be present on each resource:
Project = "Project Name"
Environment = "Environment"
See the AWS Documentation on creating a key pair.
The IAM user created should have the AdministratorAccess policy.
You can use any module in this folder, but first you must create an SSH key for Github's Deploy Keys (Assuming you're running terraform locally):
ssh-keygen -t ed25519 -C "[email protected]:GeoMatch/geomatch-deployment.git"
Then append the appropriate ssh config:
vim ~/.ssh/config
Host github.com-geomatch-deploy
Hostname github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
And add your passphrase to ssh-agent:
ssh-add [-K if on MacOS] ~/.ssh/id_ed25519
Next add the contents of ~/.ssh/id_ed25519.pub to geomatch-deployment's Deploy Keys.
Finally, you can source the module:
module "geomatch_ecs" {
source = "git::https://github.com/GeoMatch/geomatch-deployment.git//terraform/geomatch_app/ecs?ref=production"
environment = "prod"
project = "geomatch-[country]"
some_var = "some-value"
...
}The ref param will be the branch of this repo to pull.
