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

Quick & dirty setup of a read only airbyte instance #1802

Merged
merged 17 commits into from
Jan 27, 2021
Prev Previous commit
Next Next commit
progress
  • Loading branch information
michel-tricot committed Jan 21, 2021
commit f8d790b1df5f419942ed053e834621fb90baddf8
2 changes: 1 addition & 1 deletion docs/deploying-airbyte/on-aws-ec2.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ssh -i $SSH_KEY ec2-user@$INSTANCE_IP
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker $USER
sudo usermod -a -G docker ec2-user
```

* Install `docker-compose`
Expand Down
4 changes: 2 additions & 2 deletions terraform/aws/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ install_docker() {
}

install_docker_compose() {
sudo wget "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -O /usr/local/bin/docker-compose
sudo wget https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m) -O /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
}

install_airbyte() {
mkdir airbyte && cd airbyte
wget https://raw.githubusercontent.com/airbytehq/airbyte/master/{.env,docker-compose.yaml}
docker-compose up -d
API_URL=/api/v1/ docker-compose up -d
}

main() {
Expand Down
32 changes: 31 additions & 1 deletion terraform/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ variable "subnets" {
]
}

variable "key_name" {
type = string
default = "airbyte-app"
}

variable "certificate" {
type = string
default = "arn:aws:acm:us-east-1:168714685353:certificate/c762da95-be91-466d-a9f0-1c22f449ae0d"
Expand Down Expand Up @@ -95,7 +100,7 @@ resource "aws_instance" "airbyte-instance" {

security_groups = [aws_security_group.airbyte-instance-sg.name]

key_name = "airbyte-app"
key_name = var.key_name

user_data = file("${path.module}/init.sh")

Expand Down Expand Up @@ -140,6 +145,10 @@ resource "aws_lb_target_group" "airbyte-webapp" {
port = 8000
protocol = "HTTP"
vpc_id = var.vpc

health_check {
path = "/"
}
}

resource "aws_lb_target_group_attachment" "airbyte-webapp" {
Expand All @@ -153,6 +162,10 @@ resource "aws_lb_target_group" "airbyte-api" {
port = 8001
protocol = "HTTP"
vpc_id = var.vpc

health_check {
path = "/api/v1/health"
}
}

resource "aws_lb_target_group_attachment" "airbyte-api" {
Expand All @@ -173,3 +186,20 @@ resource "aws_lb_listener" "airbyte-app" {
target_group_arn = aws_lb_target_group.airbyte-webapp.arn
}
}

resource "aws_lb_listener_rule" "api" {
listener_arn = aws_lb_listener.airbyte-app.arn
priority = 100

action {
type = "forward"
target_group_arn = aws_lb_target_group.airbyte-api.arn
}

condition {
path_pattern {
values = ["/api/v1/*"]
}
}
}

1 change: 0 additions & 1 deletion terraform/gcp/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ install_docker() {
sudo apt-get update
sudo apt-get install -y containerd.io
sudo apt-get install -y docker-ce docker-ce-cli || true
# sudo usermod -a -G docker "$USER"
sudo service docker start
}

Expand Down