Skip to content
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

Feat/add arangodb ec2 #62

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9e5ea04
feat: terraform to add ArangoDB to AWS environment
Feb 29, 2024
f25ac24
fix: add arango ecr repo to ecs available ecr repos
niross Mar 5, 2024
9f83c4d
Merge pull request #60 from uktrade/fix/ecs-arango-ecr-image-fetch
isobel-daley-6point6 Mar 5, 2024
0ac4121
fix: add arango ECR to IAM policy
Mar 5, 2024
acbd910
fix: amend security groups to enable connection to ECR
Mar 5, 2024
fff52d0
resolve merge conflict by accepting incoming change
Mar 6, 2024
fa35d6e
fix: remove conflict markers
Mar 6, 2024
8ab9c9e
Merge branch 'main' into feat/add_arangodb
Mar 6, 2024
f07b401
fix: adding secruity group rule to enable connection btwn the arango …
Mar 7, 2024
a636fac
fix: add arango_container_port to facilitate connection to load balancer
Mar 19, 2024
fb3f6f1
fix: add security group rules to facilitate connection to load balancer
Mar 19, 2024
830d961
feat: modify infra to use EC2 based container
Mar 27, 2024
ad879a6
feat: changes to help support connection btwn arango and notebook clu…
Mar 27, 2024
b73d04d
feat: modify infra to use EC2 based container
Mar 27, 2024
762ba0a
feat: add DNS and certificate for arango
Mar 27, 2024
600031b
feat: user_data to assign EC2 instance to cluster and install rexray …
Mar 27, 2024
5b2355b
feat: add mount points for container volume
Mar 27, 2024
15258ed
feat: add security groups and rules to manage connection t and from E…
Mar 27, 2024
7fae0d4
Merge branch 'main' of github.com:uktrade/data-workspace into feat/ad…
Mar 27, 2024
55c6535
Random string root password and Arango container env var
Apr 5, 2024
ccb7b21
Arango creds as env vars in main container
Apr 5, 2024
7cd5a97
fix: add vpc endpoints for ecr to facilitate connection with ecs
Apr 8, 2024
47eb127
fix: remove EBS mount points
Apr 8, 2024
1588e33
fix: add commands to install ecs agent to ec2 instance
Apr 8, 2024
f62f8bb
feat: switch arango to run on datasets vpc
Apr 8, 2024
21cf59c
feat: add ebs iam policies
Apr 8, 2024
2534b42
fix: remove ebs volume config using rexray
Apr 8, 2024
cb58592
fix: renamed arango_user_data to ecs_main_arango_user_data.sh
Apr 8, 2024
7d1e9c6
feat: add datasets cidr details for vpc subnets
Apr 8, 2024
21c3c59
feat: add security rules to enable connection from datasets vpc to ecr
Apr 8, 2024
886cd5f
fix: adding rule to allow egress to cloudwatch
Apr 8, 2024
ba9bf91
feat: adjusting arango security groups to use datasets vpc
Apr 8, 2024
8cd99c7
fix: adding security rules to enable connection between ec2 and ecs
Apr 8, 2024
843ab08
feat: creating NAT gateway for datasets vpc
Apr 8, 2024
04ea3a4
fix: adjusting load balancer config
Apr 11, 2024
6f5dc31
fix: adjusting security groups to fix Theia connection
Apr 11, 2024
b625a35
fix: enable dns support and hostnames to true to support connection t…
Apr 11, 2024
5376c21
feat: add mount points for volume
Apr 11, 2024
4a3b62d
feat: mount EBS volume to EC2 instance
Apr 11, 2024
1e23406
feat: add EBS volume
Apr 11, 2024
cd05927
fix: address linting error
Apr 11, 2024
fc30205
fix: adjust arango CPU requirement
Apr 16, 2024
575cacc
Merge branch 'feat/add_arangodb_ec2' into feat/add_arangodb_env_vars
isobel-daley-6point6 Apr 16, 2024
0dddaea
Merge pull request #64 from uktrade/feat/add_arangodb_env_vars
isobel-daley-6point6 Apr 16, 2024
4e9fa6e
fix: minor amendments to Arango environment variables to tie in with …
Apr 16, 2024
f472e89
fix: move hard-coded variables into main.tf
Apr 24, 2024
bf7a784
fix: restrict resources to which EBS IAM policy applies
Apr 24, 2024
0734940
fix: remove redundant security groups
Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions infra/ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ resource "aws_ecr_repository" "mlflow" {
name = "${var.prefix}-mlflow"
}

resource "aws_ecr_repository" "arango" {
name = "${var.prefix}-arango"
}

resource "aws_vpc_endpoint" "ecr_dkr" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.${data.aws_region.aws_region.name}.ecr.dkr"
Expand Down Expand Up @@ -122,6 +126,34 @@ resource "aws_vpc_endpoint" "ecr_api" {
timeouts {}
}

resource "aws_vpc_endpoint" "ecr_dkr_datasets" {
vpc_id = aws_vpc.datasets.id
service_name = "com.amazonaws.${data.aws_region.aws_region.name}.ecr.dkr"
vpc_endpoint_type = "Interface"
private_dns_enabled = true

security_group_ids = ["${aws_security_group.ecr_dkr_datasets.id}"]
subnet_ids = ["${aws_subnet.datasets.*.id[0]}"]

policy = data.aws_iam_policy_document.aws_vpc_endpoint_ecr.json

timeouts {}
}

resource "aws_vpc_endpoint" "ecr_api_datasets" {
vpc_id = aws_vpc.datasets.id
service_name = "com.amazonaws.${data.aws_region.aws_region.name}.ecr.api"
vpc_endpoint_type = "Interface"
private_dns_enabled = true

security_group_ids = ["${aws_security_group.ecr_api_datasets.id}"]
subnet_ids = ["${aws_subnet.datasets.*.id[0]}"]

policy = data.aws_iam_policy_document.aws_vpc_endpoint_ecr.json

timeouts {}
}

data "aws_iam_policy_document" "aws_vpc_endpoint_ecr" {
# Contains policies for both ECR and DKR endpoints, as recommended

Expand Down Expand Up @@ -271,6 +303,7 @@ data "aws_iam_policy_document" "aws_vpc_endpoint_ecr" {
"${aws_ecr_repository.superset.arn}",
"${aws_ecr_repository.flower.arn}",
"${aws_ecr_repository.mlflow.arn}",
"${aws_ecr_repository.arango.arn}"
]
}

Expand Down
4 changes: 4 additions & 0 deletions infra/ecs_main_admin.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ locals {
authbroker_url = "${var.admin_authbroker_url}"
secret_key = "${random_string.admin_secret_key.result}"

arango_db__host = "http://${aws_lb.arango.dns_name}"
arango_db__password = "${random_string.aws_arangodb_root_password.result}"
arango_db__port = "${local.arango_container_port}"

environment = "${var.admin_environment}"

uploads_bucket = "${var.uploads_bucket}"
Expand Down
16 changes: 16 additions & 0 deletions infra/ecs_main_admin_container_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@
"name": "EXPLORER_DEFAULT_CONNECTION",
"value": "datasets_1"
},
{
"name": "ARANGO_DB__HOST",
"value": "${arango_db__host}"
},
{
"name": "ARANGO_DB__PORT",
"value": "${arango_db__port}"
},
{
"name": "ARANGO_DB__USER",
"value": "root"
},
{
"name": "ARANGO_DB__PASSWORD",
"value": "${arango_db__password}"
},
{
"name": "ALLOWED_HOSTS__1",
"value": "${root_domain}"
Expand Down
Loading