Skip to content

epomatti/azure-terraform-private-endpoints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure-Terraform Private Network

A showcase project demonstrating private networks and private endpoints on Azure with Terraform.

  • Virtual Network Inbound / Outbound protection (NSG)
  • Cosmos DB Network Restrictions
  • Cosmos DB Private Endpoints + Standard Private DNS Zone
  • App Services

Running it

Log into Azure with your favorite tool:

az login

Deploy the resources:

cd ./infrastructure

terraform init
terraform plan
terraform apply -auto-approve

This will take a long time.

API local development

Begin by entering the API module:

cd ./api

Mongo DB

docker pull mongo

docker run -d --name mongodb -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME="app" \
  -e MONGO_INITDB_ROOT_PASSWORD="p4ssw0rd" mongo

Python API

Setup the .env file environment variables:

cp resources/development.env .env

Start the app

# Dependencies
pipenv shell
pipenv install

# App
export FLASK_ENV=development
export FLASK_APP=src/app

python3 -m flask run

Compose

# pull/build
docker pull mongo
sudo docker build -t big-aztf-app .

# compose up
docker-compose up -d