-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Terraform base setup for ECS infrastructure #44
Conversation
database = { | ||
username = module.database.db_username, | ||
password = module.database.db_password, | ||
hostname = module.database.db_hostname, | ||
name = module.database.db_name, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I didn't know that we can pass a object
django_debug: "False", | ||
app_bucket: var.app_bucket, | ||
django_secret_key: var.backend_secret_key, | ||
django_allowed_hosts: "*,", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not this configs be added in the variables.tf
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely. I didn't work much on this because of issue #45 and I think that env vars should work better with Terraform local values (https://www.terraform.io/docs/configuration/locals.html) instead of passing variables around, maybe as an object/hashmap. Can it be added as a future improvement?
vars = merge(var.container_env_vars, { | ||
aws_region = var.region | ||
container_name = "${var.project_name}-${var.alias_name}-${var.environment}" | ||
cloudwatch_log_group = aws_cloudwatch_log_group.logs.name | ||
container_image = "${aws_ecr_repository.ecr_repo.repository_url}:latest" | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
This is a configuration to create an ECS cluster, database, bucket and all underlying structure to run a backend+frontend application. There is a README file that explains in more details how to use this configuration.
There are a few TODO comments that have to be addressed in the near future, but with this configuration we're already able to setup an infrastructure without the updates.
For mobile applications, that don't require a frontend, we still have to manually remove the frontend service.