forked from doccano/doccano
-
Notifications
You must be signed in to change notification settings - Fork 1
add terraform code for doccano service and conf file changes for nginx #31
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
Open
bekuchicago
wants to merge
10
commits into
pcdc_dev
Choose a base branch
from
GEAR-330
base: pcdc_dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8c98429
add terraform code for doccano service and conf file changes for nginx
5f56c65
update values for dev account
a0aa4ec
make rds and efs module
72e3163
updates to use alb module
26d0902
update module release version and Cert ARN
c402e0c
Merge branch 'pcdc_dev' into GEAR-330
grugna c07d665
Merge branch 'pcdc_dev' into GEAR-330
grugna ea79193
Merge branch 'GEAR-330' of https://github.com/chicagopcdc/doccano int…
grugna 0f561d3
update nginx config.default
grugna f4f1ce3
updates
bekuchicago File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| worker_processes ${WORKER_PROCESSES}; | ||
| worker_processes auto; | ||
|
|
||
| error_log /var/log/nginx/error.log warn; | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| module "doccano_ecs" { | ||
| source = "../modules/ecs" | ||
| app_name = var.app_name | ||
| subnet_ids = var.private_subnet_ids | ||
| lb_security_group = [module.doccano_alb.lb_security_group] | ||
| load_balancer = { | ||
| container_port = 8080 | ||
| } | ||
| vpc_id = var.vpc_id | ||
| target_group_arn = module.doccano_alb.doccano_target_group.arn | ||
| container_name = "nginx" | ||
| # container_count = 2 | ||
| efs_volume = module.doccano_efs.aws_efs_file_system | ||
| aws_efs_access_point_static_files = module.doccano_efs.access_point_id_static_files | ||
| efs_access_point_id_media = module.doccano_efs.access_point_id_media | ||
| efs_access_point_id_tmp = module.doccano_efs.access_point_id_tmp | ||
| database_url = module.rds.database_url | ||
| } | ||
|
|
||
| module "doccano_efs" { | ||
| source = "../modules/efs" | ||
| efs_name = var.app_name | ||
| vpc_id = var.vpc_id | ||
| subnet_ids = var.private_subnet_ids | ||
| security_groups = [module.doccano_ecs.ecs_tasks_sg] | ||
| } | ||
|
|
||
| module "doccano_alb" { | ||
| source = "../modules/alb" | ||
| environment = var.environment | ||
| vpc_id = var.vpc_id | ||
| subnet_ids = var.private_subnet_ids | ||
| } | ||
|
|
||
| module "rds" { | ||
| source = "../modules/rds" | ||
| rds_security_groups = module.doccano_ecs.ecs_tasks_sg | ||
| vpc_id = var.vpc_id | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| provider "aws" { | ||
| region = var.aws_region | ||
| default_tags { | ||
| tags = { | ||
| Environment = var.environment | ||
| Name = var.app_name | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| variable "aws_region" { | ||
| default = "us-east-1" | ||
| } | ||
|
|
||
| variable "environment" { | ||
| default = "dev" | ||
| } | ||
|
|
||
| variable "app_name" { | ||
| default = "doccano" | ||
| } | ||
|
|
||
| variable "private_subnet_ids" { | ||
| default = ["subnet-013e8d4a439201a84", "subnet-0025d9b857876f8a5"] | ||
| } | ||
|
|
||
| variable "vpc_id" { | ||
| default = "vpc-0ab59a594548de1b9" #doccano dev vpc | ||
| } | ||
|
|
||
| variable "efs_sg_id" { | ||
| default = "" | ||
| } | ||
|
|
||
| # variable "alb_sg_id" { | ||
| # default = "" | ||
| # } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module "dev" { | ||
| source = "./dev" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| resource "aws_lb" "doccano_lb" { | ||
| name = "doccano-lb-${var.environment}" | ||
| internal = false | ||
| load_balancer_type = "application" | ||
| security_groups = [aws_security_group.lb.id] #[aws_security_group.lb.id] | ||
| subnets = var.subnet_ids #["subnet-02daaea0d231975df", "subnet-0c7f4570d0c82bdc3"] | ||
| } | ||
|
|
||
| resource "aws_lb_listener" "http" { | ||
| load_balancer_arn = aws_lb.doccano_lb.arn | ||
| port = 80 | ||
| protocol = "HTTP" | ||
|
|
||
| default_action { | ||
| type = "forward" | ||
| target_group_arn = aws_lb_target_group.doccano_target_group.arn | ||
| } | ||
| } | ||
|
|
||
| resource "aws_lb_target_group" "doccano_target_group" { | ||
| name = "doccano-${var.environment}-target-group" | ||
| port = 80 | ||
| protocol = "HTTP" | ||
| target_type = "ip" | ||
| vpc_id = var.vpc_id | ||
|
|
||
| health_check { | ||
| path = "/" | ||
| interval = 30 | ||
| timeout = 5 | ||
| healthy_threshold = 2 | ||
| unhealthy_threshold = 3 | ||
| } | ||
| } | ||
|
|
||
| # ALB security Group: Edit to restrict access to the application | ||
| resource "aws_security_group" "lb" { | ||
| name = "doccano-lb-security-group" | ||
| description = "controls access to the ALB" | ||
| vpc_id = var.vpc_id | ||
|
|
||
| ingress { | ||
| protocol = "tcp" | ||
| from_port = 80 | ||
| to_port = 80 | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
|
|
||
| egress { | ||
| protocol = "-1" | ||
| from_port = 0 | ||
| to_port = 0 | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| output "doccano_target_group" { | ||
| value = aws_lb_target_group.doccano_target_group | ||
| } | ||
|
|
||
| output "lb_security_group" { | ||
| value = aws_security_group.lb.id | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| variable "environment" { | ||
|
|
||
| } | ||
|
|
||
| variable "subnet_ids" { | ||
|
|
||
| } | ||
|
|
||
| # variable "security_group_id" { | ||
|
|
||
| # } | ||
|
|
||
| variable "vpc_id" { | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| resource "aws_cloudwatch_log_group" "doccano" { | ||
| name = "/ecs/doccano-logs" | ||
| retention_in_days = 7 | ||
| } | ||
|
|
||
| resource "aws_cloudwatch_log_group" "flower" { | ||
| name = "/ecs/flower-logs" | ||
| retention_in_days = 7 | ||
| } | ||
|
|
||
| resource "aws_cloudwatch_log_group" "celery" { | ||
| name = "/ecs/celery-logs" | ||
| retention_in_days = 7 | ||
| } | ||
|
|
||
| resource "aws_cloudwatch_log_group" "nginx" { | ||
| name = "/ecs/nginx-logs" | ||
| retention_in_days = 7 | ||
| } | ||
|
|
||
| resource "aws_cloudwatch_log_group" "rabbitmq" { | ||
| name = "/ecs/rabbitmq-logs" | ||
| retention_in_days = 7 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| resource "aws_ecs_cluster" "cluster" { | ||
| name = "${var.environment}-cluster" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.