Skip to content

Commit

Permalink
add aws task definitions for backend and frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Beici Liang committed Apr 3, 2023
1 parent 740f126 commit fda56cd
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 0 deletions.
73 changes: 73 additions & 0 deletions aws/task-definitions/backend-flask.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"family": "backend-flask",
"executionRoleArn": "arn:aws:iam::366939446291:role/CruddurServiceExecutionRole",
"taskRoleArn": "arn:aws:iam::366939446291:role/CruddurTaskRole",
"networkMode": "awsvpc",
"cpu": "256",
"memory": "512",
"requiresCompatibilities": [
"FARGATE"
],
"containerDefinitions": [
{
"name": "xray",
"image": "public.ecr.aws/xray/aws-xray-daemon" ,
"essential": true,
"user": "1337",
"portMappings": [
{
"name": "xray",
"containerPort": 2000,
"protocol": "udp"
}
]
},
{
"name": "backend-flask",
"image": "366939446291.dkr.ecr.us-east-1.amazonaws.com/backend-flask",
"essential": true,
"healthCheck": {
"command": [
"CMD-SHELL",
"python /backend-flask/bin/health-check"
],
"interval": 30,
"timeout": 5,
"retries": 3,
"startPeriod": 60
},
"portMappings": [
{
"name": "backend-flask",
"containerPort": 4567,
"protocol": "tcp",
"appProtocol": "http"
}
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "cruddur",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "backend-flask"
}
},
"environment": [
{"name": "OTEL_SERVICE_NAME", "value": "backend-flask"},
{"name": "OTEL_EXPORTER_OTLP_ENDPOINT", "value": "https://api.honeycomb.io"},
{"name": "AWS_COGNITO_USER_POOL_ID", "value": "us-east-1_GN7uh5LmT"},
{"name": "AWS_COGNITO_USER_POOL_CLIENT_ID", "value": "3imco9n5ju2bngsltjdvfvnusl"},
{"name": "FRONTEND_URL", "value": "*"},
{"name": "BACKEND_URL", "value": "*"},
{"name": "AWS_DEFAULT_REGION", "value": "us-east-1"}
],
"secrets": [
{"name": "AWS_ACCESS_KEY_ID" , "valueFrom": "arn:aws:ssm:us-east-1:366939446291:parameter/cruddur/backend-flask/AWS_ACCESS_KEY_ID"},
{"name": "AWS_SECRET_ACCESS_KEY", "valueFrom": "arn:aws:ssm:us-east-1:366939446291:parameter/cruddur/backend-flask/AWS_SECRET_ACCESS_KEY"},
{"name": "CONNECTION_URL" , "valueFrom": "arn:aws:ssm:us-east-1:366939446291:parameter/cruddur/backend-flask/CONNECTION_URL" },
{"name": "ROLLBAR_ACCESS_TOKEN" , "valueFrom": "arn:aws:ssm:us-east-1:366939446291:parameter/cruddur/backend-flask/ROLLBAR_ACCESS_TOKEN" },
{"name": "OTEL_EXPORTER_OTLP_HEADERS" , "valueFrom": "arn:aws:ssm:us-east-1:366939446291:parameter/cruddur/backend-flask/OTEL_EXPORTER_OTLP_HEADERS" }
]
}
]
}
57 changes: 57 additions & 0 deletions aws/task-definitions/frontend-react-js.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"family": "frontend-react-js",
"executionRoleArn": "arn:aws:iam::366939446291:role/CruddurServiceExecutionRole",
"taskRoleArn": "arn:aws:iam::366939446291:role/CruddurTaskRole",
"networkMode": "awsvpc",
"cpu": "256",
"memory": "512",
"requiresCompatibilities": [
"FARGATE"
],
"containerDefinitions": [
{
"name": "xray",
"image": "public.ecr.aws/xray/aws-xray-daemon" ,
"essential": true,
"user": "1337",
"portMappings": [
{
"name": "xray",
"containerPort": 2000,
"protocol": "udp"
}
]
},
{
"name": "frontend-react-js",
"image": "366939446291.dkr.ecr.us-east-1.amazonaws.com/frontend-react-js",
"essential": true,
"healthCheck": {
"command": [
"CMD-SHELL",
"curl -f http://localhost:3000 || exit 1"
],
"interval": 30,
"timeout": 5,
"retries": 3
},
"portMappings": [
{
"name": "frontend-react-js",
"containerPort": 3000,
"protocol": "tcp",
"appProtocol": "http"
}
],

"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "cruddur",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "frontend-react-js"
}
}
}
]
}

0 comments on commit fda56cd

Please sign in to comment.