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

Updating terraform ssh #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions terraform-zerotrust-ssh-http-gcp/bootstrap.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Providers
provider "cloudflare" {
email = var.cloudflare_email
account_id = var.cloudflare_account_id
api_key = var.cloudflare_token
api_token = var.cloudflare_token
}
provider "google" {
project = var.gcp_project_id
Expand Down Expand Up @@ -53,4 +52,4 @@ variable "cloudflare_email" {
variable "cloudflare_token" {
description = "The Cloudflare user's API token."
type = string
}
}
9 changes: 5 additions & 4 deletions terraform-zerotrust-ssh-http-gcp/server.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Script to install Cloudflare Tunnel and Docker resources
# Docker configuration
cd /tmp
sudo apt-get install software-properties-common
# Retrieveing the docker repository for this OS
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
Expand All @@ -20,10 +21,10 @@ services:
EOF

# cloudflared configuration
cd
cd ~
# The package for this OS is retrieved
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.deb
sudo dpkg -i cloudflared-stable-linux-amd64.deb
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
# A local user directory is first created before we can install the tunnel as a system service
mkdir ~/.cloudflared
touch ~/.cloudflared/cert.json
Expand Down Expand Up @@ -61,4 +62,4 @@ sudo cloudflared service install
sudo cp -via ~/.cloudflared/cert.json /etc/cloudflared/
# Now we can bring up our container(s) with docker-compose and then start the tunnel
cd /tmp
sudo docker-compose up -d && sudo service cloudflared start
sudo docker-compose up -d && sudo systemctl start cloudflared