mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 01:25:32 +00:00
cloud setup initial directory and documentation
add architecture diagram docs: include image source docs: update aws dashboard link docs: update aws dashboard link docs: update read me with deployment instructions and costing docs : nocohub cloud setup manual docs : minor fix, added \n
This commit is contained in:
committed by
starbirdtech383
parent
b039027646
commit
2fb2ac9f88
86
cloud/README.md
Normal file
86
cloud/README.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# 👩🏫 Architecture and cloud setup (Work In Progress)
|
||||
This section describes a cloud architecture on how oss version of nocodb is hosted on cloud for saas offering
|
||||
(nocohub.ai), including information about the security, deployment, operations and operations playbooks.
|
||||
|
||||
## Architecture:
|
||||
### Architecture Diagram
|
||||

|
||||
|
||||
### Core Components
|
||||
- nocohub (an extension to nocodb with added enterprise features)
|
||||
- redis (for metadata cache)
|
||||
- postgres (database)
|
||||
|
||||
### AWS components for hosting / Cloud Setup:
|
||||
we have chosen AWS as cloud provider and leverage many of the aws services in hosting saas offering. Below are some of the important services being used but not limited
|
||||
|
||||
- ECS for scalabilty: Amazon ECS is a fully managed container orchestration service that makes it easy for you to deploy, manage, and scale containerized applications.
|
||||
- Fargate and EC2 for instances
|
||||
- Autoscaling : asg and launch configurations
|
||||
- Network and Security : security groups
|
||||
- ECR
|
||||
- S3
|
||||
|
||||
- Cloud watch for monitoring dashboards
|
||||
- Network : VPC for network isolation, AWS Application Loadbalancers and target groups for traffic control
|
||||
|
||||
Security:
|
||||
- AccessControl : leverage AWS VPCs and security groups to isolate access to instances and datastores.
|
||||
- Encryption : Secret Manager for persisting secure information and network traffic via SSL (certs created via SSL Manager)
|
||||
|
||||
Monitoring and Management:
|
||||
CloudWatch : Leverage cloud watch for monitoring our systems and below is the dashboard.
|
||||
[nocohub master dashboard](https://us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#dashboards:name=nocohub-001-master-dashboard) can be used to observe the metrics of lb, ecs, redis and rds
|
||||
|
||||
### Deployment and Operations
|
||||
Deployment : Deployment refers to rollout of nocohub application which is hosted in ECS and requires a new docker image to be rolled out. It is expected that docker image tag RC_M.m.p is availabe in container registry.
|
||||
|
||||
#### Proposed Approach for deployment
|
||||
1. Register new ECS Task Definition with image url pointing to RC_M.m.p
|
||||
2. Invoke AWS Code Deploy with new task definition.
|
||||
3. Code deploy performs the canary rollout (rollback if test fails)\
|
||||
TODO:
|
||||
- include rollout scripts and create trigger point an api or github action for the same
|
||||
- canary tests to be implemented and rollback if tests fail
|
||||
- Rollout alerts to slack channel
|
||||
- Rollback troubleshooting documentation
|
||||
- Proposal for db schema changes
|
||||
|
||||
As a temporary solution, There is check if there is new image available as latest tag in ECR and when found, [aws code deploy](https://us-east-2.console.aws.amazon.com/codesuite/codedeploy/applications/nocohub-001?region=us-east-2). This script is running in EC2 instance [here](https://us-east-2.console.aws.amazon.com/ec2/home?region=us-east-2#Instances:instanceState=running;tag:Name=nocohub-001-dev;v=3;$case=tags:true%5C,client:false;$regex=tags:false%5C,client:false)
|
||||
|
||||
#### Operations :
|
||||
- Alerts to be configured.
|
||||
- including performance metrics,
|
||||
- logging, and incident response.
|
||||
|
||||
### Cost Analysis:
|
||||
TODO : make a table structure and add more details
|
||||
EC2 :
|
||||
Currently used: t3.small 2vCPU/2gb 0.0208 USD per Hour - t3.small can run two containers
|
||||
Alternates t3.micro provides 2vCPU/1GB at half the cost (0.0104 USD per Hour) but can run only one container.
|
||||
|
||||
Fargate:
|
||||
pay as per use \
|
||||
For 2vCPU/2GB used for entire month would cost approximately $5 (pure approxmiataion based on example 4 on [this](https://aws.amazon.com/fargate/pricing/) page)
|
||||
|
||||
RDS:
|
||||
|
||||
LB:
|
||||
|
||||
ElastiCache:
|
||||
|
||||
Others:
|
||||
|
||||
### Tools comparision:
|
||||
TODO : make a table structure and add more details
|
||||
eks vs ecs vs app runner
|
||||
|
||||
|
||||
Conclusion and Future Work:
|
||||
- Kubernetes / EKS : Kubernetes setup comes up with additional maintainance overhead but this would be ideal to maintain same setup for saas and support on-premise setup customised for customers choice of cloud. our cloud setup and customer. Since on-prem/multi cloud is out of scope at the moment.
|
||||
- Better support for multi-single-tenant and multi-tenant to support special isolation requirements from customers (support one click setup). This would also require application level changes
|
||||
- database split read and write paths
|
||||
- Explore cost effective options like
|
||||
- fargate with ECS
|
||||
- spot instances for autoscaling
|
||||
|
||||
1
cloud/arch_image_source.drawio
Normal file
1
cloud/arch_image_source.drawio
Normal file
@@ -0,0 +1 @@
|
||||
<mxfile modified="2023-01-23T17:28:32.451Z" host="app.diagrams.net" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" etag="DgECGWXluAJlbZVTjSDI" version="20.8.10" type="google"><diagram id="Ht1M8jgEwFfnCIfOTk4-" name="Page-1">7V1tc5u4Fv41nrn7wR7EOx8dx972TtPNbbbtdr9kMMg2LUZekJ2kv/5KgDBIwqY22E7WSTsBIYTQOec5LzoSPW20fP49dleLO+TDsKcq8zjwe9ptT1UB+U8KVu4cVgpojYfgJytU8tJ14MOkUhEjFOJgVS30UBRBD1fK3DhGT9VqMxSK3Xjw3BAKpV8DHy+yUlu1tuXvYDBfsAcB08muLF1WOe94snB99FQq0sY9bRQjhLOj5fMIhnRk2Lhk901qrhYdi2GEm9zwEr3/3f16NzStzRd7FIbBX+67fv4aGzdc5y889HCAop427KlmSBq+mcbkaE6PbtYBGSwytCFa078+8n7AmD5iSWmXvSV+YUMXo3XkQ/p0hdz8tAgwfFi5Hr36RDiBlC3wMiRngBzm/YAxhs+1LwiKYSPMBNES4viFVMlvUE0tu+Ulr81G/mlLOM3I33hRIpqq5BXdnDfmRdvb8SQH+ZD+wvAyNimNCvQJf+WnKMYLNEeRG463pTfVcdvW+YDQKh+t7xDjl1w23DVG1bEk4xW//EXvHxjs9FveXHpy+1w5eymf3cM4IC9P6JoVzlCE8ycBuyAUfYvdZCIvjdaxB3eMDlBz+XXjOcS7htGUEz6GoYuDTbUnrRORdbMkJCJVSd1V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OYVBlGaJJpJK2rLHq7SXKzsPxJHOmtV1/hjbIns8+iocsBNV3XDRmBQ465BJPrWO6TyhDPQpuNP3iC08cp/SZitlNwa/bXHtbRbU7BGGKmgAyctO48KvCqtpjo8KN8TXftz76Kd7ZpqAaSnvN79nHKyrDLxWiv9NUAbXmpXfqwIRN4Kbzn/bldYEw/WTqkA6FOPD9SBgExImYBYal44JEnqhPfxS75Q8uJmTNJkBe4YT+C+AnFP/pEyCZUTCaqQ8hhD1bRvA3LweHywjUR1k+6bL/D5OIqDeYBph8CyIZenmrsE39sUnxe69CEsKYOcXOfXPbxvyo6tcEZXLpt4TmVjUrnlAleoIGLheMgW+2z99ucnAL3DWj7ukAucsVWp5pptjOoxEioipssFiFJXt610Om4zZbO8s3anWsRSxskVj5ou29rxBbVYuPVikbNznpHTpsAnfm/TPjY+YlWDhqiyv3jfvyRhqTeN5isfXXaGOzVxlOEMIEGd9XfoJBmZE2onE5Ig4FX6OMDrep9sxIKp6NNaYBGGofuDDhMEYzHNPic7N92ffycLpykj8iz3kvLDHdw1dsJY+8hOOAW6+myeI7MKutM9dq7t9d8I4lgatrWQYlgjTVLQ8WiHqtYjiN3h/v0De/fN7WlT7sYR90aEW1uvmvv/ZqionObVLC5hCN33wUn+wgXW4bXMTycNLWzcQilZtHikSZg4WHnxLR0ZcBH6w82AslpjKhUbqvTKOEd8qmsjf8P</diagram></mxfile>
|
||||
64
cloud/setup/aws/README.md
Normal file
64
cloud/setup/aws/README.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# nocohub-001 setup on AWS
|
||||
The steps outlined below are used to set up a cloud environment on AWS. Please note that the resources used in this process are named using the keyword "nocohub-001", and the JSON files provided may not be suitable for direct use due to potential naming conflicts. These files are intended to serve as an example of the steps taken and may be useful in creating similar clusters in other regions, but additional work may be required.
|
||||
|
||||
## step 1: pre-requsite
|
||||
- vpc with subnets,VPC endpoints and route tables, security groups
|
||||
- vpc: 172.33.16.0/20 - about 4k usable addresses; 2 route tables; 1 Internet gateway; Endpoints
|
||||
|
||||
- create users / roles
|
||||
- container registry
|
||||
- s3 bucket for config file
|
||||
- secret manager
|
||||
|
||||
## step 2: loadbalancer and targets
|
||||
- create loadbalancer and targets with instance type for ec2, ip type for fargate
|
||||
|
||||
## step 3: setup Postgres with credentials in secret manager
|
||||
- postgres on rds
|
||||
- configure security groups to allow only from ec-2 instance nocohub-001-ec2 security group
|
||||
|
||||
## step 4: setup redis on elasti cache (non cluster mode)
|
||||
- elastiCache (redis)
|
||||
- configure security groups to allow only from ec-2 instance nocohub-001-ec2 security group
|
||||
|
||||
## step 5: ec2 / asg
|
||||
- create asg with autoscaling config to scale up slightly before the ecs scaling and scale down slightly later ecs scaling policy to make sure instances are available for scale-out and graceful scale-in. \
|
||||
`
|
||||
aws autoscaling create-auto-scaling-group --auto-scaling-group-name nocohub-001-t3small-for-ecs --cli-input-json file://asg.json --region us-east-2
|
||||
`
|
||||
|
||||
## step 6: ecs
|
||||
- create task definition \
|
||||
`aws ecs register-task-definition --family nocohub-001-task-definition --region us-east-2 --cli-input-json file://task_definition_ec2.json`
|
||||
- create serivce with capacityProviderStrategy, CODE_DEPLOY \
|
||||
`aws ecs create-service --cli-input-json file://nocohub-service.json --region us-east-2`
|
||||
|
||||
## step 7: ecs application-autoscaling
|
||||
- Register scalable target. Min/Max configured here \
|
||||
`aws application-autoscaling register-scalable-target --cli-input-json file://scalable_target.json --region us-east-2`
|
||||
|
||||
- create application-autoscaling policy for the service created earlier, this step creates scaling policy \
|
||||
`aws application-autoscaling put-scaling-policy --region us-east-2 --service-namespace ecs --cli-input-json file://scaling_policy.json --target-tracking-scaling-policy-configuration file://target_tracking.json `
|
||||
|
||||
## step 8: code deploy config (user role and permissions to be configured correctly)
|
||||
- create application \
|
||||
`aws deploy create-application --region=us-east-2 --cli-input-json file://cd-application.json`
|
||||
- create deployment group \
|
||||
`aws deploy create-deployment-group --region us-east-2 --cli-input-json file://cd-deployment-group.json`
|
||||
- create deployment, use it in script
|
||||
```
|
||||
AWS_APPLICATION_NAME=nocohub-001
|
||||
AWS_DEPLOYMENT_GROUP_NAME=cd-2
|
||||
CONTAINER_NAME="nocohub"
|
||||
AWS_TASK_DEFINITION_ARN="arn:aws:ecs:us-east-2:249717198246:task-definition/nocohub-001-task-definition:3"
|
||||
APPSPEC=$(echo '{"version":1,"Resources":[{"TargetService":{"Type":"AWS::ECS::Service","Properties":{"TaskDefinition":"'${AWS_TASK_DEFINITION_ARN}'","LoadBalancerInfo":{"ContainerName":"'${CONTAINER_NAME}'","ContainerPort":8080}}}}]}' | jq -Rs .)
|
||||
REVISION='{"revisionType":"AppSpecContent","appSpecContent":{"content":'${APPSPEC}'}}'
|
||||
aws deploy create-deployment --application-name "${AWS_APPLICATION_NAME}" --deployment-group-name "${AWS_DEPLOYMENT_GROUP_NAME}" --revision "$REVISION"
|
||||
```
|
||||
|
||||
## step 9: roll out a new version, begin by creating a new task definition and then proceed to run step 8 of the CodeDeploy process.
|
||||
- create new task definition required for deployment (update container imgage tag) \
|
||||
`aws ecs register-task-definition --family nocohub-001-task-definition --region us-east-2 --cli-input-json file://task_definition_ec2.json`
|
||||
|
||||
|
||||
|
||||
37
cloud/setup/aws/asg.json
Normal file
37
cloud/setup/aws/asg.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"AutoScalingGroupName": "nocohub-001-t3small-for-ecs",
|
||||
"LaunchTemplate": {
|
||||
"LaunchTemplateId": "lt-0322463d2aa50a198",
|
||||
"Version": "$Default"
|
||||
},
|
||||
"MinSize": 1,
|
||||
"MaxSize": 12,
|
||||
"DesiredCapacity": 1,
|
||||
"DefaultCooldown": 300,
|
||||
"AvailabilityZones": [
|
||||
"us-east-2a",
|
||||
"us-east-2b",
|
||||
"us-east-2c"
|
||||
],
|
||||
"LoadBalancerNames": [],
|
||||
"TargetGroupARNs": [
|
||||
"arn:aws:elasticloadbalancing:us-east-2:249717198246:targetgroup/nocohub-001-ecs-target-group/65afd18ce54b8c81"
|
||||
],
|
||||
"HealthCheckType": "EC2",
|
||||
"HealthCheckGracePeriod": 300,
|
||||
"VPCZoneIdentifier": "subnet-0f815721f89468e42,subnet-082a8e3d794066249,subnet-02a16be8d48549012",
|
||||
"Tags": [
|
||||
{
|
||||
"ResourceId": "nocohub-001-t3small-for-ecs",
|
||||
"ResourceType": "auto-scaling-group",
|
||||
"Key": "AmazonECSManaged",
|
||||
"Value": "",
|
||||
"PropagateAtLaunch": true
|
||||
}
|
||||
],
|
||||
"TerminationPolicies": [
|
||||
"Default"
|
||||
],
|
||||
"NewInstancesProtectedFromScaleIn": false,
|
||||
"ServiceLinkedRoleARN": "arn:aws:iam::249717198246:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling"
|
||||
}
|
||||
4
cloud/setup/aws/cd-application.json
Normal file
4
cloud/setup/aws/cd-application.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"applicationName": "nocohub-001-cli",
|
||||
"computePlatform": "ECS"
|
||||
}
|
||||
46
cloud/setup/aws/cd-deployment-group.json
Normal file
46
cloud/setup/aws/cd-deployment-group.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"applicationName": "nocohub-001-cli",
|
||||
"deploymentGroupName": "cd-2",
|
||||
"deploymentConfigName": "CodeDeployDefault.ECSLinear10PercentEvery1Minutes",
|
||||
"serviceRoleArn": "arn:aws:iam::249717198246:role/nocohub-codedeploy",
|
||||
"deploymentStyle": {
|
||||
"deploymentType": "BLUE_GREEN",
|
||||
"deploymentOption": "WITH_TRAFFIC_CONTROL"
|
||||
},
|
||||
"outdatedInstancesStrategy": "UPDATE",
|
||||
"blueGreenDeploymentConfiguration": {
|
||||
"terminateBlueInstancesOnDeploymentSuccess": {
|
||||
"action": "TERMINATE",
|
||||
"terminationWaitTimeInMinutes": 1
|
||||
},
|
||||
"deploymentReadyOption": {
|
||||
"actionOnTimeout": "CONTINUE_DEPLOYMENT",
|
||||
"waitTimeInMinutes": 0
|
||||
}
|
||||
},
|
||||
"loadBalancerInfo": {
|
||||
"targetGroupPairInfoList": [
|
||||
{
|
||||
"targetGroups": [
|
||||
{
|
||||
"name": "nocohub-001-ecs-target-group"
|
||||
},
|
||||
{
|
||||
"name": "nocohub-001-ecs-target-group-2"
|
||||
}
|
||||
],
|
||||
"prodTrafficRoute": {
|
||||
"listenerArns": [
|
||||
"arn:aws:elasticloadbalancing:us-east-2:249717198246:listener/app/nocohub-001/4a584e0fae8a1203/e54c4059a7a181f7"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"ecsServices": [
|
||||
{
|
||||
"serviceName": "nocohub-service-cli",
|
||||
"clusterName": "nocohub-001"
|
||||
}
|
||||
]
|
||||
}
|
||||
44
cloud/setup/aws/nocohub-service-cd-fargate.json
Normal file
44
cloud/setup/aws/nocohub-service-cd-fargate.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"serviceName": "nocohub-001-cd-fargate-TEST",
|
||||
"cluster": "nocohub-001",
|
||||
"loadBalancers": [
|
||||
{
|
||||
"targetGroupArn": "arn:aws:elasticloadbalancing:us-east-2:249717198246:targetgroup/nocohub-001-fargate-1/ca7fbc7784f980f4",
|
||||
"containerName": "nocohub-001-fargate",
|
||||
"containerPort": 8080
|
||||
}
|
||||
],
|
||||
"serviceRegistries": [],
|
||||
"desiredCount": 1,
|
||||
"launchType": "FARGATE",
|
||||
"platformVersion": "1.4.0",
|
||||
"taskDefinition": "arn:aws:ecs:us-east-2:249717198246:task-definition/nocohub-001-fargate:1",
|
||||
"deploymentConfiguration": {
|
||||
"maximumPercent": 200,
|
||||
"minimumHealthyPercent": 100
|
||||
},
|
||||
"placementConstraints": [],
|
||||
"placementStrategy": [],
|
||||
"networkConfiguration": {
|
||||
"awsvpcConfiguration": {
|
||||
"subnets": [
|
||||
"subnet-0f815721f89468e42",
|
||||
"subnet-082a8e3d794066249",
|
||||
"subnet-02a16be8d48549012"
|
||||
],
|
||||
"securityGroups": [
|
||||
"sg-0df5fe05e2def0eb9"
|
||||
],
|
||||
"assignPublicIp": "ENABLED"
|
||||
}
|
||||
},
|
||||
"healthCheckGracePeriodSeconds": 0,
|
||||
"schedulingStrategy": "REPLICA",
|
||||
"deploymentController": {
|
||||
"type": "CODE_DEPLOY"
|
||||
},
|
||||
"enableECSManagedTags": true,
|
||||
"propagateTags": "NONE",
|
||||
"enableExecuteCommand": false
|
||||
}
|
||||
|
||||
45
cloud/setup/aws/nocohub-service.json
Normal file
45
cloud/setup/aws/nocohub-service.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"serviceName": "nocohub-service-cli",
|
||||
"cluster": "nocohub-001",
|
||||
"loadBalancers": [
|
||||
{
|
||||
"targetGroupArn": "arn:aws:elasticloadbalancing:us-east-2:249717198246:targetgroup/nocohub-001-ecs-target-group/65afd18ce54b8c81",
|
||||
"containerName": "nocohub",
|
||||
"containerPort": 8080
|
||||
}
|
||||
],
|
||||
"serviceRegistries": [],
|
||||
"desiredCount": 1,
|
||||
"capacityProviderStrategy": [
|
||||
{
|
||||
"capacityProvider": "nocohub-001-ecs-t3micro",
|
||||
"weight": 1,
|
||||
"base": 0
|
||||
}
|
||||
],
|
||||
"taskDefinition": "arn:aws:ecs:us-east-2:249717198246:task-definition/nocohub-001-task-definition:2",
|
||||
"deploymentConfiguration": {
|
||||
"maximumPercent": 200,
|
||||
"minimumHealthyPercent": 100
|
||||
},
|
||||
"role": "ecsServiceRole",
|
||||
"placementConstraints": [],
|
||||
"placementStrategy": [
|
||||
{
|
||||
"type": "spread",
|
||||
"field": "attribute:ecs.availability-zone"
|
||||
},
|
||||
{
|
||||
"type": "spread",
|
||||
"field": "instanceId"
|
||||
}
|
||||
],
|
||||
"healthCheckGracePeriodSeconds": 0,
|
||||
"schedulingStrategy": "REPLICA",
|
||||
"deploymentController": {
|
||||
"type": "CODE_DEPLOY"
|
||||
},
|
||||
"enableECSManagedTags": true,
|
||||
"propagateTags": "NONE",
|
||||
"enableExecuteCommand": false
|
||||
}
|
||||
13
cloud/setup/aws/scalable_target.json
Normal file
13
cloud/setup/aws/scalable_target.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"MaxCapacity": 9,
|
||||
"MinCapacity": 1,
|
||||
"ResourceId": "service/nocohub-001/nocohub-service-cli",
|
||||
"RoleARN": "arn:aws:iam::249717198246:role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService",
|
||||
"ScalableDimension": "ecs:service:DesiredCount",
|
||||
"ServiceNamespace": "ecs",
|
||||
"SuspendedState": {
|
||||
"DynamicScalingInSuspended": false,
|
||||
"DynamicScalingOutSuspended": false,
|
||||
"ScheduledScalingSuspended": false
|
||||
}
|
||||
}
|
||||
7
cloud/setup/aws/scaling_policy.json
Normal file
7
cloud/setup/aws/scaling_policy.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"PolicyName": "cpu_cli_manual",
|
||||
"ServiceNamespace": "ecs",
|
||||
"ResourceId": "service/nocohub-001/nocohub-service-cli",
|
||||
"ScalableDimension": "ecs:service:DesiredCount",
|
||||
"PolicyType": "TargetTrackingScaling"
|
||||
}
|
||||
8
cloud/setup/aws/target_tracking.json
Normal file
8
cloud/setup/aws/target_tracking.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"TargetValue": 90.0,
|
||||
"PredefinedMetricSpecification": {
|
||||
"PredefinedMetricType": "ECSServiceAverageCPUUtilization"
|
||||
},
|
||||
"ScaleOutCooldown": 7,
|
||||
"ScaleInCooldown": 30
|
||||
}
|
||||
62
cloud/setup/aws/task_definition_ec2.json
Normal file
62
cloud/setup/aws/task_definition_ec2.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"family": "nocohub-001-task-definition",
|
||||
"containerDefinitions": [
|
||||
{
|
||||
"name": "nocohub",
|
||||
"image": "249717198246.dkr.ecr.us-east-2.amazonaws.com/nocohub:latest",
|
||||
"cpu": 0,
|
||||
"memory": 900,
|
||||
"links": [],
|
||||
"portMappings": [
|
||||
{
|
||||
"containerPort": 8080,
|
||||
"hostPort": 80,
|
||||
"protocol": "tcp"
|
||||
}
|
||||
],
|
||||
"essential": true,
|
||||
"entryPoint": [],
|
||||
"command": [],
|
||||
"environment": [],
|
||||
"environmentFiles": [
|
||||
{
|
||||
"value": "arn:aws:s3:::nocohub-001/env-staging.env",
|
||||
"type": "s3"
|
||||
}
|
||||
],
|
||||
"mountPoints": [],
|
||||
"volumesFrom": [],
|
||||
"secrets": [],
|
||||
"dnsServers": [],
|
||||
"dnsSearchDomains": [],
|
||||
"extraHosts": [],
|
||||
"dockerSecurityOptions": [],
|
||||
"dockerLabels": {},
|
||||
"ulimits": [],
|
||||
"logConfiguration": {
|
||||
"logDriver": "awslogs",
|
||||
"options": {
|
||||
"awslogs-group": "/ecs/nocohub-001-task-definition",
|
||||
"awslogs-region": "us-east-2",
|
||||
"awslogs-stream-prefix": "ecs"
|
||||
},
|
||||
"secretOptions": []
|
||||
},
|
||||
"systemControls": []
|
||||
}
|
||||
],
|
||||
"taskRoleArn": "arn:aws:iam::249717198246:role/ecsTaskExecutionRole",
|
||||
"executionRoleArn": "arn:aws:iam::249717198246:role/ecsTaskExecutionRole",
|
||||
"networkMode": "bridge",
|
||||
"requiresCompatibilities": [
|
||||
"EC2"
|
||||
],
|
||||
"cpu": "1024",
|
||||
"memory": "922",
|
||||
"tags": [
|
||||
{
|
||||
"key": "ecs:taskDefinition:createdFrom",
|
||||
"value": "ecs-console-v2"
|
||||
}
|
||||
]
|
||||
}
|
||||
84
cloud/setup/aws/task_definition_fargate.json
Normal file
84
cloud/setup/aws/task_definition_fargate.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"taskDefinitionArn": "arn:aws:ecs:us-east-2:249717198246:task-definition/nocohub-001-fargate:1",
|
||||
"containerDefinitions": [
|
||||
{
|
||||
"name": "nocohub-001-fargate",
|
||||
"image": "249717198246.dkr.ecr.us-east-2.amazonaws.com/nocohub:latest",
|
||||
"cpu": 0,
|
||||
"memory": 900,
|
||||
"links": [],
|
||||
"portMappings": [
|
||||
{
|
||||
"containerPort": 8080,
|
||||
"hostPort": 8080,
|
||||
"protocol": "tcp"
|
||||
}
|
||||
],
|
||||
"essential": true,
|
||||
"entryPoint": [],
|
||||
"command": [],
|
||||
"environment": [],
|
||||
"environmentFiles": [
|
||||
{
|
||||
"value": "arn:aws:s3:::nocohub-001/env-staging.env",
|
||||
"type": "s3"
|
||||
}
|
||||
],
|
||||
"mountPoints": [],
|
||||
"volumesFrom": [],
|
||||
"logConfiguration": {
|
||||
"logDriver": "awslogs",
|
||||
"options": {
|
||||
"awslogs-group": "/ecs/nocohub-001-fargate",
|
||||
"awslogs-region": "us-east-2",
|
||||
"awslogs-stream-prefix": "ecs"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"family": "nocohub-001-fargate",
|
||||
"executionRoleArn": "arn:aws:iam::249717198246:role/ecsTaskExecutionRole",
|
||||
"networkMode": "awsvpc",
|
||||
"revision": 1,
|
||||
"volumes": [],
|
||||
"status": "ACTIVE",
|
||||
"requiresAttributes": [
|
||||
{
|
||||
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
|
||||
},
|
||||
{
|
||||
"name": "ecs.capability.execution-role-awslogs"
|
||||
},
|
||||
{
|
||||
"name": "com.amazonaws.ecs.capability.ecr-auth"
|
||||
},
|
||||
{
|
||||
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
|
||||
},
|
||||
{
|
||||
"name": "ecs.capability.env-files.s3"
|
||||
},
|
||||
{
|
||||
"name": "ecs.capability.execution-role-ecr-pull"
|
||||
},
|
||||
{
|
||||
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
|
||||
},
|
||||
{
|
||||
"name": "ecs.capability.task-eni"
|
||||
}
|
||||
],
|
||||
"placementConstraints": [],
|
||||
"compatibilities": [
|
||||
"EC2",
|
||||
"FARGATE"
|
||||
],
|
||||
"requiresCompatibilities": [
|
||||
"FARGATE"
|
||||
],
|
||||
"cpu": "512",
|
||||
"memory": "1024",
|
||||
"registeredAt": "2023-01-16T18:16:06.397Z",
|
||||
"registeredBy": "arn:aws:iam::249717198246:user/rajanish.gj@gmail.com",
|
||||
"tags": []
|
||||
}
|
||||
20
cloud/setup/aws/vpc.json
Normal file
20
cloud/setup/aws/vpc.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"CidrBlock": "172.33.33.0/20",
|
||||
"InstanceTenancy": "default",
|
||||
"CidrBlockAssociationSet": [
|
||||
{
|
||||
"CidrBlock": "172.33.16.0/20",
|
||||
"CidrBlockState": {
|
||||
"State": "associated"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Tags": [
|
||||
{
|
||||
"Key": "Name",
|
||||
"Value": "nocohub-001-vpc"
|
||||
}
|
||||
],
|
||||
"EnableDnsSupport": true,
|
||||
"EnableDnsHostnames": true
|
||||
}
|
||||
Reference in New Issue
Block a user