An open API service indexing awesome lists of open source software.

https://github.com/epomatti/azure-terraform-private-endpoints

Private networks & private endpoints
https://github.com/epomatti/azure-terraform-private-endpoints

azure azure-private-dns-zone azure-private-endpoints azure-private-link azurerm-terraform-provider cosmosdb terraform

Last synced: 3 months ago
JSON representation

Private networks & private endpoints

Awesome Lists containing this project

README

        

# Azure-Terraform Private Network

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

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

## Running it

Log into Azure with your favorite tool:

```sh
az login
```

Deploy the resources:

```sh
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:

```sh
cd ./api
```

### Mongo DB

```bash
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:

```bash
cp resources/development.env .env
```

Start the app

```bash
# Dependencies
pipenv shell
pipenv install

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

python3 -m flask run
```

## Compose

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

# compose up
docker-compose up -d
```